Skip to main content
Logo image

Introduction to Differential Equations

Section 1.5 Substitution

Just as when solving integrals, one method to try is to change variables to end up with a simpler equation to solve.

Subsection 1.5.1 Substitution

The equation
\begin{equation*} y' = {(x-y+1)}^2 \end{equation*}
is neither separable nor linear. What can we do? How about trying to change variables, so that in the new variables the equation is simpler. We use another variable \(v\text{,}\) which we treat as a function of \(x\text{.}\) Let us try
\begin{equation*} v = x-y+1 . \end{equation*}
We need to figure out \(y'\) in terms of \(v'\text{,}\) \(v\) and \(x\text{.}\) We differentiate (in \(x\)) to obtain \(v' = 1 - y'\text{.}\) So \(y' = 1-v'\text{.}\) We plug this into the equation to get
\begin{equation*} 1-v' = v^2 . \end{equation*}
In other words, \(v' = 1-v^2\text{.}\) Such an equation we know how to solve by separating variables:
\begin{equation*} \frac{1}{1-v^2} \,dv = dx . \end{equation*}
\begin{equation*} \frac{1}{2} \ln \left\lvert \frac{v+1}{v-1} \right\rvert = x + C , \qquad \text{or} \qquad \left\lvert \frac{v+1}{v-1} \right\rvert = e^{2x + 2C} , \qquad \text{or} \qquad \frac{v+1}{v-1} = D e^{2x} , \end{equation*}
for some constant \(D\text{.}\) Note that \(v=1\) and \(v=-1\) are also solutions.
Now we need to “unsubstitute” to obtain
\begin{equation*} \frac{x-y+2}{x-y} = D e^{2x} , \end{equation*}
and also the two solutions \(x-y+1=1\) or \(y=x\text{,}\) and \(x-y+1=-1\) or \(y=x+2\text{.}\) We solve the first equation for \(y\text{.}\)
\begin{equation*} \begin{aligned} x-y+2 &= (x-y)D e^{2x} , \\ x-y+2 &= Dx e^{2x}-yD e^{2x} , \\ -y + yD e^{2x} &= Dx e^{2x} - x - 2 , \\ y\,(-1+ D e^{2x}) &= Dx e^{2x} - x - 2 , \\ y &= \frac{Dx e^{2x} - x - 2}{D e^{2x}-1} . \end{aligned} \end{equation*}
Note that \(D=0\) gives \(y=x+2\text{,}\) but no value of \(D\) gives the solution \(y=x\text{.}\)
Substitution in differential equations is applied in much the same way that it is applied in calculus. You guess. Several different substitutions might work. There are some general patterns to look for. We summarize a few of these in a table.
When you see   Try substituting
\(yy'\)   \(v=y^2\)
\(y^2y'\)   \(v=y^3\)
\((\cos y)y'\)   \(v=\sin y\)
\((\sin y)y'\)   \(v=\cos y\)
\(y'e^y\)   \(v=e^y\)
Usually you try to substitute in the “most complicated” part of the equation with the hopes of simplifying it. The table above is just a rule of thumb. You might have to modify your guesses. If a substitution does not work (it does not make the equation any simpler), try a different one.

Subsection 1.5.2 Bernoulli equations

We have two major classes that we have procedures to solve - separable and linear ODEs. However, we can often use a substitution to convert a different type of ODE into one of these two types. In this video we use a substitution to solve a major class of ODEs called Bernoulli equations.
TYPO: At 5:25, an \(10x\) should be a \(10u\text{.}\)
There are some forms of equations where there is a general rule for substitution that always works. One such example is the so-called Bernoulli equation 1 :
\begin{equation*} y' + p(x)y = q(x)y^n . \end{equation*}
This equation looks a lot like a linear equation except for the \(y^n\text{.}\) If \(n=0\) or \(n=1\text{,}\) then the equation is linear and we can solve it. Otherwise, the substitution \(v=y^{1-n}\) transforms the Bernoulli equation into a linear equation. Note that \(n\) need not be an integer.

Example 1.5.1.

\begin{equation*} xy'+ y(x+1)+xy^5 = 0, \qquad y(1)=1 . \end{equation*}
First, the equation is Bernoulli (\(p(x) = (x+1)/x\) and \(q(x) = -1\)). We substitute
\begin{equation*} v=y^{1-5} = y^{-4}, \qquad v' = -4 y^{-5} y' . \end{equation*}
In other words, \(\left( \nicefrac{-1}{4} \right) y^5 v' = y'\text{.}\) So
\begin{equation*} \begin{aligned} xy'+ y(x+1)+xy^5 & = 0 , \\ \frac{-xy^5}{4} v'+ y(x+1)+xy^5 & = 0 , \\ \frac{-x}{4} v'+ y^{-4}(x+1)+x & = 0 , \\ \frac{-x}{4} v'+ v(x+1)+x & = 0 , \end{aligned} \end{equation*}
and finally
\begin{equation*} v'- \frac{4(x+1)}{x} v = 4 . \end{equation*}
The equation is now linear. We can use the integrating factor method. In particular, we use formula (1.4). Let us assume that \(x > 0\) so \(\lvert x \rvert = x\text{.}\) This assumption is OK, as our initial condition is \(x=1\text{.}\) Let us compute the integrating factor. Here \(p(s)\) from formula (1.4) is \(\frac{-4(s+1)}{s}\text{.}\)
\begin{equation*} \begin{aligned} e^{\int_1^x p(s)\,ds} & = \exp \left( \int_1^x \frac{-4(s+1)}{s} \,ds \right) = e^{-4x-4\ln(x)+4} = e^{-4x+4} x^{-4} = \frac{e^{-4x+4}}{x^4} , \\ e^{-\int_1^x p(s)\,ds} & = e^{4x+4\ln(x)-4} = e^{4x-4} x^4 . \end{aligned} \end{equation*}
We now plug in to (1.4)
\begin{equation*} \begin{split} v(x) & = e^{-\int_{1}^x p(s)\, ds} \left( \int_{1}^x e^{\int_{1}^t p(s)\, ds} 4 \,dt + 1 \right) \\ & = e^{4x-4} x^4 \left( \int_{1}^x 4 \frac{e^{-4t+4}}{t^4} \,dt + 1 \right) . \end{split} \end{equation*}
The integral in this expression is not possible to find in closed form. As we said before, it is perfectly fine to have a definite integral in our solution. Now “unsubstitute”
\begin{equation*} \begin{aligned} y^{-4} &= e^{4x-4}x^4 \left( 4 \int_1^x \frac{e^{-4t+4}}{t^4} \,dt + 1\right) , \\ y &= \frac{e^{-x+1}}{x {\left( 4 \int_1^x \frac{e^{-4t+4}}{t^4} \,dt + 1\right)}^{1/4}} . \end{aligned} \end{equation*}

Subsection 1.5.3 Homogeneous equations

Another type of equations we can solve by substitution are the so-called homogeneous equations. Suppose that we can write the differential equation as
\begin{equation*} y' = F\left(\frac{y}{x}\right) . \end{equation*}
Here we try the substitutions
\begin{equation*} v = \frac{y}{x} \qquad \text{and therefore} \qquad y' = v + x v' . \end{equation*}
We note that the equation is transformed into
\begin{equation*} v+ xv' = F(v) \qquad \text{or} \qquad xv' = F(v)-v \qquad \text{or} \qquad \frac{v'}{F(v)-v} = \frac{1}{x} . \end{equation*}
Hence an implicit solution is
\begin{equation*} \int \frac{1}{F(v)-v} \,dv = \ln \, \lvert x \rvert + C . \end{equation*}

Example 1.5.2.

\begin{equation*} x^2y' = y^2+xy, \qquad y(1)=1. \end{equation*}
We put the equation into the form \(y'= {\left(\nicefrac{y}{x}\right)}^2+\nicefrac{y}{x}\text{.}\) We substitute \(v=\nicefrac{y}{x}\) to get the separable equation
\begin{equation*} xv' = v^2+v-v = v^2 , \end{equation*}
which has a solution
\begin{equation*} \begin{aligned} \int \frac{1}{v^2} \,dv &= \ln \, \lvert x \rvert + C , \\ \frac{-1}{v} &= \ln \, \lvert x \rvert + C , \\ v &= \frac{-1}{\ln \, \lvert x \rvert + C} . \end{aligned} \end{equation*}
We unsubstitute
\begin{equation*} \begin{aligned} \frac{y}{x} &= \frac{-1}{\ln \, \lvert x \rvert + C} , \\ y &= \frac{-x}{\ln \, \lvert x \rvert + C} . \end{aligned} \end{equation*}
We want \(y(1)=1\text{,}\) so
\begin{equation*} 1 = y(1) = \frac{-1}{\ln \, \lvert 1 \rvert + C} = \frac{-1}{C} . \end{equation*}
Thus \(C = -1\) and the solution we are looking for is
\begin{equation*} y = \frac{-x}{\ln \, \lvert x \rvert -1} . \end{equation*}

Subsection 1.5.4 Exercises

Hint: Answers need not always be in closed form.

Exercise 1.5.1.

Solve \(y'+ y(x^2-1)+xy^6 = 0\text{,}\) with \(y(1)=1\text{.}\)
This is a Bernoulli equation with \(n=6\text{.}\) So we substitute \(v=y^{-5}\text{,}\) \(v'=-5y^{-6}y'\) and get \[ v’-5v(x^2-1)=5x \] A linear ODE with \[ p(x)=-5(x^2-1),    f(x)=5x,    r(x)=e^{-\frac{5x^3}{3}+5x} \] Multiplying and integrating \[ e^{-\frac{5x^3}{3}+5x}v=\int 5xe^{-\frac{5x^3}{3}+5x} dx \] This integral doesn’t have a closed form. Applying the initial condition \(y(1)=1\ \rightarrow\ v(1)=1\) \[ v=e^{\frac{5x^3}{3}-5x}\left(\int_1^x 5te^{-\frac{5t^3}{3}+5t}dt +1\right) \]
\begin{equation} y=\sqrt[5]{\frac{1}{e^{\frac{5x^3}{3}-5x}\left(\int_1^x 5te^{-\frac{5t^3}{3}+5t}dt +1\right) }}\tag{1.5} \end{equation}

Exercise 1.5.2.

Solve \(2yy' + 1 = y^2 + x\text{,}\) with \(y(0)=1\text{.}\)
Try \(v=y^2\) giving \(v'=2yy'\text{.}\) Substituting \[ v’+1=v+x     \rightarrow v’-v=x-1 \] A linear ODE with \[ p(x)=-1,    f(x)=x-1,    r(x)=e^{-x} \] Multiplying and integrating \[ e^{-x}v=-xe^{-x}+c \] Applying the initial condition \(y(0)=1\ \rightarrow v(0)=1\text{,}\) giving \(c=1\text{.}\) Thus we write \[ v=-x+e^x \] \[ y=\sqrt{e^x-x} \]

Exercise 1.5.3.

Solve \(y' + xy = y^4\text{,}\) with \(y(0)=1\text{.}\)
\(y=\sqrt[3]{\frac{1}{e^{\frac{3x^2}{2}}\left(\int_0^x -3e^{\frac{-3t^2}{2}}dt+1\right)}}\)

Exercise 1.5.4.

Solve \(yy' + x = \sqrt{x^2 + y^2}\text{.}\)
This can be rewritten as \[ y’=\sqrt{\left(\frac{x}{y}\right)^2+1}-\frac{x}{y} \] \[ y=\sqrt{\left( \frac{1}{y/x}\right)^2+1}-\frac{1}{y/x}=F(y/x) \] This is a homogeneous equation, so we substitute \(v=y/x\text{.}\) Following through with the substitution \[ \int \frac{1}{F(v)-v}dv=ln\lvert x\rvert +c \] \[ \int \frac{1}{\sqrt{\frac{1}{v^2}+1}-\frac{1}{v}-v}dv=ln\lvert x\rvert +x \] Integrating \[ \lvert 1-\sqrt{v^2+1}\rvert = c\lvert \frac{1}{x}\rvert \] \[ v=\sqrt{(1-c\lvert \frac{1}{x}\rvert)^2-1}=\sqrt{\frac{c^2}{x^2}-2c\lvert \frac{1}{x}\rvert} \] \[ y=\sqrt{c^2-2c\lvert x \rvert} \]

Exercise 1.5.5.

Solve \(y' = {(x+y-1)}^2\text{.}\)
\(y=\sqrt{\tan (x+c)}-x+1\)

Exercise 1.5.6.

Solve \(y' = \frac{x^2-y^2}{x y}\text{,}\) with \(y(1) = 2\text{.}\)

Exercise 1.5.7.

Solve \(xy'+y+y^2 = 0\text{,}\) \(y(1)=2\text{.}\)
\(y = \frac{2}{3x-2}\)

Exercise 1.5.8.

Solve \(xy'+y +x = 0\text{,}\) \(y(1)=1\text{.}\)
\(y = \frac{3-x^2}{2 x}\)

Exercise 1.5.9.

Solve \(y^2y' = y^3-3x\text{,}\) \(y(0)=2\text{.}\)
\(y = {\bigl(7 e^{3x} + 3x + 1 \bigr)}^{1/3}\)

Exercise 1.5.10.

Solve \(2yy' = e^{y^2-x^2} + 2x\text{.}\)
\(y = \sqrt{x^2-\ln(C-x)}\)
There are several things called Bernoulli equations, this is just one of them. The Bernoullis were a prominent Swiss family of mathematicians. These particular equations are named for Jacob Bernoulli 2  (1654–1705).
For a higher quality printout use the PDF version: