How to simplifiy a*sin(x)+b*cos(x)



except when a = 0

Rich



 ------------Original Message------------
From: "Richard Hennessy"<rvh2007 at comcast.net>
To: "Rafa? Topolnicki" <rtopolnicki at o2.pl>, Cloud_Chu at ap.logitech.com
Cc: maxima at math.utexas.edu
Date: Fri, Sep-5-2008 11:57 AM
Subject: Re: [Maxima] How to simplifiy a*sin(x)+b*cos(x)

This works.

(%i4) trigexpand(sqrt(b^2+a^2)*sin(x+atan2(b,a)));
(%o4) sqrt(b^2+a^2)*((a*sin(x))/sqrt(b^2+a^2)+(b*cos(x))/sqrt(b^2+a^2))
(%i5) radcan(%);
(%o5) a*sin(x)+b*cos(x)

QED



 ------------Original Message------------
From: Rafa? Topolnicki <rtopolnicki at o2.pl>
To: Cloud_Chu at ap.logitech.com
Cc: maxima at math.utexas.edu
Date: Fri, Sep-5-2008 10:21 AM
Subject: Re: [Maxima] How to simplifiy a*sin(x)+b*cos(x)

Are you sure that your simplification is correct? Plot those two 
functions for a=1,b=-10 or a=-1,b=1.
Whats more:
(%i43) e1;
(%o43) a*sin(x)+b*cos(x)
(%i44) e2;
(%o44) sqrt(b^2+a^2)*sin(x+atan(b/a))
(%i45) ratsimp(ev(e1-e2,x=0));
(%o45) -((abs(a)-a)*b)/a
%o45 is not always 0.
(%i46) ratsimp(ev(e1-e2,x=%pi/2));
(%o46) a-abs(a)
which is also different from 0.

Rafal Topolnicki


Cloud_Chu at ap.logitech.com pisze:
> 
> Hello Sir,
> 
> We are using WxMaxima 0.7.6 for solving some question. Now we want to 
> change a*sin(x)+b*cos(x) into (a^2+b^2)^(1/2)*sin(x+atan(b/a)). By which 
> function I can do this simplification?
> 
> Thank you and have a nice day!
> Cloud
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima