Integration by substitution is a method which carries over naturally to solving differential equations.
The goal is to make a substitution which transforms the equation into something more manageable.
Example
Solve the equation $$ y'=y-x-1+\frac{1}{x-y+2} $$
It would be nice if we could turn the expression
$$
y-x-1+\frac{1}{x-y+2}
$$
into something nice.
To make a substitution, we first rewrite the equation as $$ y'=-(x-y+2)+1+\frac{1}{x-y+2} $$ We then make the substitution $u=x-y+2$ so that $u'=1-y',$ or $$ y'=1-u' $$ Then the original equation becomes $$ 1-u'=-u+1+\frac{1}{u} $$ so that $$ \begin{array}{lll} &\displaystyle -u'=-u+\frac{1}{u}&\mbox{}\\ \implies &\displaystyle u'=u-\frac{1}{u}&\mbox{}\\ \implies &\displaystyle u'=\frac{u^2-1}{u}&\mbox{}\\ \implies &\displaystyle \frac{du}{dx}=\frac{u^2-1}{u}&\mbox{rewriting in differential notation}\\ \implies &\displaystyle \frac{u}{u^2-1}\,du=dx&\mbox{separating variables}\\ \implies &\displaystyle \int \frac{u}{u^2-1}\,du=\int dx&\mbox{}\\ \implies &\displaystyle \frac{1}{2}\ln(u^2-1)=x+C&\mbox{integration by substitution}\\ \implies &\displaystyle \ln(u^2-1)=2x+C&\mbox{integration by substitution}\\ \implies &\displaystyle u^2-1=Ce^{2x}&\mbox{}\\ \implies &\displaystyle u^2=Ce^{2x}+1&\mbox{}\\ \implies &\displaystyle u=\pm\sqrt{Ce^{2x}+1}&\mbox{}\\ \implies &\displaystyle x-y+2=\pm\sqrt{Ce^{2x}+1}&\mbox{}\\ \implies &\displaystyle -y=-x-2\pm\sqrt{Ce^{2x}+1}&\mbox{}\\ \implies &\displaystyle y=x+2\pm\sqrt{Ce^{2x}+1}&\mbox{}\\ \end{array} $$
To make a substitution, we first rewrite the equation as $$ y'=-(x-y+2)+1+\frac{1}{x-y+2} $$ We then make the substitution $u=x-y+2$ so that $u'=1-y',$ or $$ y'=1-u' $$ Then the original equation becomes $$ 1-u'=-u+1+\frac{1}{u} $$ so that $$ \begin{array}{lll} &\displaystyle -u'=-u+\frac{1}{u}&\mbox{}\\ \implies &\displaystyle u'=u-\frac{1}{u}&\mbox{}\\ \implies &\displaystyle u'=\frac{u^2-1}{u}&\mbox{}\\ \implies &\displaystyle \frac{du}{dx}=\frac{u^2-1}{u}&\mbox{rewriting in differential notation}\\ \implies &\displaystyle \frac{u}{u^2-1}\,du=dx&\mbox{separating variables}\\ \implies &\displaystyle \int \frac{u}{u^2-1}\,du=\int dx&\mbox{}\\ \implies &\displaystyle \frac{1}{2}\ln(u^2-1)=x+C&\mbox{integration by substitution}\\ \implies &\displaystyle \ln(u^2-1)=2x+C&\mbox{integration by substitution}\\ \implies &\displaystyle u^2-1=Ce^{2x}&\mbox{}\\ \implies &\displaystyle u^2=Ce^{2x}+1&\mbox{}\\ \implies &\displaystyle u=\pm\sqrt{Ce^{2x}+1}&\mbox{}\\ \implies &\displaystyle x-y+2=\pm\sqrt{Ce^{2x}+1}&\mbox{}\\ \implies &\displaystyle -y=-x-2\pm\sqrt{Ce^{2x}+1}&\mbox{}\\ \implies &\displaystyle y=x+2\pm\sqrt{Ce^{2x}+1}&\mbox{}\\ \end{array} $$
Bonus Example
Solve the equation $$y'=(x-y+1)^2$$ by using the substitution $u=x-y+1.$
We can turn $(x-y+1)^2$ into $u^2 $ by making the substitution
$$u=x-y+1.$$
Differentiating with respect to $x$ we get $u'=1-y',$ or
$$y'=1-u'$$
We substitute the above into the original equation
$$
1-u'=u^2
$$
or
$$
u'=1-u^2
$$
Writing in differential notation and separating variables, we have
$$
\begin{array}{lll}
&\displaystyle \frac{du}{dx}=1-u^2 &\mbox{}\\
\implies &\displaystyle \frac{du}{1-u^2}=dx&\mbox{}\\
\implies &\displaystyle \int \frac{1}{1-u^2}\,du=\int dx&\mbox{}\\
\implies &\displaystyle \int \frac{1}{1-u^2}\,du=x+C&\mbox{}\\
\implies &\displaystyle \int \frac{1}{2}\frac{1}{1+u}-\frac{1}{2}\frac{1}{1-u}\,du=x+C&\mbox{using partial fractions}\\
\implies &\displaystyle \frac{1}{2}\ln|1+u|-\frac{1}{2}\ln|1-u|=x+C&\mbox{}\\
\implies &\displaystyle \ln\sqrt{\left|\frac{1+u}{1-u}\right|}=x+C&\mbox{}\\
\implies &\displaystyle \sqrt{\left|\frac{1+u}{1-u}\right|}=Ce^x&\mbox{}\\
\implies &\displaystyle \left|\frac{1+u}{1-u}\right|=Ce^{2x}&\mbox{}\\
\implies &\displaystyle \left|\frac{u+1}{u-1}\right|=Ce^{2x}&\mbox{}\\
\implies &\displaystyle \frac{u+1}{u-1}=Ce^{2x}&\mbox{$\pm$ is absorbed into $C$}\\
\implies &\displaystyle u+1=Ce^{2x}(u-1)&\mbox{}\\
\implies &\displaystyle u+1=Ce^{2x}u-Ce^{2x}&\mbox{}\\
\implies &\displaystyle Ce^{2x}+1=Ce^{2x}u-u&\mbox{}\\
\implies &\displaystyle Ce^{2x}+1=(Ce^{2x}-1)u&\mbox{}\\
\implies &\displaystyle \frac{Ce^{2x}+1}{Ce^{2x}-1}=u&\mbox{}\\
\implies &\displaystyle \frac{Ce^{2x}+1}{Ce^{2x}-1}=x-y+1&\mbox{}\\
\implies &\displaystyle y=x+1-\frac{Ce^{2x}+1}{Ce^{2x}-1}&\mbox{}\\
\end{array}
$$
Substitution
Some kinds of equations require well-known substitutions to turn them into equations we can solve.
Two such types of equations are
- Bernoulli Equations
- Homogeneous$\color{magenta}{^*}$ Equations
Bernoulli Equations
An equation of the form $$ \frac{dy}{dx}+p(x)y=q(x)y^n $$ is called a Bernoulli equation.
Generally, for $n \geq 2,$ this equation is nonlinear.
This equation can also be handled with a substitution.
Bernoulli Equations
Fist we multiply $$ \frac{dy}{dx}+p(x)y=q(x)y^n $$ by $y^{-n}$ to get $$ y^{-n}\frac{dy}{dx}+p(x)y^{1-n}=q(x) $$ Making the substitution $u=y^{1-n},$ the chain rule gives us that $\displaystyle \frac{du}{dx}=(1-n)y^{-n}\frac{dy}{dx},$ or $$ \frac{1}{1-n}\frac{du}{dx}=y^{-n}\frac{dy}{dx} $$ Then??????????????
Bernoulli Equations
The Bernoulli Equation is then transformed into $$ \frac{1}{1-n}\frac{du}{dx}+p(x)u=q(x) $$ or $$ \frac{du}{dx}+(1-n)p(x)u=(1-n)q(x) $$ which is a linear equation we can solve.
Bernoulli Equations
Find the general solution to the equation $$ \frac{dy}{dx}-5y=-\frac{5}{2}xy^3 $$
First we multiply both sides by $y^{-3}$ to get
$$
y^{-3}\frac{dy}{dx}-5y^{-2}=-\frac{5}{2}x
$$
We now make the substitution $u=y^{-2}$ so that $\displaystyle \frac{du}{dx}=-2y^{-3}\frac{dy}{dx}.$
The above equation then becomes $$ -\frac{1}{2}\frac{du}{dx}-5u=-\frac{5}{2}x $$ so that $$ \begin{array}{lll} &\displaystyle \frac{du}{dx}+10u=5x&\mbox{}\\ \implies &\displaystyle e^{10x}\frac{du}{dx}+e^{10x}10u=e^{10x}5x&\mbox{integrating factor is $e^{\int p(x)\,dx}=e^{\int 10\,dx}=e^{10x}$}\\ \implies &\displaystyle \left(e^{10x}u\right)'=5xe^{10x}&\mbox{}\\ \implies &\displaystyle e^{10x}u=\int 5xe^{10x}\, dx +C&\mbox{}\\ \implies &\displaystyle e^{10x}u=\frac{1}{20}e^{10x}(10x-1)+C&\mbox{}\\ \implies &\displaystyle u=\frac{1}{20}(10x-1)+Ce^{-10x}&\mbox{}\\ \implies &\displaystyle y^{-2}=\frac{1}{20}(10x-1)+Ce^{-10x}&\mbox{}\\ \implies &\displaystyle y^{2}=\frac{1}{\frac{1}{20}(10x-1)+Ce^{-10x}}&\mbox{}\\ \implies &\displaystyle y^{2}=\frac{20}{10x-1+Ce^{-10x}}&\mbox{}\\ \implies &\displaystyle y=\pm\sqrt{\frac{20}{10x-1+Ce^{-10x}}}&\mbox{}\\ \end{array} $$
The above equation then becomes $$ -\frac{1}{2}\frac{du}{dx}-5u=-\frac{5}{2}x $$ so that $$ \begin{array}{lll} &\displaystyle \frac{du}{dx}+10u=5x&\mbox{}\\ \implies &\displaystyle e^{10x}\frac{du}{dx}+e^{10x}10u=e^{10x}5x&\mbox{integrating factor is $e^{\int p(x)\,dx}=e^{\int 10\,dx}=e^{10x}$}\\ \implies &\displaystyle \left(e^{10x}u\right)'=5xe^{10x}&\mbox{}\\ \implies &\displaystyle e^{10x}u=\int 5xe^{10x}\, dx +C&\mbox{}\\ \implies &\displaystyle e^{10x}u=\frac{1}{20}e^{10x}(10x-1)+C&\mbox{}\\ \implies &\displaystyle u=\frac{1}{20}(10x-1)+Ce^{-10x}&\mbox{}\\ \implies &\displaystyle y^{-2}=\frac{1}{20}(10x-1)+Ce^{-10x}&\mbox{}\\ \implies &\displaystyle y^{2}=\frac{1}{\frac{1}{20}(10x-1)+Ce^{-10x}}&\mbox{}\\ \implies &\displaystyle y^{2}=\frac{20}{10x-1+Ce^{-10x}}&\mbox{}\\ \implies &\displaystyle y=\pm\sqrt{\frac{20}{10x-1+Ce^{-10x}}}&\mbox{}\\ \end{array} $$
Homogeneous Equations
An equation is homogeneous if it can be written in the form $$ y'=F\left(\frac{y}{x}\right) $$ For these types of equations, we make the substitution $\displaystyle u=\frac{y}{x}.$
Homogeneous Equations
When we make the substitution $\displaystyle u=\frac{y}{x},$ we have $xu=y.$
Differentiating both sides with respect to $x,$ the product rule gives $$ y'=xu'+u $$ Then the original equation $$ y'=F\left(\frac{y}{x}\right) $$ is transformed into $$ x u'+u=F(u) $$
Homogeneous Equations
From the above equation we have $$ \begin{array}{lll} \displaystyle &\displaystyle x u'=F(u)-u &\mbox{}\\ %\displaystyle &\displaystyle x=\frac{F(u)-u}{u'} &\mbox{}\\ \displaystyle &\displaystyle \frac{u'}{F(u)-u}=\frac{1}{x} &\mbox{}\\ \displaystyle &\displaystyle \frac{1}{F(u)-u}\frac{du}{dx}=\frac{1}{x} &\mbox{}\\ \displaystyle &\displaystyle \frac{1}{F(u)-u} \, du= \frac{1}{x}\, dx&\mbox{}\\ \displaystyle &\displaystyle\int \frac{1}{F(u)-u} \, du=\int \frac{1}{x}\, dx&\mbox{}\\ \end{array} $$ For an implicit solution $$ \ln |x|+C=\int \frac{1}{F(u)-u} \, du $$
Example
Solve the initial value problem $$ y'=\frac{x^2-y^2}{xy},\,\,\,\,y(1)=2 $$
First we find a general solution.
Since $$ \frac{x^2-y^2}{xy}=\frac{x^2}{xy}-\frac{y^2}{xy}=\frac{x}{y}-\frac{y}{x}=\left(\frac{y}{x}\right)^{-1}-\frac{y}{x} $$ we see that the equation is homogeneous.
Rewriting the original equation as $$ y'=\left(\frac{x}{y}\right)^{-1}-\frac{y}{x} $$ we let $\displaystyle u=\frac{y}{x}$ so that $y=xu$ and $y'=x u'+u.$
The equation then becomes $$ x u'+u=u^{-1}-u $$ Then $$ \begin{array}{lll} &\displaystyle x u'=u^{-1}-2u &\mbox{}\\ \implies &\displaystyle \frac{1}{u^{-1}-2u}u'=\frac{1}{x}&\mbox{}\\ \implies &\displaystyle \frac{1}{u^{-1}-2u}\frac{du}{dx}=\frac{1}{x}&\mbox{}\\ \implies &\displaystyle \frac{1}{u^{-1}-2u}\,du=\frac{1}{x}\,dx&\mbox{}\\ \implies &\displaystyle \int \frac{1}{u^{-1}-2u}\,du=\int \frac{1}{x}\,dx +C &\mbox{}\\ \implies &\displaystyle \int \frac{u}{1-2u^2}\,du=\ln|x| +C &\mbox{}\\ \implies &\displaystyle -\frac{1}{4}\ln\left|1-2u^2\right|=\ln|x| +C &\mbox{}\\ \implies &\displaystyle \ln\left[(1-2u^2)^{-1/4}\right]=\ln|x| +C &\mbox{}\\ \implies &\displaystyle (1-2u^2)^{-1/4}=C|x| &\mbox{}\\ \implies &\displaystyle (1-2u^2)^{-1}=Cx^4 &\mbox{}\\ \implies &\displaystyle 1-2u^2=\frac{1}{Cx^4} &\mbox{}\\ \implies &\displaystyle 1-\frac{1}{Cx^4}=2u^2 &\mbox{}\\ \implies &\displaystyle u^2=\frac{1}{2}\left(1-\frac{1}{Cx^4}\right) &\mbox{}\\ \implies &\displaystyle u^2=1-\frac{1}{Cx^4} &\mbox{}\\ \implies &\displaystyle u=\pm\sqrt{\frac{1}{2}-\frac{1}{Cx^4}} &\mbox{}\\ \implies &\displaystyle \frac{y}{x}=\pm\sqrt{\frac{1}{2}-\frac{1}{Cx^4}} &\mbox{since $\displaystyle u=\frac{y}{x}$}\\ \implies &\displaystyle y=\pm x\sqrt{\frac{1}{2}-\frac{1}{Cx^4}} &\mbox{}\\ \end{array} $$ We now satisfy the initial condition $y(1)=2.$
Since the initial $y$ value is positive, we choose the positive root in the general solution.
Then $$ \begin{array}{lll} \displaystyle &\displaystyle y(1)=2 &\mbox{}\\ \displaystyle &\displaystyle 1\cdot \sqrt{\frac{1}{2}-\frac{1}{C\cdot 1^4}}=2 &\mbox{}\\ \displaystyle &\displaystyle \sqrt{\frac{1}{2}-\frac{1}{C}}=2 &\mbox{}\\ \displaystyle &\displaystyle \frac{1}{2}-\frac{1}{C}=4 &\mbox{}\\ \displaystyle &\displaystyle C-2=8C &\mbox{}\\ \displaystyle &\displaystyle -2=7C &\mbox{}\\ \displaystyle &\displaystyle C=-\frac{2}{7} &\mbox{}\\ \end{array} $$ Our particular solution is then $$ y=x\sqrt{\frac{1}{2}+\frac{7}{2x^4}} $$
Since $$ \frac{x^2-y^2}{xy}=\frac{x^2}{xy}-\frac{y^2}{xy}=\frac{x}{y}-\frac{y}{x}=\left(\frac{y}{x}\right)^{-1}-\frac{y}{x} $$ we see that the equation is homogeneous.
Rewriting the original equation as $$ y'=\left(\frac{x}{y}\right)^{-1}-\frac{y}{x} $$ we let $\displaystyle u=\frac{y}{x}$ so that $y=xu$ and $y'=x u'+u.$
The equation then becomes $$ x u'+u=u^{-1}-u $$ Then $$ \begin{array}{lll} &\displaystyle x u'=u^{-1}-2u &\mbox{}\\ \implies &\displaystyle \frac{1}{u^{-1}-2u}u'=\frac{1}{x}&\mbox{}\\ \implies &\displaystyle \frac{1}{u^{-1}-2u}\frac{du}{dx}=\frac{1}{x}&\mbox{}\\ \implies &\displaystyle \frac{1}{u^{-1}-2u}\,du=\frac{1}{x}\,dx&\mbox{}\\ \implies &\displaystyle \int \frac{1}{u^{-1}-2u}\,du=\int \frac{1}{x}\,dx +C &\mbox{}\\ \implies &\displaystyle \int \frac{u}{1-2u^2}\,du=\ln|x| +C &\mbox{}\\ \implies &\displaystyle -\frac{1}{4}\ln\left|1-2u^2\right|=\ln|x| +C &\mbox{}\\ \implies &\displaystyle \ln\left[(1-2u^2)^{-1/4}\right]=\ln|x| +C &\mbox{}\\ \implies &\displaystyle (1-2u^2)^{-1/4}=C|x| &\mbox{}\\ \implies &\displaystyle (1-2u^2)^{-1}=Cx^4 &\mbox{}\\ \implies &\displaystyle 1-2u^2=\frac{1}{Cx^4} &\mbox{}\\ \implies &\displaystyle 1-\frac{1}{Cx^4}=2u^2 &\mbox{}\\ \implies &\displaystyle u^2=\frac{1}{2}\left(1-\frac{1}{Cx^4}\right) &\mbox{}\\ \implies &\displaystyle u^2=1-\frac{1}{Cx^4} &\mbox{}\\ \implies &\displaystyle u=\pm\sqrt{\frac{1}{2}-\frac{1}{Cx^4}} &\mbox{}\\ \implies &\displaystyle \frac{y}{x}=\pm\sqrt{\frac{1}{2}-\frac{1}{Cx^4}} &\mbox{since $\displaystyle u=\frac{y}{x}$}\\ \implies &\displaystyle y=\pm x\sqrt{\frac{1}{2}-\frac{1}{Cx^4}} &\mbox{}\\ \end{array} $$ We now satisfy the initial condition $y(1)=2.$
Since the initial $y$ value is positive, we choose the positive root in the general solution.
Then $$ \begin{array}{lll} \displaystyle &\displaystyle y(1)=2 &\mbox{}\\ \displaystyle &\displaystyle 1\cdot \sqrt{\frac{1}{2}-\frac{1}{C\cdot 1^4}}=2 &\mbox{}\\ \displaystyle &\displaystyle \sqrt{\frac{1}{2}-\frac{1}{C}}=2 &\mbox{}\\ \displaystyle &\displaystyle \frac{1}{2}-\frac{1}{C}=4 &\mbox{}\\ \displaystyle &\displaystyle C-2=8C &\mbox{}\\ \displaystyle &\displaystyle -2=7C &\mbox{}\\ \displaystyle &\displaystyle C=-\frac{2}{7} &\mbox{}\\ \end{array} $$ Our particular solution is then $$ y=x\sqrt{\frac{1}{2}+\frac{7}{2x^4}} $$