# [Maxima] How to simplifiy a*sin(x)+b*cos(x)

Rafał Topolnicki rtopolnicki at o2.pl
Fri Sep 5 15:10:19 CDT 2008

```Sorry, my mistake. I misused atan and atan2 functions. You are right.

Judy Toth pisze:
> It is correct according to my computations.
>
> Rich
>
>
>
>
>  ------------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
>
>
```