kill(all)$

basic : calculus of variations  => Euler's 'equation'
peter.vlasschaert@gmail.com, 09/08/2017

How to find :  (  A= area of the surface of revolution 'minimum')
 =>  rotation curve around y axis
A=2*π*integrate(x*(diff(y,x)^2+1),x,x1,x2);
=> minimum : f= x*x*(diff(y,x)^2+1)
euler-lagrange equations : diff(f,y)-diff(diff(f,y_x),x) = 0
rem : y_x= diff(y,x)

? find length of curve

definition : arclength 's'

p1:(ds)^2=(dx)^2+(dy)^2;

p2:p1/(dx)^2;

p3:part(p2,1)=partfrac(part(p2,2),dx);

p4:expand(p2);
p5:ev(p3,dy^2/dx^2=k^2);

p6:ratsimp(sqrt(p5)*abs(dx));

depends([y],x);

p7:ev(p6,k=diff(y,x));
p8:ratcoef(part(p7,2),abs(dx));
p9:s=integrate(p8,x);

assume(a>0);

 equation circle through origin (0,0) and radius = a
    =>      x^2+y^2=a^2

p91:y^2+x^2 =a^2;
p92: solve(p91,y);

equation : below semi circle

p93:part(p92,1);

equation : above semi circle

p94:part(p92,2);

p10:ev(p9,p94);

p11:ev(p10,diff);

integration :  length : above semi circle -a <= x =<a

p12:ev(p8,p94);
p13:ev(p12,diff);
p14:integrate(p13, x, -a, a);

integration :  length : below semi circle -a <= x =<a

p15:ev(p8,p93);
p16:ev(p12,diff);
p17:integrate(p16, x, -a, a);

circumferential of a circle (  =  above and below of a semi circle)

p18:p14+p17;

/*remdepends(y,x);*/;

p19:f=x*(1+(y_x)^2)^(1/2);

p191:'diff(part(p19,1),y)=diff(part(p19,2),y);

p20:'diff(part(p19,1),y_x)=diff(part(p19,2),y_x);

p21:'diff(part(p20,2),x)=0;

from mathematics: d/dx(p) = 0   => p = constant = b

p22:part(p20,2)=b;

p23:ev(p22,y_x=diff(y,x));

p24:(p23)^2;

p25:solve(p24,diff(y,x));

p26:part(p25,2);
p261:part(p26,2);

: => revolution curve around y axis

begin point curve: (x1,y1)
end    point curve: (x2,y2)

assume(x2>x1);

solve : 'differential equation' => 'p26'

ode : no solution

p271:ode(p26,y,x);

ode2 :  solution

p272:ode2(p26,y,x);

for rotation around y axis : y = x^3

p273 : x^3=part(p272,2);

p274:ev(p273,x=x1);
p275:ev(p273,x=x2);

p276:part(solve(p274,%c),1);
p277:ev(p275,p276);
p278:solve(p277,b);

hyperbolic functions =>

formula : (cosh(θ))^2-(sinh(θ))^2=1

assume(b>0);

p276:trigsimp((cosh(θ))^2-(sinh(θ))^2);

definition : cosh(y) =(exp(y)+exp(-y))/2
                      sinh(y) =(exp(y)- exp(-y))/2

ph1: x=cosh(y);

ph2:x=(exp(+y)+exp(-y))/2;

solve =>  quadratic equation = function(exp(y))
 ( find :y )

ph301:ph2*2;
ph302:expand(exp(y)*ph301);
ph303:rhs(ph302)-lhs(ph302)=0;
ph304:ev(ph303,exp(y)=v,(exp(y))^2=v^2);
ph305:part(solve(ph304,v),2);
ph306:ev(ph305,v=exp(y));
ph307:log(ph306);

ph3:diff(ph2,x);
ph4: part(solve(ph3,diff(y,x)),1);
ph5:ratcoef(part(ph3,2,1),diff(y,x));
ph6:expand(ph5)/part(ph3,2,2)=sinh(y);
ph7:part(ph3,1) =part(ph6,2)*diff(y,x);
ph8:part(solve(ph7,diff(y,x)),1);
ph9:(cosh(y))^2-(sinh(y))^2=1;
ph10:solve(ph9,sinh(y));
ph11:part(ph10,2);
ph12:ev(ph11,part(ph1,2)=part(ph1,1));
ph13:ev(ph8,ph12);
ph14:part(solve(ph1,y),1);

ph15:'diff(part(ph14,2),x)=part(ph13,2);

! display ,maxima  y-> yy  (x-> xx/b)

ph16:ratsimp(ev(part(ph15,2),x=xx/b));
ph17:'yy=b*ev(part(ph14,2),x=xx/b)+d;

=>              d(xx/b) = 1/b*dxx ( b  before  acosh(xx/b))

ph18:part(solve(ph17,xx),1);
ph19:ratsimp(ph18);