kill(all)$

maxima : parabola given :sqrt(a*x)+sqrt(b*y)=1,version 1.0
peter.vlasschaert@gmail.com,17/05/2022

step 1given :sqrt(a*x)+sqrt(b*y)=1
--------------------------------------

p1:sqrt(a*x)+sqrt(b*y)=1;

→ first time : square

p1a:combine(expand(p1^2));

p1a1:sort(listofvars(p1a));

p1b:sum(ratcoeff(lhs(p1a),p1a1[i])*p1a1[i],i,3,4);

p1b1:lhs(p1a)-p1b;

p1c:lhs(p1a)-rhs(p1a)=0;

p1c1:p1c-p1b1;

→ second time : square

p1d:expand(p1c1^2);

p1d1:(α*a*x+β*b*y)^2=expand((α*a*x+β*b*y)^2);

p1d1a:subst([β=1,α=-1],p1d1);

use : p1d1(a)

p1d1b:lhs(p1d) - rhs(p1d) = 0;

p1d1c:p1d1b+2*b*y+2*a*x-1;

p1d1d:factor(lhs(p1d1c))=rhs(p1d1c);

step 2 : rhs inside quadratic term : constant =λ
--------------------------------------------------------------

p2:part(lhs(p1d1d),1)+λ;

→ find : v

p2a:p2^2 =lhs(p1d1d)+v;

p2b:solve(p2a,v);

p2c:subst(p2b,p2a);

p2d:lhs(p2a)=subst([p1d1d],rhs(p2c));

p2d1:lhs(p2a) =collectterms(expand(rhs(p2d)),x,y);

step 3 : m1*m2 = -1
--------------------------

m1: → first   eq. = {p2=0}

p3a1:p2=0;

p3a1n:sqrt((ratcoeff(lhs(p3a1),x))^2+(ratcoeff(lhs(p3a1),y))^2);

p3a1a1:solve(p3a1,y)[1];

p3a1a2:m1=ratcoeff(rhs(p3a1a1),x);

m2: →second eq.

p3a2:rhs(p2d1)=0;

p3a2b1:expand(solve(p3a2,y))[1];

p3a2b2:m2=ratcoeff(rhs(p3a2b1),x);

→ m2*m1 = -1 

p3c:subst([p3a1a2,p3a2b2],m1*m2=-1);

step 4 : find λ
-------------------

use: p3c

p4:solve(p3c,listofvars(p3c)[3]);

step 5:λ→ p2d1
---------------------

p5:subst(p4,p2d1);

p5a:lhs(p5)=factor(rhs(p5));

p5b1:collectterms((a*b^2*y+a^3*y+b^3*x+a^2*b*x-a*b),x,y);

p5b2a:ratsimp((part(p5b1,1)+part(p5b1,2))/(a^2+b^2));

p5b2b:part(p5b1,3)/(a^2+b^2);

p5c:vv*(p5b2a+p5b2b) =rhs(p5a);

p5c1:solve(p5c,vv)[1];

p5c2:lhs(p5a) =subst(p5c1,lhs(p5c));

p5c3 :b^2+a^2 =w*p3a1n;

p5c4:solve(p5c3,w);

step 6:4*P , Y^2=4*P*X
------------------------------

The length of the latus rectum : 4*P

p6a:4*P=rhs(p5c1)*1/p3a1n;

p6a1:solve(p6a,P);

step 7:Y^2=4*P*X
-------------------------

p7a:Y=part(lhs(p5c2),1);

p7b1:rhs(p6a)*X=rhs(p5c2);

p7b2:ratsimp(solve(p7b1,X))[1];

step 8:focus , X=p,Y=0
------------------------------

p8:[X=P,Y=0];

p8a:subst(p8,[p7a,p7b2]);

p8b:flatten(solve(p8a,[x,y]));

p8c:flatten([p6a1,x=xf,y=yf]);

p8c1:factor(factor(subst(p8c,p8b)));

step 9:directrix,X=-P.
-----------------------------

p9c:subst([X=-P],p7b2);

p9c1:rhs(p9c)-lhs(p9c)=0;

p9c2:(subst(p6a1,p9c1));

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