###
Subsection1.5.1Substitution

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*}
So

\begin{equation*}
\begin{aligned}
\frac{1}{2} \ln \left\lvert \frac{v+1}{v-1} \right\rvert & = x + C , \\
\left\lvert \frac{v+1}{v-1} \right\rvert & = e^{2x + 2C} ,
\end{aligned}
\end{equation*}
or \(\frac{v+1}{v-1} = D e^{2x}\) 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 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.

###
Subsection1.5.2Bernoulli 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*:

\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.

######
Example1.5.1

Solve

\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 (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 (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 (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*}
###
Subsection1.5.3Homogeneous 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*}
######
Example1.5.2

Solve

\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*}
###
Subsection1.5.4Exercises

Hint: Answers need not always be in closed form.

######
Exercise1.5.1

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

######
Exercise1.5.2

Solve \(2yy' + 1 = y^2 + x\text{,}\) with \(y(0)=1\text{.}\)

######
Exercise1.5.3

Solve \(y' + xy = y^4\text{,}\) with \(y(0)=1\text{.}\)

######
Exercise1.5.4

Solve \(yy' + x = \sqrt{x^2 + y^2}\text{.}\)

######
Exercise1.5.5

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

######
Exercise1.5.6

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

######
Exercise1.5.101

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

######
Exercise1.5.102

Solve \(xy'+y +x = 0\text{,}\) \(y(1)=1\text{.}\)

Answer\(y = \frac{3-x^2}{2 x}\)

######
Exercise1.5.103

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

Answer\(y = {\bigl(7 e^{3x} + 3x + 1 \bigr)}^{1/3}\)

######
Exercise1.5.104

Solve \(2yy' = e^{y^2-x^2} + 2x\text{.}\)

Answer\(y = \sqrt{x^2-\ln(C-x)}\)