Chain rule in Maxima



  Chain rule
(%i1) depends(f,g,g,x);
(%o1) [f(g),g(x)]
(%i2) d:diff(f,x);
(%o2) ('diff(f,g,1))*('diff(g,x,1))
(%i3) g=x^2;
(%o3) g=x^2
(%i4) diff(%,x);
(%o4) 'diff(g,x,1)=2*x
(%i5) subst(%,d);
(%o5) 2*('diff(f,g,1))*x

 Other method:
(%i6) kill(all)$ reset()$
(%i2) load(pdiff)$
(%i3) diff(f(g(x)),x);
(%o3) g[(1)](x)*f[(1)](g(x))
(%i4) convert_to_diff(%);
(%o4) ('diff(g(x),x,1))*(at('diff(f(g34113),g34113,1),[g34113=g(x)]))


Example. Solve Chebyshev Differential Equation
http://www.math24.net/chebyshev-equation.html
(%i1) eq:(1-x^2)*'diff(y,x,2)-x*'diff(y,x)+n^2*y=0$
(%i2) tr:x=cos(t);
(%o2) x=cos(t)
(%i3) itr:solve(tr,t)[1];
(%o3) t=acos(x)
(%i4) depends(y,t,t,x)$
(%i5) eq1:ev(eq,nouns);
(%o5)
(1-x^2)*(('diff(t,x,1))^2*('diff(y,t,2))+('diff(t,x,2))*('diff(y,t,1)))-('diff(t,x,1))*x*('diff(y,t,1))+n^2*y=0
(%i6) [diff(itr,x),diff(itr,x,2)];
(%o6) ['diff(t,x,1)=-1/sqrt(1-x^2),'diff(t,x,2)=-x/(1-x^2)^(3/2)]
(%i7) subst(%,eq1);
(%o7)
(1-x^2)*('diff(y,t,2)/(1-x^2)-(x*('diff(y,t,1)))/(1-x^2)^(3/2))+(x*('diff(y,t,1)))/sqrt(1-x^2)+n^2*y=0
(%i8) radcan(%);
(%o8) 'diff(y,t,2)+n^2*y=0
(%i9) ode2(%,y,t);
"Is  "n"  zero or nonzero?"n;
(%o9) y=%k1*sin(n*t)+%k2*cos(n*t)
(%i10) subst(itr,%);
(%o10) y=%k1*sin(n*acos(x))+%k2*cos(n*acos(x))

best
Aleksas Domarkas