Paul's Online Notes
Paul's Online Notes
Home / Differential Equations / First Order DE's / Separable Equations
Show Mobile Notice Show All Notes Hide All Notes
Mobile Notice
You appear to be on a device with a "narrow" screen width (i.e. you are probably on a mobile phone). Due to the nature of the mathematics on this site it is best views in landscape mode. If your device is not in landscape mode many of the equations will run off the side of your device (should be able to scroll to see them) and some of the menu items will be cut off due to the narrow screen width.

Section 2.2 : Separable Equations

We are now going to start looking at nonlinear first order differential equations. The first type of nonlinear first order differential equations that we will look at is separable differential equations.

A separable differential equation is any differential equation that we can write in the following form.

\[\begin{equation}N\left( y \right)\frac{{dy}}{{dx}} = M\left( x \right)\label{eq:eq1} \end{equation}\]

Note that in order for a differential equation to be separable all the \(y\)'s in the differential equation must be multiplied by the derivative and all the \(x\)'s in the differential equation must be on the other side of the equal sign.

To solve this differential equation we first integrate both sides with respect to \(x\) to get,

\[\int{{N\left( y \right)\frac{{dy}}{{dx}}\,dx}} = \int{{M\left( x \right)\,dx}}\]

Now, remember that \(y\) is really \(y\left( x \right)\) and so we can use the following substitution,

\[u = y\left( x \right)\hspace{0.25in}du = y'\left( x \right)\,dx = \frac{{dy}}{{dx}}\,dx\]

Applying this substitution to the integral we get,

\[\begin{equation}\int{{N\left( u \right)\,du}} = \int{{M\left( x \right)\,dx}} \label{eq:eq2} \end{equation}\]

At this point we can (hopefully) integrate both sides and then back substitute for the \(u\) on the left side. Note, that as implied in the previous sentence, it might not actually be possible to evaluate one or both of the integrals at this point. If that is the case, then there won’t be a lot we can do to proceed using this method to solve the differential equation.

Now, the process above is the mathematically correct way of solving this differential equation. Note however, that if we “separate” the derivative as well we can write the differential equation as,

\[N\left( y \right)dy = M\left( x \right)dx\]

We obviously can’t separate the derivative like that, but let’s pretend we can for a bit and we’ll see that we arrive at the answer with less work.

Now we integrate both sides of this to get,

\[\begin{equation}\int{{N\left( y \right)dy}} = \int{{M\left( x \right)dx}} \label{eq:eq3} \end{equation}\]

So, if we compare \(\eqref{eq:eq2}\) and \(\eqref{eq:eq3}\) we can see that the only difference is on the left side and even then the only real difference is \(\eqref{eq:eq2}\) has the integral in terms of \(u\) and \(\eqref{eq:eq3}\) has the integral in terms of \(y\). Outside of that there is no real difference. The integral on the left is exactly the same integral in each equation. The only difference is the letter used in the integral. If we integrate \(\eqref{eq:eq2}\) and then back substitute in for \(u\) we would arrive at the same thing as if we’d just integrated \(\eqref{eq:eq3}\) from the start.

Therefore, to make the work go a little easier, we’ll just use \(\eqref{eq:eq3}\) to find the solution to the differential equation. Also, after doing the integrations, we will have an implicit solution that we can hopefully solve for the explicit solution, \(y(x)\). Note that it won't always be possible to solve for an explicit solution.

Recall from the Definitions section that an implicit solution is a solution that is not in the form \(y = y\left( x \right)\) while an explicit solution has been written in that form.

We will also have to worry about the interval of validity for many of these solutions. Recall that the interval of validity was the range of the independent variable, \(x\) in this case, on which the solution is valid. In other words, we need to avoid division by zero, complex numbers, logarithms of negative numbers or zero, etc. Most of the solutions that we will get from separable differential equations will not be valid for all values of \(x\).

Let’s start things off with a fairly simple example so we can see the process without getting lost in details of the other issues that often arise with these problems.

Example 1 Solve the following differential equation and determine the interval of validity for the solution. \[\frac{{dy}}{{dx}} = 6{y^2}x\hspace{0.25in}\,\,\,y\left( 1 \right) = \frac{1}{{25}}\]
Show Solution

It is clear, hopefully, that this differential equation is separable. So, let’s separate the differential equation and integrate both sides. As with the linear first order officially we will pick up a constant of integration on both sides from the integrals on each side of the equal sign. The two can be moved to the same side and absorbed into each other. We will use the convention that puts the single constant on the side with the \(x\)’s given that we will eventually be solving for \(y\) and so the constant would end up on that side anyway.

\[\begin{align*}{y^{ - 2}}dy & = 6x\,dx\\\int{{{y^{ - 2}}dy}} & = \int{{6x\,dx}}\\ - \frac{1}{y} & = 3{x^2} + c\end{align*}\]

So, we now have an implicit solution. This solution is easy enough to get an explicit solution, however before getting that it is usually easier to find the value of the constant at this point. So apply the initial condition and find the value of \(c\).

\[ - \frac{1}{{{}^{1}/{}_{{25}}}} = 3{\left( 1 \right)^2} + c\hspace{0.25in}c = - 28\]

Plug this into the general solution and then solve to get an explicit solution.

\[\begin{align*} - \frac{1}{y} & = 3{x^2} - 28\\ y\left( x \right) & = \frac{1}{{28 - 3{x^2}}}\end{align*}\]

Now, as far as solutions go we’ve got the solution. We do need to start worrying about intervals of validity however.

Recall that there are two conditions that define an interval of validity. First, it must be a continuous interval with no breaks or holes in it. Second it must contain the value of the independent variable in the initial condition, x = 1 in this case.

So, for our case we’ve got to avoid two values of \(x\). Namely, \(x \ne \pm \sqrt {\frac{{28}}{3}} \approx \pm \,3.05505\) since these will give us division by zero. This gives us three possible intervals of validity.

\[- \infty < x < - \sqrt {\frac{{28}}{3}} \hspace{0.25in} - \sqrt {\frac{{28}}{3}} < x < \sqrt {\frac{{28}}{3}} \hspace{0.25in}\,\,\,\sqrt {\frac{{28}}{3}} < x < \infty \]

However, only one of these will contain the value of \(x\) from the initial condition and so we can see that

\[ - \sqrt {\frac{{28}}{3}} < x < \sqrt {\frac{{28}}{3}} \]

must be the interval of validity for this solution.

Here is a graph of the solution.

A graph with domain $-3 \le x \le 3$ and range $0 \le y \le 1$.  The graph looks like the letter “U”.  It decreases sharply along x=-3 before flattening out between 3<x<3 and then increases sharply along x=3.

Note that this does not say that either of the other two intervals listed above can’t be the interval of validity for any solution to the differential equation. With the proper initial condition either of these could have been the interval of validity.

We’ll leave it to you to verify the details of the following claims. If we use an initial condition of

\[y\left( { - 4} \right) = - \frac{1}{{20}}\]

we will get exactly the same solution however in this case the interval of validity would be the first one.

\[ - \infty < x < - \sqrt {\frac{{28}}{3}} \]

Likewise, if we use

\[y\left( 6 \right) = - \frac{1}{{80}}\]

as the initial condition we again get exactly the same solution and, in this case, the third interval becomes the interval of validity.

\[\sqrt {\frac{{28}}{3}} < x < \infty \]

So, simply changing the initial condition a little can give any of the possible intervals.

Example 2 Solve the following IVP and find the interval of validity for the solution. \[y' = \frac{{3{x^2} + 4x - 4}}{{2y - 4}}\hspace{0.25in}y\left( 1 \right) = 3\]
Show Solution

This differential equation is clearly separable, so let's put it in the proper form and then integrate both sides.

\[\begin{align*}\left( {2y - 4} \right)dy & = \left( {3{x^2} + 4x - 4} \right)\,dx\\ \int{{\left( {2y - 4} \right)dy}} & = \int{{\left( {3{x^2} + 4x - 4} \right)\,dx}}\\ {y^2} - 4y & = {x^3} + 2{x^2} - 4x + c\end{align*}\]

We now have our implicit solution, so as with the first example let’s apply the initial condition at this point to determine the value of \(c\).

\[{\left( 3 \right)^2} - 4\left( 3 \right) = {\left( 1 \right)^3} + 2{\left( 1 \right)^2} - 4\left( 1 \right) + c\hspace{0.25in}\,\,\,\,c = - 2\]

The implicit solution is then

\[{y^2} - 4y = {x^3} + 2{x^2} - 4x - 2\]

We now need to find the explicit solution. This is actually easier than it might look and you already know how to do it. First, we need to rewrite the solution a little

\[{y^2} - 4y - \left( {{x^3} + 2{x^2} - 4x - 2} \right) = 0\]

To solve this all we need to recognize is that this is quadratic in \(y\) and so we can use the quadratic formula to solve it. However, unlike quadratics you are used to, at least some of the “constants” will not actually be constant but will in fact involve \(x\)’s.

So, upon using the quadratic formula on this we get.

\[\begin{align*}y\left( x \right) & = \frac{{4 \pm \sqrt {16 - 4\left( 1 \right)\left( { - \left( {{x^3} + 2{x^2} - 4x - 2} \right)} \right)} }}{2}\\ & = \frac{{4 \pm \sqrt {16 + 4\left( {{x^3} + 2{x^2} - 4x - 2} \right)} }}{2}\end{align*}\]

Next, notice that we can factor a 4 out from under the square root (it will come out as a 2…) and then simplify a little.

\[\begin{align*}y\left( x \right) & = \frac{{4 \pm 2\sqrt {4 + \left( {{x^3} + 2{x^2} - 4x - 2} \right)} }}{2}\\ & = 2 \pm \sqrt {{x^3} + 2{x^2} - 4x + 2} \end{align*}\]

We are almost there. Notice that we’ve actually got two solutions here (the “\( \pm \)”) and we only want a single solution. In fact, only one of the signs can be correct. So, to figure out which one is correct we can reapply the initial condition to this. Only one of the signs will give the correct value so we can use this to figure out which one of the signs is correct. Plugging \(x\) = 1 into the solution gives.

\[3 = y\left( 1 \right) = 2 \pm \sqrt {1 + 2 - 4 + 2} = 2 \pm 1 = 3,\,1\]

In this case it looks like the “+” is the correct sign for our solution. Note that it is completely possible that the “–” could be the solution (i.e. using an initial condition of \(y\left( 1 \right) = 1\)) so don’t always expect it to be one or the other.

The explicit solution for our differential equation is.

\[y\left( x \right) = 2 + \sqrt {{x^3} + 2{x^2} - 4x + 2} \]

To finish the example out we need to determine the interval of validity for the solution. If we were to put a large negative value of \(x\) in the solution we would end up with complex values in our solution and we want to avoid complex numbers in our solutions here. So, we will need to determine which values of \(x\) will give real solutions. To do this we will need to solve the following inequality.

\[{x^3} + 2{x^2} - 4x + 2 \ge 0\]

In other words, we need to make sure that the quantity under the radical stays positive.

Using a computer algebra system like Maple or Mathematica we see that the left side is zero at \(x\) = –3.36523 as well as two complex values, but we can ignore complex values for interval of validity computations. Finally, a graph of the quantity under the radical is shown below.

A graph with domain $-4 \le x \le 2$ and range $-15 \le y \le 10$.  The graph starts at approximately (-4,-15) and increases to a peak at approximately (-2,10).  It then decreases to a valley at approximately (3/4,1) then increases for the rest of the graph ending at approximately (2,10).

So, in order to get real solutions we will need to require \(x \ge - 3.{\mbox{36523 }}\)because this is the range of \(x\)’s for which the quantity is positive. Notice as well that this interval also contains the value of \(x\) that is in the initial condition as it should.

Therefore, the interval of validity of the solution is \(x \ge - 3.{\mbox{36523 }}\).

Here is graph of the solution.

A graph with domain $-4 \le x \le 4$ and range $0 \le y \le 12$.  The graph starts at approximately (-3.2,-2) and increases sharply to a peak at approximately (-2,5).  It then decreases to a valley at approximately (1,3) then increases for the rest of the graph ending at approximately (4,12).
Example 3 Solve the following IVP and find the interval of validity of the solution. \[y' = \frac{{x{y^3}}}{{\sqrt {1 + {x^2}} }}\hspace{0.25in}y\left( 0 \right) = - 1\]
Show Solution

First separate and then integrate both sides.

\[\begin{align*}{y^{ - 3}}dy & = x{\left( {1 + {x^2}} \right)^{ - \frac{1}{2}}}\,dx\\ \int{{{y^{ - 3}}dy}} & = \int{{x{{\left( {1 + {x^2}} \right)}^{ - \frac{1}{2}}}\,dx}}\\ - \frac{1}{{2{y^2}}} & = \sqrt {1 + {x^2}} + c\end{align*}\]

Apply the initial condition to get the value of \(c\).

\[ - \frac{1}{2} = \sqrt 1 + c\hspace{0.25in}c = - \frac{3}{2}\]

The implicit solution is then,

\[ - \frac{1}{{2{y^2}}} = \sqrt {1 + {x^2}} - \frac{3}{2}\]

Now let’s solve for \(y(x)\).

\[\begin{align*}\frac{1}{{{y^2}}} & = 3 - 2\sqrt {1 + {x^2}} \\ {y^2} & = \frac{1}{{3 - 2\sqrt {1 + {x^2}} }}\\ y\left( x \right) & = \pm \frac{1}{{\sqrt {3 - 2\sqrt {1 + {x^2}} } }}\end{align*}\]

Reapplying the initial condition shows us that the “–” is the correct sign. The explicit solution is then,

\[y\left( x \right) = - \frac{1}{{\sqrt {3 - 2\sqrt {1 + {x^2}} } }}\]

Let’s get the interval of validity. That’s easier than it might look for this problem. First, since \(1 + {x^2} \ge 0\) the “inner” root will not be a problem. Therefore, all we need to worry about is division by zero and negatives under the “outer” root. We can take care of both by requiring

\[\begin{align*}3 - 2\sqrt {1 + {x^2}} & > 0\\ 3 & > 2\sqrt {1 + {x^2}} \\ 9 & > 4\left( {1 + {x^2}} \right)\\ \frac{9}{4} & > 1 + {x^2}\\ \frac{5}{4} & > {x^2}\end{align*}\]

Note that we were able to square both sides of the inequality because both sides of the inequality are guaranteed to be positive in this case. Finally solving for \(x\) we see that the only possible range of \(x\)’s that will not give division by zero or square roots of negative numbers will be,

\[ - \frac{{\sqrt 5 }}{2} < x < \frac{{\sqrt 5 }}{2}\]

and nicely enough this also contains the initial condition \(x=0\). This interval is therefore our interval of validity.

Here is a graph of the solution.

A graph with domain $-1 \le x \le 1$ and range $-3 \le y \le 0$.  The graph looks like an upside down letter “U”.  It increases sharply along x=-1 before flattening out between 1<x<1 going through (0,-1) and then decreases sharply along x=1.
Example 4 Solve the following IVP and find the interval of validity of the solution. \[y' = {{\bf{e}}^{ - y}}\left( {2x - 4} \right)\hspace{0.25in}y\left( 5 \right) = 0\]
Show Solution

This differential equation is easy enough to separate, so let's do that and then integrate both sides.

\[\begin{align*}{{\bf{e}}^y}\,dy & = \left( {2x - 4} \right)\,dx\\ \int{{{{\bf{e}}^y}\,dy}} & = \int{{\left( {2x - 4} \right)\,dx}}\\ {{\bf{e}}^y} & = {x^2} - 4x + c\end{align*}\]

Applying the initial condition gives

\[1 = 25 - 20 + c\hspace{0.25in}c = - 4\]

This then gives an implicit solution of.

\[{{\bf{e}}^y} = {x^2} - 4x - 4\]

We can easily find the explicit solution to this differential equation by simply taking the natural log of both sides.

\[y\left( x \right) = \ln \left( {{x^2} - 4x - 4} \right)\]

Finding the interval of validity is the last step that we need to take. Recall that we can't plug negative values or zero into a logarithm, so we need to solve the following inequality

\[{x^2} - 4x - 4 > 0\]

The quadratic will be zero at the two points \(x = 2 \pm 2\sqrt 2 \). A graph of the quadratic (shown below) shows that there are in fact two intervals in which we will get positive values of the polynomial and hence can be possible intervals of validity.

A graph with domain $-2 \le x \le 6$ and range $-10 \le y \le 10$.  This is a parabola with vertex at approximately (2,-8) and x-intercepts at approximately x=-0.9 and x=4.9.

So, possible intervals of validity are

\[\begin{array}{c} -\infty < x < 2 - 2\sqrt 2 \\ 2 + 2\sqrt 2 < x < \infty \end{array}\]

From the graph of the quadratic we can see that the second one contains \(x\) = 5, the value of the independent variable from the initial condition. Therefore, the interval of validity for this solution is.

\[2 + 2\sqrt 2 < x < \infty \]

Here is a graph of the solution.

A graph with domain $0 \le x \le 10$ and range $-10 \le y \le 4$.  The graph looks like an upside down letter “L”.  In increases sharply along x=5 then crosses the x-axis and then starts to shallow out, while continuing to increase.  At the right end it has shallowed out to a barely increasing line.
Example 5 Solve the following IVP and find the interval of validity for the solution. \[\frac{{dr}}{{d\theta }} = \frac{{{r^2}}}{\theta }\hspace{0.25in}r\left( 1 \right) = 2\]
Show Solution

This is actually a fairly simple differential equation to solve. We’re doing this one mostly because of the interval of validity.

So, get things separated out and then integrate.

\[\begin{align*}\frac{1}{{{r^2}}}dr & = \frac{1}{\theta }d\theta \\ \int{{\frac{1}{{{r^2}}}dr}} & = \int{{\frac{1}{\theta }d\theta }}\\ - \frac{1}{r} & = \ln \left| \theta \right| + c\end{align*}\]

Now, apply the initial condition to find \(c\).

\[ - \frac{1}{2} = \ln \left( 1 \right) + c\hspace{0.25in}c = - \frac{1}{2}\]

So, the implicit solution is then,

\[ - \frac{1}{r} = \ln \left| \theta \right| - \frac{1}{2}\]

Solving for \(r\) gets us our explicit solution.

\[r = \frac{1}{{\frac{1}{2} - \ln \left| \theta \right|}}\]

Now, there are two problems for our solution here. First, we need to avoid \(\theta = 0\) because of the natural log. Notice that because of the absolute value on the \(\theta \) we don’t need to worry about \(\theta \) being negative. We will also need to avoid division by zero. In other words, we need to avoid the following points.

\[\begin{align*}\frac{1}{2} - \ln \left| \theta \right| & = 0\\ \ln \left| \theta \right| & = \frac{1}{2}\hspace{0.25in}{\mbox{exponentiate both sides}}\\ & \left| \theta \right| = {{\bf{e}}^{\frac{1}{2}}}\\ \theta & = \pm \sqrt {\bf{e}} \end{align*}\]

So, these three points break the number line up into four portions, each of which could be an interval of validity.

\[\begin{array}{c} - \infty < \theta < - \sqrt {\bf{e}} \\ - \sqrt {\bf{e}} < \theta < 0\\ 0 < \theta < \sqrt {\bf{e}} \\ \sqrt {\bf{e}} < \theta < \infty \end{array}\]

The interval that will be the actual interval of validity is the one that contains \(\theta = 1\). Therefore, the interval of validity is \(0 < \theta < \sqrt {\bf{e}} \).

Here is a graph of the solution.

A graph with domain $0 \le x \le 1.6$ and range $0 \le y \le 16$.  The graph looks like the “L”.  Between 0<x<1.4 is a barely increasing line that starts slightly above the origin.  At the right end of the graph it starts to increases nearly vertically.
Example 6 Solve the following IVP. \[\frac{{dy}}{{dt}} = {{\bf{e}}^{y\, - \,t}}\sec \left( y \right)\left( {1 + {t^2}} \right)\hspace{0.25in}y\left( 0 \right) = 0\]
Show Solution

This problem will require a little work to get it separated and in a form that we can integrate, so let's do that first.

\[\begin{align*}\frac{{dy}}{{dt}} & = \frac{{{{\bf{e}}^y}{{\bf{e}}^{ - t}}}}{{\cos \left( y \right)}}\left( {1 + {t^2}} \right)\\ {{\bf{e}}^{ - y}}\cos \left( y \right)\,dy & = {{\bf{e}}^{ - t}}\left( {1 + {t^2}} \right)dt\end{align*}\]

Now, with a little integration by parts on both sides we can get an implicit solution.

\[\begin{align*}\int{{{{\bf{e}}^{ - y}}\cos \left( y \right)\,dy}} & = \int{{{{\bf{e}}^{ - t}}\left( {1 + {t^2}} \right)dt}}\\ \frac{{{{\bf{e}}^{ - \,y}}}}{2}\left( {\sin \left( y \right) - \cos \left( y \right)} \right) & = - {{\bf{e}}^{ - t}}\left( {{t^2} + 2t + 3} \right) + c\end{align*}\]

Applying the initial condition gives.

\[\frac{1}{2}\left( { - 1} \right) = - \left( 3 \right) + c\hspace{0.25in}c = \frac{5}{2}\]

Therefore, the implicit solution is.

\[\frac{{{{\bf{e}}^{ - y}}}}{2}\left( {\sin \left( y \right) - \cos \left( y \right)} \right) = - {{\bf{e}}^{ - t}}\left( {{t^2} + 2t + 3} \right) + \frac{5}{2}\]

It is not possible to find an explicit solution for this problem and so we will have to leave the solution in its implicit form. Finding intervals of validity from implicit solutions can often be very difficult so we will also not bother with that for this problem.

As this last example showed it is not always possible to find explicit solutions so be on the lookout for those cases.