Question: How to produce substitution?

how to transform this differential equation with a substitution?

f := diff(u(x),x$2) + p(x)*diff(u(x),x)+q(x)*u(x)=0;
transformed := subs(x=1/t, f);

 

f := diff(u(x),t$2)*diff(t,x$2) + p(x)*diff(u(x),t)*diff(t,x)+q(x)*u(x)=0;

diff(1/t,t);
diff(1/t,t$2);

 

x = 1/t
dx/dt = -1/t^2
d2x/dt2 = 2/t^3

d2u/dt2*dt2/dx2
du/dt*dt/dx
diff(u(t),t$2)*1/(2/t^3) + p(t)*diff(u(t),t)*1/(-1/t^2)+q(t)*u(t)

restart;
f := u2*1/(2/t^3) + p(t)*u1*1/(-1/t^2)+q(t)*u;
f2 := collect(f/t^3*2, {u2, u1, u});
subs(u2 = diff(u(t),t$2), subs(u1 = diff(u(t), t), subs(u=u(t), f2)));

but not equal to below which is in book, is this equation wrong in book?

f := diff(u(t), t$2) + (2/t-1/t^2*p(1/t))*diff(u(t),t) + 1/t^4*q(1/t)*u(t) = 0;

 

Please Wait...