one question about Maxima



The simplest way to solve trigonometric equations like this in Maxima is to
use exponentialize.  The main problem with that approach is in massaging the
output so that it is intelligible.  In this case, it works well:

(%i1) ex : A*(-sin(x)+1)=2*B*cos(x);
(%o1) (1-sin(x))*A = 2*cos(x)*B
(%i2) ex,exponentialize;
(%o2) (%i*(%e^(%i*x)-%e^-(%i*x))/2+1)*A = (%e^(%i*x)+%e^-(%i*x))*B
(%i3) solve(%,x);
(%o3) [x = -%i*log(2*%i*B/(2*B-%i*A)+A/(2*B-%i*A)),x =
-%i*log(A/(2*B-%i*A)-2*%i*B/(2*B-%i*A))]
(%i4) rectform(%);
(%o4) [x =
atan2(4*B^2/(4*B^2+A^2)+A^2/(4*B^2+A^2),0)-%i*log(4*B^2/(4*B^2+A^2)+A^2/(4*B^2+A^2)),
       x =
-%i*log((A^2/(4*B^2+A^2)-4*B^2/(4*B^2+A^2))^2+16*A^2*B^2/(4*B^2+A^2)^2)/2-atan2(4*B^2/(4*B^2+A^2)-A^2/(4*B^2+A^2),4*A*B/(4*B^2+A^2))]
(%i5) ratsimp(%);
(%o5) [x = %pi/2,x = -atan2((4*B^2-A^2)/(4*B^2+A^2),4*A*B/(4*B^2+A^2))]
           <<< it's a pity that simplification of atan2 can't go from
atan2(x/EXPR,y/EXPR) => atan2(x,y) where EXPR is known to be >=0

Verify solutions

(%i6) subst(%o5[1],ex);
(%o6) 0 = 0
(%i7) subst(%o5[2],ex);
(%o7)
A*((4*B^2-A^2)/((4*B^2+A^2)*sqrt((4*B^2-A^2)^2/(4*B^2+A^2)^2+16*A^2*B^2/(4*B^2+A^2)^2))+1)
        =
8*A*B^2/((4*B^2+A^2)*sqrt((4*B^2-A^2)^2/(4*B^2+A^2)^2+16*A^2*B^2/(4*B^2+A^2)^2))
(%i8) ratsimp(%);
(%o8) 8*A*B^2/(4*B^2+A^2) = 8*A*B^2/(4*B^2+A^2)



On Tue, Jun 23, 2009 at 4:53 PM, Edwin Woollett <woollett at charter.net>wrote:


> A(-sin(x)+1)=2Bcos(x)
>
>