Solving Differential Equations by Substitution

by Justin Skycak (@justinskycak) on

Non-separable differential equations can be sometimes converted into separable differential equations by way of substitution.

This post is part of the book Justin Math: Calculus. Suggested citation: Skycak, J. (2019). Solving Differential Equations by Substitution. In Justin Math: Calculus. https://justinmath.com/solving-differential-equations-by-substitution/


Want to get notified about new posts? Join the mailing list and follow on X/Twitter.

Sometimes, non-separable differential equations can be converted into separable differential equations by way of substitution.

For example, $y’+y=x$ is a non-separable differential equation as-is. However, we can make a variable substitution $u=x-y$ to turn it into a separable differential equation. Differentiating both sides of $u=x-y$ with respect to $x$, and interpreting $y$ as a function of $x$, we have $u’=1-y’$, so $y’=1-u’$. Substituting, the equation becomes separable and thus solvable in terms of $u$.

$\begin{align*} y' + y &= x \\ y' &= x-y \\ 1-u' &= u \\ u' &= 1-u \\ \frac{du}{dx} &= 1-u \\ du &= (1-u) \, dx \\ \frac{1}{1-u} \, du &= 1 \, dx \\ \int \frac{1}{1-u} \, du &= \int 1 \, dx \\ -\ln (1-u) &= x + C \\ \ln (1-u) &= -x + C \\ 1-u &= e^{-x+C} \\ u&=1-e^{-x+C} \end{align*}$


Lastly, to find what $y$ is, we can solve for $y$ in our original substitution $u=x-y$.

$\begin{align*} u &= x-y \\ u+y &= x \\ y &= x-u \\ y &= x-\left( 1-e^{-x+C} \right) \\ y &= x -1 + e^{-x+C} \end{align*}$


Choosing the Right Substitution

In general, to determine what substitution we need to perform, it is helpful to rearrange the equation until we see a group of terms whose derivative also appears in the equation.

$\begin{align*} 2yy' - y^2 &= x^2 - 2x \\ 2yy' + 2x &= x^2 + y^2 \\ (y^2 + x^2)' &= x^2 + y^2 \end{align*}$


After rearranging the above equation, we see that $u=x^2+y^2$ is a good substitution. We rewrite the equation in terms of $u$, solve it, and then solve for $y$ in terms of $x$.

$\begin{align*} u' &= u \\ u &= Ce^x \\ x^2 + y^2 &= Ce^x \\ y^2 &= Ce^x - x^2 \\ y &= \pm \sqrt{Ce^x - x^2} \end{align*}$


We don’t always have to use addition in our substitutions. In the equation below, for example, we require the substitution $u=xy$.

$\begin{align*} xy' &= 3-y \\ xy' + y &= 3 \\ (xy)' &= 3 \\ u' &= 3 \\ u &= 3x + C \\ xy &= 3x + C \\ y &= 3 + \frac{C}{x} \end{align*}$


Exercises

Use substitution to solve the following differential equations. (You can view the solution by clicking on the problem.)

$\begin{align*} 1) \hspace{.5cm} 1+y' = (x+y)^2 \end{align*}$
Solution:
$\begin{align*} u &= x+y\\ y &= \frac{1}{C-x}-x \end{align*}$


$\begin{align*} 2) \hspace{.5cm} 2(y'-y) = 1-x \end{align*}$
Solution:
$\begin{align*} u &= x-2y \\ y &= Ce^x + \frac{1}{2}x \end{align*}$


$\begin{align*} 3) \hspace{.5cm} x^2-y^2 = \frac{1}{2x-2yy'} \end{align*}$
Solution:
$\begin{align*} u &= x^2-y^2 \\ y &= \pm \sqrt{x^2 \pm \sqrt{C+2x}} \end{align*}$


$\begin{align*} 4) \hspace{.5cm} 3y^2y' = e^{x^2+y^3}-2x \end{align*}$
Solution:
$\begin{align*} u &= x^2+y^3 \\ y &= -\sqrt[3]{x^2+\ln(C-x)} \end{align*}$


$\begin{align*} 5) \hspace{.5cm} 2y+xy'=\frac{1}{x} \end{align*}$
Solution:
$\begin{align*} u &= x^2y \\ y &= \frac{C}{x^2}+\frac{1}{x} \end{align*}$


$\begin{align*} 6) \hspace{.5cm} xy^4+2x^2y^3y'=1 \end{align*}$
Solution:
$\begin{align*} u &= xy^2 \\ y &= \pm \sqrt[4]{\frac{C}{x^2}+\frac{2}{x} } \end{align*}$



This post is part of the book Justin Math: Calculus. Suggested citation: Skycak, J. (2019). Solving Differential Equations by Substitution. In Justin Math: Calculus. https://justinmath.com/solving-differential-equations-by-substitution/


Want to get notified about new posts? Join the mailing list and follow on X/Twitter.