one question about Maxima



----- Original Message ----- 
From: "Renzo Del Fabbro" <renzodelfabbro at alice.it>
To: "Edwin Woollett" <woollett at charter.net>
Sent: Tuesday, June 23, 2009 2:47 PM
Subject: Re: one question about Maxima 


> Hi Edwin,
> 
> thanks for your fast reply  ...
> 
> I think you haven't see my solution on the web link 
> 
> but I think to have done it in a similar way like you e-mail me :)
> 
> I've attached a .doc file to show how ... tell me if I am right please.
> 
> 
> Thanks again. ... a lot, for your help !
> 
> Renzo
>

Hi again, Renzo,

Yes, your method is much simpler than mine.
let t = tan(x/2), then

(%i1) display2d:false$
(%i2) eqn : expand(a*(1-sin(x)) = 2*b*cos(x));
(%o2) a-a*sin(x) = 2*b*cos(x)
(%i3) ratsubst(2*t/(1+t^2),sin(x),eqn);
(%o3) a*(t^2-2*t+1)/(t^2+1) = 2*b*cos(x)
(%i4) ratsubst((1-t^2)/(1+t^2),cos(x),%);
(%o4) (a*t^2-2*a*t+a)/(t^2+1) = -b*(2*t^2-2)/(t^2+1)
(%i5) solve(%,t);
(%o5) [t = (a-2*b)/(2*b+a),t = 1]
(%i6) t1 : rhs(first(%));
(%o6) (a-2*b)/(2*b+a)
(%i7) tanx : ratsimp(2*t1/(1-t1^2));
(%o7) -(4*b^2-a^2)/(4*a*b)
(%i8) solve(tan(x) = %,x);
solve: using arc-trig functions to get a solution.
Some solutions will be lost.
(%o8) [x = -atan(b/a-a/(4*b))]
(%i9) ratsimp(first(%));
(%o9) x = -atan((4*b^2-a^2)/(4*a*b))

which is the solution I got with more trouble.
We need to help out Maxima twice with your
method, once to know (remember) the  facts that 
sin(x) = 2*t/(1+t^2), cos(x) = (1-t^2)/(1+t^2),
and finally that 
  tan(x) = 2*tan(x/2)/(1-tan(x/2)^2).

Best Wishes,
Ted Woollett