Solving Differential Equations with Substitutions

# Solving Differential Equations with Substitutions

We will now look at another type of first order differential equation that can be readily solved using a simple substitution. Consider the following differential equation:

(1)
$$x^2y' = 2xy - y^2$$

Now divide both sides of the equation by $x^2$ (provided that $x \neq 0$ to get:

(2)
\begin{align} y' = \frac{2xy}{x^2} - \frac{y^2}{x^2} \\ y' = 2 \left ( \frac{y}{x} \right ) - \left ( \frac{y}{x} \right )^2 \end{align}

We can write this differential equation as $y' = F\left ( \frac{y}{x} \right )$. Let $v(x) = \frac{y}{x}$ and so $y' = F(v)$. Now since $v = \frac{y}{x}$ we also have that $y = xv$. If we differentiate this function with respect to $x$ using the product rule and implicit differentiation, we get that $y' = v + xv'$ and hence:

(3)
\begin{align} \quad y' = F(v) \Leftrightarrow \quad xv' = F(v) - v \Leftrightarrow \quad \frac{1}{F(v) - v} v' = \frac{1}{x} \Leftrightarrow \quad \frac{1}{F(v) - v} \frac{dv}{dx} = \frac{1}{x} \Leftrightarrow \quad \frac{1}{F(v) - v} dv = \frac{1}{x} \: dx \end{align}

Thus, using the substitution $v = \frac{y}{x}$ allows us to write the original differential equation as a separable differential equation. Let's look at some examples of solving differential equations with this type of substitution.

## Example 1

Solve the differential equation $y' = \frac{x^2 + y^2}{xy}$.

We first rewrite this differential equation in the form $y = F \left ( \frac{y}{x} \right )$. Simplifying the differential equation above and we have that:

(4)
\begin{align} \quad y' = \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} + \left ( \frac{y}{x} \right ) \end{align}

Let $v = \frac{y}{x}$. Then $y = vx$ and $y' = v + xv'$ and thus we can use these substitutions in our differential equation above to get that:

(5)
\begin{align} \quad v + xv' = v^{-1} + v \\ \quad xv' = v^{-1} \\ \quad vv' = \frac{1}{x} \\ \quad v \: dv = \frac{1}{x} \: dx \\ \quad \int v \: dv = \int \frac{1}{x} \: dx \\ \quad \frac{v^2}{2} = \ln \mid x \mid + C\\ \quad v^2 = 2 \ln \mid x \mid + 2C \\ \quad v = \pm \sqrt{2 \ln \mid x \mid + 2C} \\ \quad \frac{y}{x} = \pm \sqrt{2 \ln \mid x \mid + 2C} \\ \quad y = \pm x \sqrt{2 \ln \mid x \mid + 2C} \end{align}

## Example 2

Solve the differential equation $y' = \frac{x - y}{x + y}$.

We first rewrite this differential equation by diving all terms on the righthand side by $x$ to get:

(6)
\begin{align} \quad y' = \frac{\frac{x}{x} - \frac{y}{x}}{\frac{x}{x} + \frac{y}{x}} = \frac{1 - \frac{y}{x}}{1 + \frac{y}{x}} \end{align}

Let $v = \frac{y}{x}$. Then of course $y = vx$ and $y' = v + xv'$ and so:

(7)
\begin{align} \quad v + xv' = \frac{1 - v}{1 + v} \Leftrightarrow xv' = \frac{1 - v}{1 + v} - v \Leftrightarrow xv' = \frac{1 - v}{1 + v} - \frac{v + v^2}{1 + v} \Leftrightarrow xv' = \frac{1 - 2v - v^2}{1 + v} \end{align}

Thus we have that:

(8)
\begin{align} \quad \frac{1 + v}{1 - 2v - v^2} \: dv = \frac{1}{x} \: dx \\ \quad \int \frac{1 + v}{1 - 2v - v^2} \: dv = \int \frac{1}{x} \: dx \\ \end{align}

To evaluate the integral on the lefthand side we can use integration by parts. Let $u = 1 - 2v - v^2$. Then $du = -2 - 2v = -2(1 + v) \: dv$ and $\frac{-1}{2} du = (1 + v) \: dv$. Making this substitution and we get that:

(9)
\begin{align} \quad -\frac{1}{2} \int \frac{1}{u} \: du = \ln \mid x \mid + C \\ \quad -\frac{1}{2} \ln \mid u \mid = \ln \mid x \mid + C \\ \quad -\frac{1}{2} \ln \mid 1 - 2v - v^2 \mid = \ln \mid x \mid + C \\ \end{align}

We can turn the constant $C$ into a new constant, $\ln \mid K \mid$ to get that:

(10)
\begin{align} \quad -\frac{1}{2} \ln \mid 1 - 2v - v^2 \mid = \ln \mid x \mid + \ln \mid K \mid \\ \quad -\frac{1}{2} \ln \mid 1 - 2v - v^2 \mid = \ln \mid Kx \mid \\ \quad (1 - 2v - v^2)^{-1/2} = Kx \\ \quad 1 - 2v - v^2 = \frac{1}{K^2x^2} \\ \quad 1 - 2 \frac{y}{x} - \frac{y^2}{x^2} = \frac{1}{K^2x^2} \\ \quad x^2 - 2yx - y^2 = \frac{1}{K^2} \\ \end{align}