PDF (legal size)

## Examples doing change of variable in diﬀerential equations

October 29, 2021   Compiled on October 29, 2021 at 3:32am

### 1 Change of variable in the independent variable

#### 1.1 Example 1. Euler ODE

One way to solve Euler ODE \begin {equation} x^{2}y^{\prime \prime }\relax (x) +xy^{\prime }\relax (x) +y\left ( x\right ) =0\tag {1} \end {equation} is to do a change of variable in the independent variable.  Let $$x=e^{t}$$. Then \begin {equation} \frac {dx}{dt}=e^{t}\tag {2} \end {equation} Also we have that $$\ln x=t$$, which means \begin {equation} \frac {dt}{dx}=\frac {1}{x}\tag {3} \end {equation} To do this change of variable and obtain a new ode where now $$y\left ( x\right )$$ becomes $$y\relax (t)$$, we start by changing $$y^{\prime }\relax (x)$$ to $$y^{\prime }\relax (t)$$ and changing $$y^{\prime \prime }\relax (x)$$ to $$y^{\prime \prime }\relax (t)$$. Given that\begin {equation} \frac {dy}{dx}=\frac {dy}{dt}\frac {dt}{dx}\tag {4} \end {equation} Substituting (3) into (4) gives$\frac {dy}{dx}=\frac {dy}{dt}\frac {1}{x}$ But $$\frac {1}{x}=e^{-t}$$. The above becomes\begin {equation} \frac {dy}{dx}=e^{-t}\frac {dy}{dt}\tag {5} \end {equation} This was not too bad. Now we need to work on $$y^{\prime \prime }\left ( x\right )$$. $\frac {d^{2}y}{dx^{2}}=\frac {d}{dx}\left (\frac {dy}{dx}\right )$ Substituting (5) into the above gives$\frac {d^{2}y}{dx^{2}}=\frac {d}{dx}\left (e^{-t}\frac {dy}{dt}\right )$ Now here comes the important trick. We want $$\frac {d}{dx}$$ to be $$\frac {d}{dt}$$ in order to apply it on its argument. This is done by dividing the numerator and denominator of $$\frac {d}{dx}$$ by $$dt$$ which becomes\begin {align*} \frac {d^{2}y}{dx^{2}} & =\frac {\frac {d}{dt}}{\frac {dx}{dt}}\left ( e^{-t}\frac {dy}{dt}\right ) \\ & =\frac {dt}{dx}\frac {d}{dt}\left (e^{-t}\frac {dy}{dt}\right ) \end {align*}

But from (3) $$\frac {dt}{dx}=\frac {1}{x}=e^{-t}$$. Hence the above becomes$\frac {d^{2}y}{dx^{2}}=e^{-t}\frac {d}{dt}\left (e^{-t}\frac {dy}{dt}\right )$ Now we can apply the product rule to ﬁnish the above\begin {align} \frac {d^{2}y}{dx^{2}} & =e^{-t}\left (-e^{-t}\frac {dy}{dt}+e^{-t}\frac {d^{2}y}{dt^{2}}\right ) \nonumber \\ & =e^{-2t}\left (-\frac {dy}{dt}+\frac {d^{2}y}{dt^{2}}\right ) \nonumber \\ & =e^{-2t}\left (\frac {d^{2}y}{dt^{2}}-\frac {dy}{dt}\right ) \tag {6} \end {align}

We have now converted bot $$y^{\prime }\relax (x)$$ and $$y^{\prime \prime }\relax (x) \,$$. what is left is to plug these back into the original ODE (1). Which becomes\begin {align*} x^{2}y^{\prime \prime }\relax (x) +xy^{\prime }\relax (x) +y\left ( x\right ) & =0\\ x^{2}e^{-2t}\left (\frac {d^{2}y}{dt^{2}}-\frac {dy}{dt}\right ) +xe^{-t}\frac {dy}{dt}+y\relax (t) & =0 \end {align*}

But $$x=e^{t}$$ and $$x^{2}=e^{2t}$$. The above becomes\begin {align*} \frac {d^{2}y}{dt^{2}}-\frac {dy}{dt}+\frac {dy}{dt}+y\relax (t) & =0\\ \frac {d^{2}y}{dt^{2}}+y\relax (t) & =0 \end {align*}

This is now constant coeﬃcient ODE. It is standard one which has the solution$y\relax (t) =A\cos \relax (t) +B\sin \relax (t)$ Now we switch back to $$x$$. Since$$\ \ln x=t$$, then the above becomes$y\relax (x) =A\cos \left (\ln x\right ) +B\sin \left (\ln x\right )$ This completes the solution.

### 2 Change of variable in the dependent variable

#### 2.1 Example 1. Bessel ODE

Given the ode\begin {equation} y^{\prime \prime }\relax (x) +\left (1-\frac {3}{4x^{2}}\right ) y\left ( x\right ) =0\tag {1} \end {equation} We will use the change of variable in the dependent variable $$y=ux^{\frac {1}{2}}$$ to transform the above ODE to Bessel ODE$x^{2}u^{\prime \prime }+xu^{\prime }+\left (x^{2}-1\right ) u=0$ Since $$y=ux^{\frac {1}{2}}$$ then\begin {equation} \frac {dy}{dx}=\frac {du}{dx}x^{\frac {1}{2}}+u\frac {x^{\frac {=1}{2}}}{2}\tag {2} \end {equation} And\begin {align} \frac {d^{2}y}{dx^{2}} & =\frac {d}{dx}\left (\frac {du}{dx}x^{\frac {1}{2}}+u\frac {x^{\frac {=1}{2}}}{2}\right ) \nonumber \\ & =\frac {d}{dx}\left (\frac {du}{dx}x^{\frac {1}{2}}\right ) +\frac {d}{dx}\left (u\frac {x^{\frac {=1}{2}}}{2}\right ) \nonumber \\ & =\frac {d^{2}u}{dx^{2}}x^{\frac {1}{2}}+\frac {1}{2}\frac {du}{dx}x^{-\frac {1}{2}}+\frac {1}{2}\frac {du}{dx}x^{\frac {=1}{2}}-\frac {1}{4}ux^{-\frac {3}{2}}\nonumber \\ & =\frac {d^{2}u}{dx^{2}}x^{\frac {1}{2}}+\frac {du}{dx}x^{-\frac {1}{2}}-\frac {1}{4}ux^{-\frac {3}{2}}\tag {3} \end {align}

Substituting (2,3) into (1) gives\begin {align*} \frac {d^{2}u}{dx^{2}}x^{\frac {1}{2}}+\frac {du}{dx}x^{-\frac {1}{2}}-\frac {1}{4}ux^{-\frac {3}{2}}+\left (1-\frac {3}{4x^{2}}\right ) ux^{\frac {1}{2}} & =0\\ \frac {d^{2}u}{dx^{2}}x^{\frac {1}{2}}+\frac {du}{dx}x^{-\frac {1}{2}}-\frac {1}{4}ux^{-\frac {3}{2}}+ux^{\frac {1}{2}}-\frac {3}{4}ux^{-\frac {3}{2}} & =0\\ \frac {d^{2}u}{dx^{2}}x^{\frac {1}{2}}+\frac {du}{dx}x^{-\frac {1}{2}}-ux^{-\frac {3}{2}}+ux^{\frac {1}{2}} & =0 \end {align*}

Multiplying both side by $$x^{\frac {3}{2}}$$ gives\begin {align*} x^{2}\frac {d^{2}u}{dx^{2}}+x\frac {du}{dx}-u+ux^{2} & =0\\ x^{2}\frac {d^{2}u}{dx^{2}}+x\frac {du}{dx}-\left (1-x^{2}\right ) u & =0\\ x^{2}\frac {d^{2}u}{dx^{2}}+x\frac {du}{dx}+\left (x^{2}-1\right ) u & =0 \end {align*}

Which is Bessel ode where $$v=1$$.