Sharedeuler equation trig sqrt.sagewsOpen in CoCalc
Author: Ben Payne
Views : 8
Description: Euler equation trig squareroot
# derivation # http://allofphysicsgraph.github.io/proofofconcept/site/derivations_generated_from_project/euler_equation_trig_sqrt.html forget() x=var('x') assume(x,'real') # declareInit initial_expr=exp(I*x)==cos(x)+I*sin(x) print("declare initial expression: "+str(initial_expr)) # multEqXbyEqY expr_thread1=initial_expr*initial_expr print("multiply initial expression") print(" by initial expression: "+str(expr_thread1)) # expand expr_thread1=expr_thread1.expand() print("expand expression: "+str(expr_thread1)) # subXforY expr_thread2=initial_expr.substitute(x=2*x) print("substitute 2x for x: "+str(expr_thread2)) # LHSofEqXeqLHSofEqY if(bool(expr_thread1.lhs() == expr_thread2.lhs())): expr_merged= expr_thread1.rhs() == expr_thread2.rhs() print("combine expression: "+str(expr_merged))
declare initial expression: e^(I*x) == cos(x) + I*sin(x) multiply initial expression by initial expression: e^(2*I*x) == (cos(x) + I*sin(x))^2 expand expression: e^(2*I*x) == cos(x)^2 + 2*I*cos(x)*sin(x) - sin(x)^2 substitute 2x for x: e^(2*I*x) == cos(2*x) + I*sin(2*x) combine expression: cos(x)^2 + 2*I*cos(x)*sin(x) - sin(x)^2 == cos(2*x) + I*sin(2*x)