Skip to main content

Section 8.2 Separable Differential Equations

There are specific techniques that can be used to solve specific types of differential equations. This is similar to solving algebraic equations. In algebra, we can use the quadratic formula to solve a quadratic equation, but not a linear or cubic equation. In the same way, techniques that can be used for a specific type of differential equation are often ineffective for a differential equation of a different type. In this section, we describe and practice a technique to solve a class of differential equations called separable equations.

Figure 8.2.1. Video introduction to Section 8.2
Definition 8.2.2. Separable Differential Equation.

A separable differential equation is one that can be written in the form

\begin{equation*} \displaystyle n(y) \frac{dy}{dx} = m(x)\text{,} \end{equation*}

where \(n\) is a function that depends only on the dependent variable \(y\text{,}\) and \(m\) is a function that depends only on the independent variable \(x\text{.}\)

Below, we show a few examples of separable differential equations, along with similar looking equations that are not separable.

List 8.2.3. Separable
  1. \(\displaystyle \displaystyle \frac{dy}{dx} = x^2y\)
  2. \(\displaystyle \displaystyle y\sqrt{y^2-5} \frac{dy}{dx} - \sin(x) \cos(x) = 0\)
  3. \(\displaystyle \displaystyle \frac{dy}{dx} = \frac{(x^2 + 1)e^{y}}{y}\)
List 8.2.4. Not Separable
  1. \(\displaystyle \displaystyle \frac{dy}{dx} = x^2 + y\)
  2. \(\displaystyle \displaystyle y\sqrt{y^2-1} \frac{dy}{dx} - \sin(x) \cos y = 0\)
  3. \(\displaystyle \displaystyle \frac{dy}{dx} = \frac{(xy + 1)e^{y}}{y}\)

Notice that a separable equation requires that the functions of the dependent and independent variables be multiplied, not added (like item 8.2.4:1 in List 8.2.4). An alternate definition of a separable differential equation states that an equation is separable if it can be written in the form

\begin{equation*} \frac{dy}{dx} = f(x)g(y)\text{,} \end{equation*}

for some functions \(f\) and \(g\text{.}\)

Subsection 8.2.1 Separation of Variables

Let's find a formal solution to the separable equation

\begin{equation*} \displaystyle n(y) \frac{dy}{dx} = m(x)\text{.} \end{equation*}

Since the functions on the left and right hand sides of the equation are equal, their antiderivatives should be equal up to an arbitrary constant of integration. That is

\begin{equation*} \displaystyle \int n(y) \frac{dy}{dx}\,dx = \int m(x)\, dx + C\text{.} \end{equation*}

Though the integral on the left may look a bit strange, recall that \(y\) itself is a function of \(x\text{.}\) Consider the substitution \(u = y(x)\text{.}\) The differential is \(du = \displaystyle \frac{dy}{dx}\,dx\text{.}\) Using this substitution, the above equation becomes

\begin{equation*} \int n(u)\,du = \int m(x)\,dx + C\text{.} \end{equation*}

Let \(N(u)\) and \(M(x)\) be antiderivatives of \(n(u)\) and \(m(x)\text{,}\) respectively. Then

\begin{equation*} N(u) = M(x) + C\text{.} \end{equation*}

Since \(u = y(x)\text{,}\) this is

\begin{equation*} N(y) = M(x) + C\text{.} \end{equation*}

This relationship between \(y\) and \(x\) is an implicit form of the solution to the differential equation. Sometimes (but not always) it is possible to solve for \(y\) to find an explicit version of the solution.

Though the technique outlined above is formally correct, what we did essentially amounts to integrating the function \(n\) with respect to its variable and integrating the function \(m\) with respect to its variable. The informal way to solve a separable equation is to treat the derivative \(\displaystyle \frac{dy}{dx}\) as if it were a fraction. The separated form of the equation is

\begin{equation*} n(y)\,dy = m(x)\, dx\text{.} \end{equation*}

To solve, we integrate the left hand side with respect to \(y\) and the right hand side with respect to \(x\) and add a constant of integration. As long as we are able to find the antiderivatives, we can find an implicit form for the solution. Sometimes we are able to solve for \(y\) in the implicit solution to find an explicit form of the solution to the differential equation. We practice the technique by solving the three differential equations listed in the separable column above, and conclude by revisiting and finding the general solution to the logistic differential equation from Section 8.1.

Example 8.2.5. Solving a Separable Differential Equation.

Find the general solution to the differential equation \(\yp = x^2y\text{.}\)

Solution

Using the informal solution method outlined above, we treat \(\displaystyle \frac{dy}{dx}\) as a fraction, and write the separated form of the differential equation as

\begin{equation*} \frac{dy}{y} = x^2 dx\text{.} \end{equation*}

Integrating the left hand side of the equation with respect to \(y\) and the right hand side of the equation with respect to \(x\) yields

\begin{equation*} \ln \abs{y} = \frac{1}{3}x^3 + C\text{.} \end{equation*}

This is an implicit form of the solution to the differential equation. Solving for \(y\) yields an explicit form for the solution. Exponentiating both sides, we have

\begin{equation*} \abs{y} = e^{x^3/3 + C} = e^{x^3/3}e^C\text{.} \end{equation*}

This solution is a bit problematic. First, the absolute value makes the solution difficult to understand. The second issue comes from our desire to find the general solution. Recall that a general solution includes all possible solutions to the differential equation. In other words, for any given initial condition, the general solution must include the solution to that specific initial value problem. We can often satisfy any given initial condition by choosing an appropriate \(C\) value. When solving separable equations, though, it is possible to lose solutions that have the form \(y = \text{ constant}\text{.}\) Notice that \(y=0\) solves the differential equation, but it is not possible to choose a finite \(C\) to make our solution look like \(y=0\text{.}\) Our solution cannot solve the initial value problem \(\displaystyle \frac{dy}{dx} = x^2y\text{,}\) with \(y(a) = 0\) (where \(a\) is any value). Thus, we haven't actually found a general solution to the problem. We can clean up the solution and recover the missing solution with a bit of clever thought.

Recall the formal definition of the absolute value: \(\abs{y} = y\) if \(y \geq 0\) and \(\abs{y} = -y\) if \(y \lt 0\text{.}\) Our solution is either \(y = e^C e^{\frac{x^3}{3}}\) or \(y = - e^C e^{{\frac{x^3}{3}}}\text{.}\) Further, note that \(C\) is constant, so \(e^C\) is also constant. If we write our solution as \(y = Ae^{\frac{x^3}{3}}\text{,}\) and allow the constant \(A\) to take on either positive or negative values, we incorporate both cases of the absolute value. Finally, if we allow \(A\) to be zero, we recover the missing solution discussed above. The best way to express the general solution to our differential equation is

\begin{equation*} y = Ae^{\frac{x^3}{3}}\text{.} \end{equation*}
Example 8.2.6. Solving a Separable Initial Value Problem.

Solve the initial value problem \(\displaystyle (y\sqrt{y^2-5}) \yp - \sin(x) \cos(x) = 0\text{,}\) with \(y(0) = -3\text{.}\)

Solution

We first put the differential equation in separated form

\begin{equation*} y\sqrt{y^2-5}\,dy = \sin(x) \cos(x)\, dx\text{.} \end{equation*}

The indefinite integral \(\displaystyle \int y\sqrt{y^2-5}\,dy\) requires the substitution \(u = y^2-5\text{.}\) Using this substitute yields the antiderivative \(\displaystyle \frac{1}{3} (y^2-5)^{3/2}\text{.}\) The indefinite integral \(\displaystyle \int \sin(x) \cos(x)\,dx\) requires the substitution \(u = \sin(x)\text{.}\) Using this substitution yields the antiderivative \(\displaystyle \frac{1}{2} \sin^2 x\text{.}\) Thus, we have an implicit form of the solution to the differential equation given by

\begin{equation*} \frac{1}{3} (y^2-5)^{3/2} = \frac{1}{2} \sin^2 x + C\text{.} \end{equation*}

The initial condition says that \(y\) should be \(-3\) when \(x\) is \(0\text{,}\) or

\begin{equation*} \frac{1}{3} ((-3)^2 - 5)^{3/2} = \frac{1}{2} \sin^2 0 + C\text{.} \end{equation*}

Evaluating the line above, we find \(C = 8/3\text{,}\) yielding the particular solution to the initial value problem

\begin{equation*} \frac{1}{3} (y^2-5)^{3/2} = \frac{1}{2} \sin^2 x + \frac{8}{3}\text{.} \end{equation*}
Example 8.2.7. Solving a Separable Differential Equation.

Find the general solution to the differential equation \(\displaystyle \frac{dy}{dx} = \frac{(x^2 + 1)e^{y}}{y}\text{.}\)

Solution

We start by observing that there are no constant solutions to this differential equation because there are no constant \(y\) values that make the right hand side of the equation identically zero. Thus, we need not worry about losing solutions during the separation of variables process. The separated form of the equation is given by

\begin{equation*} ye^{-y}\,dy = (x^2+1)\,dx\text{.} \end{equation*}

The antiderivative of the left hand side requires Integration by Parts. Evaluating both indefinite integrals yields the implicit solution

\begin{equation*} -(y+1)e^{-y} = \frac{1}{3}x^3 + x + C\text{.} \end{equation*}

Since we cannot solve for \(y\text{,}\) we cannot find an explicit form of the solution.

Example 8.2.8. Solving the Logistic Differential Equation.

Solve the logistic differential equation \(\displaystyle \frac{dy}{dt} = ky\left( 1 - \frac{y}{M}\right)\)

Solution

We looked at a slope field for this equation in Section 8.1 in the specific case of \(k = M = 1\text{.}\) Here, we use separation of variables to find an analytic solution to the more general equation. Notice that the independent variable \(t\) does not explicitly appear in the differential equation. We mentioned that an equation of this type is called autonomous. All autonomous first order differential equations are separable.

We start by making the observation that both \(y=0\) and \(y = M\) are constant solutions to the differential equation. We must check that these solutions are not lost during the separation of variables process. The separated form of the equation is

\begin{equation*} \frac{1}{y \left(1-\displaystyle\frac{y}{M}\right)}\,dy = k\,dt\text{.} \end{equation*}

The antiderivative of the left hand side of the equation can be found by making use of partial fractions. Using the techniques discussed in Section 6.5, we write

\begin{equation*} \frac{1}{y\left(1-\frac{y}{M}\right)} = \frac{1}{y} + \frac{1}{M-y}\text{.} \end{equation*}

Then an implicit form of the solution is given by

\begin{equation*} \ln \abs{y} - \ln \abs{M-y} = kt + C\text{.} \end{equation*}

Combining the logarithms,

\begin{equation*} \ln \abs{\frac{y}{M-y}} = kt + C\text{.} \end{equation*}

Similarly to Example 8.2.5, we can write

\begin{equation*} \frac{y}{M-y} = Ae^{kt}\text{.} \end{equation*}

Letting \(A\) take on positive values or negative values incorporates both cases of the absolute value. This is another implicit form of the solution. Solving for \(y\) gives the explicit form

\begin{equation*} y = \frac{M}{1 + be^{-kt}}\text{,} \end{equation*}

where \(b\) is an arbitrary constant. Notice that \(b=0\) recovers the constant solution \(y = M\text{.}\) The constant solution \(y=0\) cannot be produced with a finite \(b\) value, and has been lost. The general solution the logistic differential equation is the set containing \(\displaystyle y = \frac{M}{1 + be^{-kt}}\) and \(y=0\text{.}\)

Exercises 8.2.2 Exercises

Problems

In the following exercises, decide whether the differential equation is separable or not separable. If the equation is separable. write it in separated form.

1.

\(\displaystyle \yp = y^2 - y\)

2.

\(\displaystyle x\yp + x^2y = \frac{\sin(x)}{x-y}\)

3.

\(\displaystyle (y + 3)\yp + (\ln(x)) \yp - x\sin y = (y+3)\ln(x)\)

4.

\(\displaystyle \yp -x^2\cos y + y = \cos y - x^2 y\)

In the following exercises, find the general solution to the separable differential equation. Be sure to check for missing constant solutions.

5.

\(\displaystyle \yp +1 - y^2 = 0\)

6.

\(\displaystyle \yp = y-2\)

7.

\(\displaystyle x \yp = 4y\)

8.

\(\displaystyle y\yp = 4x\)

9.

\(\displaystyle e^xy \yp = e^{-y} + e^{-2x - y}\)

10.

\(\displaystyle (x^2 + 1) \yp = \frac{x}{y-1}\)

11.

\(\displaystyle \yp = \frac{x\sqrt{1-4y^2}}{x^4 + 2x^2 + 2}\)

12.

\(\displaystyle (e^x + e^{-x})\yp = y^2\)

In the following exercises, find the particular solution to the separable initial value problem.

13.

\(\displaystyle \yp = \frac{\sin(x)}{\cos y}\text{,}\) with \(y(0) = \displaystyle \frac{\pi}{2}\)

14.

\(\displaystyle \yp = \frac{x^2}{1-y^2}\text{,}\) with \(y(0) = 1\)

15.

\(\displaystyle \yp = \frac{2x}{y+x^2y}\text{,}\) with \(y(0) = -4\)

16.

\(\displaystyle x + ye^{-x}\yp = 0\text{,}\) with \(y(0) = -2\)

17.

\(\displaystyle \yp = \frac{x\ln(x^2+1)}{y-1}\text{,}\) with \(y(0) = 2\)

18.

\(\displaystyle \sqrt{1-x^2}\,\yp - \frac{\arcsin x}{y\cos(y^2)}= 0\text{,}\) with \(y(0) = \sqrt{\displaystyle\frac{7\pi}{6}}\)

19.

\(\displaystyle \yp = (\cos^2x)(\cos^2 2y)\text{,}\) with \(y(0) = 0\)

20.

\(\displaystyle \yp = \frac{y^2\sqrt{1-y^2}}{x}\text{,}\) with \(y(0) = 1\)