Change of variables in diferential equations

Run TMF064.Package.m first!

ChangeOfVariables[{D[x[t],t,t]+(ω^2)x[t]==0},
{t->T+β,x[t]->α X[T]},
{t},{x},
{T},{X},
showAll=1
]

Example of ordinary differential equation invariant under rotation

ChangeOfVariables[{(x-y[x])D[y[x],x]==(x+y[x])},
{x->u Cos[ϕ]+v[u] Sin[ϕ],y[x]->-u Sin[ϕ]+v[u]Cos[ϕ]},
{x},{y},
{u},{v},
showAll=1
]

ChangeOfVariables[{(x-y[x])D[y[x],x]==(x+y[x])},
{x->r[ϕ] Cos[ϕ],y[x]->r[ϕ] Sin[ϕ]},
{x},{y},
{ϕ},{r},
showAll=1
]

Example of ordinary differential equation invariant under Galilean transformation

(* in general D[y[x],x,x]==f[x, x D[y[x],x]-y[x]] *)
ChangeOfVariables[{D[y[x],x,x]==f[x,x D[y[x],x]-y[x]]},
{x->X,y[x]->Y[X]+ϵ X},
{x},{y},
{X},{Y},
showAll=1
]

Heat equation

ChangeOfVariables[{D[u[x,t],x,x]==D[u[x,t],t]},
{x->X-2T ϵ,t-> T,u[x,t]->U[X,T]Exp[X ϵ-T ϵ^2]},
{x,t},{u},
{X,T},{U},
showAll=1
]

3-dimensional Schrödinger equation

SchEq=Expand[ChangeOfVariables[{-1/2(D[ψ[x,y,z],x,x]+D[ψ[x,y,z],y,y]+D[ψ[x,y,z],z,z])+V[Sqrt[x^2+y^2+z^2]]ψ[x,y,z]-Energy ψ[x,y,z]==0},
{x->r Sin[θ]Cos[ϕ],y->r Sin[θ]Sin[ϕ],z->r Cos[θ],ψ[x,y,z] -> χ[r,θ,ϕ]/r},
{x,y,z},{ψ},
{r,θ,ϕ},{χ},
showAll=0
]]

Simplify[SchEq,Assumptions->r>0]

Black–Scholes PDE (from Wikipedia - Change of variables (PDE)) transforms to the heat equation

D[V[S,t],t]+S^2D[V[S,t],S,S]/2+S D[V[S,t],S]-V[S,t]==0

ChangeOfVariables[{D[V[S,t],t]+S^2D[V[S,t],S,S]/2+S D[V[S,t],S]-V[S,t]==0},
{S->Exp[x],t->T-2τ,V[S,t]->Exp[-x/2-9τ/4]u[x,τ]},
{S,t},{V},
{x,τ},{u},
showAll=0
]

Hamiltonian of two particles in 1D expressed in the center-of-mass system

ChangeOfVariables[{-D[ψ[X1,X2],X1,X1]/(2*m1)-D[ψ[X1,X2],X2,X2]/(2*m2)==0},
{X1->XT+m2*XR/(m1+m2),X2->XT-m1*XR/(m1+m2),ψ[X1,X2]->Ψ[XT,XR]},
{X1,X2},{ψ},
{XT,XR},{Ψ},
showAll=0
]