| Author |
Comment/Response |
Bill Simpson
|
05/16/12 1:18pm
FullSimplify will get you part of the way.
In[1]:= FullSimplify[(a-I b)*E^((-p-I q)*t)+(a+I b)*E^((-p+I q)*t)]
Out[1]= 2 E^(-p t)(a Cos[q t]-b Sin[q t])
This measures Mathematica's complexity of that
In[2]:= LeafCount[Out[1]]
Out[2]= 22
And the complexity of your desired form
In[3]:= LeafCount[2Sqrt[a^2+b^2]E^(-p t)Cos[q t+ArcTan[a,b]]]
Out[3]= 27
So Mathematica believes what you want is "more complicated" and will not choose your form without application of brute force
In[4]:= FullSimplify[(a-I b)*E^((-p-I q)*t)+(a+I b)*E^((-p+I q)*t)]/.a_ Cos[c_]-b_ Sin[c_]->Sqrt[a^2+b^2]Cos[c+ArcTan[a,b]]
Out[4]= 2 Sqrt[a^2+b^2]E^(-p t)Cos[q t+ArcTan[a, b]]
That gives you what you asked for and check
In[5]:= FullSimplify[(a-I b)*E^((-p- I q)*t)+(a+I b)*E^((-p+I q)*t)==Out[4]]
Out[27]= True
Please check this carefully for any errors
URL: , |
|