Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'making a transformation' topicStudent Support Forum > General > "making a transformation"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
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: ,

Subject (listing for 'making a transformation')
Author Date Posted
making a transformation Ed Nowak 05/16/12 05:19am
Re: making a transformation Bill Simpson 05/16/12 1:18pm
Re: Re: making a transformation Ed Nowak 05/19/12 00:18am
Re: Re: making a transformation Ed Nowak 05/19/12 02:14am
Re: Re: Re: making a transformation Bill Simpson 05/21/12 00:41am
Re: Re: Re: Re: making a transformation Ed Nowak 05/25/12 01:18am
Re: Re: Re: Re: making a transformation Ed Nowak 05/25/12 02:23am
Re: Re: Re: Re: Re: making a transformation Bill Simpson 05/26/12 10:14pm
Re: Re: Re: Re: Re: Re: making a transformation Ed Nowak 05/28/12 7:22pm
Re: Re: Re: Re: Re: making a transformation Michael 05/27/12 07:20am
Re: making a transformation Ed Nowak 05/18/12 07:25am
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic