kill(all)$

integral:  for circle.  ' version 1.0'
peter.vlasschaert@gmail.com,24/06/2018.

rem : circle ,'closed orbit', a1=a2.

load(lrats)$

assume (a2>0);

a1:a2;

pa1:1/(a2+a1*cos(x)) = pa;

p1: 1/(a2+a1*cos(x))^2;

flight time integral  : ellipse , 'closed orbit'

p1a:'integrate(p1,x,0,x) ;

solve : 'p1a' , constraint from above.

p2:integrate(p1, x);

second part :  
============================

introduce : half angles. (google ,tan(x/2)),fig.

We want use formula ( fig 1)   θ => x ,tan(x/2) =sin(x)/(1+cos(x)) =q
=>  q=tan(x/2)

p3 :sin(x)/(1+cos(x)) =q ;

p4:lratsubst([p3,a2=a],p2);

p5:subst(tan(x/2),q,p4);

p6:expand(p5);

?? negdistrib;

negdistrib;

! found : standard mathematical handbook,beyer ,1991,with above constraint.
=============================================================
constraint : a2=a1 =a ,a2 > 0
=============================================================

result : integral 'p1a' : use later for time in orbital position '

p7:ev(p1a,a2=a)=p6;

-------------------------------------------------------------------------------------------------------------------------------