Skip to main content
Mathematics LibreTexts

1.5: Substitution

  • Page ID
    337
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

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

    Substitution

    The equation

    \[ y' = (x-y + 1)^2 \label{1.5.1} \]

    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\), which we treat as a function of \(x\). Let us try

    \[v=x-y+1. \label{1.5.2} \]

    We need to figure out \(y'\) in terms of \(v'\), \(v\) and \(x\). We differentiate (in \(x\)) to obtain \(v' = 1 -y'\). So \( y' = 1 - v' \). We plug this into the equation to get

    \[ 1 - v' = v^2 \label{1.5.3} \]

    In other words, \( v' = 1 - v^2\). Such an equation we know how to solve by separating variables:

    \[ \dfrac {1}{1 -v^2} dv = dx \label{1.5.5} \]

    So

    \[\frac{1}{2}\ln\left|\frac{v+1}{v-1}\right| =x+C,\quad\text{or}\quad\left|\frac{v+1}{v-1}\right|=e^{2x+2C},\quad\text{or}\quad\frac{v+1}{v-1}=De^{2x}, \nonumber \]

    for some constant \(D\). Note that \( v = 1\) and \( v = -1\) are also solutions.

    Now we need to “unsubstitute” to obtain

    \[ \dfrac {x - y + 2}{x -y} = De^{2x} \label{1.5.8} \]

    and also the two solutions \( x - y + 1 = 1\) or \(y = x\), and \( x - y + 1 = -1\) or \( y = x + 2\). We solve the first equation for \(y\).

    \[\begin{align}\begin{aligned} x - y + 2 &= \left ( x - y \right ) De^{2x}, \\ x - y + 2 &= Dxe^{2x} - yDe^{2x}, \\ -y + yDe^{2x} &= Dxe^{2x} - x - 2, \\ y( -1 + De^{2x}) &= Dxe^{2x} - x - 2, \\ y &= \dfrac {Dxe^{2x} - x - 2}{De^{2x} - 1}.\end{aligned}\end{align} \nonumber \]

    Note that \(D = 0\) gives \( y = x + 2\), but no value of \(D\) gives the solution \(y = x\).

    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 things 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 above table 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.

    Bernoulli Equations

    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}\)

    \[ y' + p(x)\,y = q(x)\, y^n \label{1.5.15} \]

    This equation looks a lot like a linear equation except for the \(y^n\). If \(n = 0\) or \(n =1\), 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: Bernoulli Equation

    Solve

    \[xy' + y(x +1) + xy^5 = 0, ~~ y(1) = 1 \nonumber \]

    Solution

    First, the equation is Bernoulli \(p(x) = \dfrac{x + 1}{x}\) ( and \(q(x) = -1\) ). We substitute

    \[v = y^{1 - 5} = y^{-4}, \quad v' = -4y^{-5}y' \nonumber \]

    In other words, \( \left ( \dfrac {-1}{4} \right ) y^5 v' = y' \). So

    \[\begin{align}\begin{aligned} xy' + y(x + 1) + xy^5 &= 0, \\ \dfrac {-xy^5}{4} v' + y(x + 1) + xy^5 &= 0, \\ \dfrac {-x}{4} v' + y^{-4} (x + 1) + x &= 0, \\ \dfrac {-x}{4} v' + v(x + 1) + x &= 0,\end{aligned}\end{align} \nonumber \]

    and finally

    \[ v' - \dfrac {4(x + 1)}{x} v = 4 \nonumber \]

    Now the equation is linear. We can use the integrating factor method. In particular, we use formula (1.4.17). Let us assume that \(x > 0 \) so \( \left \vert x \right \vert = x \). This assumption is OK, as our initial condition is \( x = 1\). Let us compute the integrating factor. Here \( p(s)\) from formula (1.4.17) is \( \dfrac {-4(s + 1)}{s}\).

    \[\begin{align}\begin{aligned} e^{\int _1^x p(s) ds} &= \text {exp} \left ( \int ^x_1 \dfrac {-4(s + 1)}{s} ds \right ) = e^{-4x - 4ln(x) + 4} = e^{-4x + 4} x^{-4} = \dfrac {e^{-4x + 4}}{x^4}, \\ e^{- \int_1^x p(s) ds} &= e^{4x + 4ln(x) - 4} = e^{4x - 4} x^4\end{aligned}\end{align} \nonumber \]

    We now plug in to (1.4.17)

    \[\begin{align}\begin{aligned} 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 \dfrac {e^{-4t+4}}{t^4} dt + 1 \right ) \end{aligned}\end{align} \nonumber \]

    Note that 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{align}\begin{aligned} y^{-4} &= e^{4x - 4} x^{4} \left ( 4 \int_1^x \dfrac {e^{-4t + 4}}{t^4} dt + 1 \right ), \\ y &= \dfrac {e^{-x+1}}{x \left (4 \int_1^x \dfrac {e^{-4t+4}}{t^4} dt + 1\right )^{1/4}} \end{aligned}\end{align} \nonumber \]

    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

    \[ y' = F \left ( \dfrac {y}{x} \right ) \label{1.5.16} \]

    Here we try the substitutions

    \[ v = \dfrac {y}{x} \quad\text{and therefore}\quad y' = v + xv' \label{1.5.17} \]

    We note that the equation is transformed into

    \[ v + xv' = F(v) \quad\text{or}\quad xv' = F(v) - v \quad\text{or}\quad \dfrac {v'}{F(v) - v} = \dfrac {1}{x} \label{1.5.18} \]

    Hence an implicit solution is

    \[ \int \dfrac {1}{F(v) - v} dv = \ln \left \vert x \right \vert + C \label{1.5.19} \]

    Example 1.5.2

    Solve

    \[ x^2y' = y^2 + xy, \quad y(1) = 1 \nonumber \]

    Solution

    We put the equation into the form \(y' = \left(\frac{y}{x}\right)^{2}+\frac{y}{x} \). We substitute \( v = \dfrac {y}{x}\) to get the separable equation

    \[ xv' = v^2 + v - v = v^2 \nonumber \]

    \[ v^{-2}dv = \dfrac{1}{x} dx \nonumber \]

    which has a solution

    \[\begin{align}\begin{aligned} \int \dfrac {1}{v^2} dv &= ln \left \vert x \right \vert + C, \\ \dfrac{-1}{v} &= ln \left \vert x \right \vert + C, \\ v &= \dfrac {-1}{ ln \left \vert x \right \vert + C}. \end{aligned}\end{align} \nonumber \]

    We unsubstitute

    \[\begin{align}\begin{aligned} \dfrac {y}{x} &= \dfrac {-1}{ ln \left \vert x \right \vert + C }, \\ y &= \dfrac {-x}{ln \left \vert x \right \vert + C }\end{aligned}\end{align} \nonumber \]

    We want \( y(1) = 1\), so

    \[ 1 = y(1) = \dfrac {-1}{ln \left \vert 1 \right \vert + C } = \dfrac {-1}{C} \nonumber \]

    Thus \( C = -1 \) and the solution we are looking for is

    \[ y = \dfrac {-x}{ ln \left \vert x \right \vert - 1} \nonumber \]

    Footnotes

    [1] 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 (1654–1705).

    Contributors and Attributions


    This page titled 1.5: Substitution is shared under a CC BY-SA 4.0 license and was authored, remixed, and/or curated by Jiří Lebl via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.