Skip to main content

Section 10.1 First Order Separable DEs

Definition 10.1.1.

A differential equation of the form

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

where \(g(y)\neq 0\) is called a first order separable DE.

Which of the following DEs are first order separable DEs?

  1. \(\displaystyle y^2y'=x \)

  2. \(\displaystyle y''+2y=0 \)

  3. \(\displaystyle \frac{dy}{dt}+3e^t=ye^t \)

  4. \(\displaystyle \frac{dy}{dt}+ty=2 \)

  5. \(\displaystyle y'=y(1-y) \)

  6. \(\displaystyle y'=y(x-y) \)

Answer.

\(a\text{,}\) \(c\) and \(e\)

Solution.
  1. This DE can be written as

    \begin{equation*} y'=\frac{x}{y^2} \end{equation*}
    Thus it is a first order separable DE with \(f(x)=x\) and \(g(y)=\frac{1}{y^2}\text{.}\)

  2. This DE is a second order DE (due to the \(y''\) term) and hence cannot be a first order separable DE.

  3. This DE can be rearranged as

    \begin{equation*} \frac{dy}{dt}=e^t(y-3) \end{equation*}
    and hence is a first order separable DE with \(f(t)=e^t\) and \(g(y)=y-3\text{.}\)

  4. When we try to rearrange this DE in the same manner as we did in part (c) we obtain

    \begin{equation*} \frac{dy}{dt}=2-ty \end{equation*}
    This is not of the form \(y'=f(t)g(y)\) and hence this first order DE is not separable.

  5. This DE is already in the form of a first order separable DE with \(f(x)=1\) and \(g(y)=y(1-y)\text{.}\)

  6. The right hand side of this DE can't be rearranged into the form \(y'=f(x)g(y)\) and so this DE is not a first order separable DE.

The method for solving first order separable DEs is based on integration by substitution. This integration technique was covered in Math1110 but the following example is given as a reminder.

Evaluate the integral \(\displaystyle\int 2x\sin(x^2) \hspace{2mm} dx\text{.}\)

Answer.

\(\displaystyle\int 2x\sin(x^2)\hspace{2mm} dx=-\cos(x^2)+C\)

Solution.

Since the integrand is of the form \(g'(x)\sin(g(x))\) (or, in Leibniz notation \(\sin(g(x))\frac{dg}{dx}\)) make the substitution

\begin{equation*} u=g(x)=x^2 \end{equation*}

Then

\begin{align*} \int 2x\sin(x^2)\hspace{2mm} dx \amp =\int \sin(u)\hspace{2mm} du\\ \amp =-\cos(u)+C \end{align*}
Using \(u=x^2\) gives

\begin{equation*} \int 2x\sin(x^2)\hspace{2mm} dx=-\cos(x^2)+C \end{equation*}

In general, the integration by substitution method says that for an integral of the form

\begin{equation*} \int f(g(x))\frac{dg}{dx}\hspace{2mm} dx \end{equation*}

the substitution

\begin{equation*} u=g(x) \end{equation*}

transforms the integral to

\begin{equation*} \int f(u)\hspace{2mm} du \end{equation*}

More succinctly, we can write this as

\begin{equation*} \int f(u)\frac{du}{dx}\hspace{2mm} dx=\int f(u)\hspace{2mm} du \end{equation*}

(As an aside, we saw in Math1110 that this formula follows directly from the chain rule of differentiation.)

Returning now to the problem of solving first order separable DEs, i.e. to solving DEs of the form

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

Assuming that \(g(y)\neq 0\text{,}\) rearrange the DE as

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

Note that in this step we are "separating the variables". Now integrate both sides with respect to \(x\) to obtain

\begin{equation*} \int \frac{1}{g(y)}\frac{dy}{dx}\hspace{2mm} dx=\int f(x) \hspace{2mm} dx \end{equation*}

Using the integration by substitution formula on the left hand side gives

\begin{equation*} \int \frac{1}{g(y)}\hspace{2mm} dy=\int f(x) \hspace{2mm} dx \end{equation*}

So long as we can actually perform the integrals on both sides of this equation we will have an equation which will implicitly define \(y\) (the unknown function) in terms of \(x\) (the independent variable). If we can further make \(y\) the subject of this equation then we will have found an explicit formula for the solution to the separable DE.

Find the general solution to the DE

\begin{equation*} \frac{dy}{dx}=-4xy^2 \end{equation*}
Answer.

\(y(x)=\dfrac{1}{2x^2+C}, \hspace{5mm} y(x)=0 \hspace{5mm} \textrm{ for } C\in\mathbb{R}\)

Solution.

This is a first order separable DE so begin by separating the variables, i.e.

\begin{equation*} \frac{1}{y^2}\frac{dy}{dx}=-4x \end{equation*}

Now integrate both sides with respect to \(x\text{,}\)

\begin{equation*} \int \frac{1}{y^2}\frac{dy}{dx}\hspace{2mm} dx=\int -4x\hspace{2mm} dx \end{equation*}

Using the integration by substitution formula this becomes

\begin{equation*} \int \frac{1}{y^2}\hspace{2mm} dy=\int -4x\hspace{2mm} dx \end{equation*}

Evaluating the integrals on both sides (and combining the two constants of integration) gives

\begin{equation*} -\frac{1}{y}=-2x^2+C \end{equation*}

Here we can make \(y\) the subject of the resulting equation and hence

\begin{equation*} y(x)=\frac{1}{2x^2+C} \end{equation*}

Note that we can check whether this function is a solution to the DE by substituting back into the original DE. On the left hand side, using the chain rule to differentiate \(y\) we obtain

\begin{equation*} \frac{dy}{dx}=-\frac{1}{(2x^2+C)^2}\times (4x)=\frac{-4x}{(2x^2+C)^2} \end{equation*}

On the right hand side

\begin{equation*} -4xy^2=(-4x)\left(\frac{1}{2x^2+C}\right)^2=\frac{-4x}{(2x^2+C)^2} \end{equation*}

and so \(y\) does indeed satisfy the DE.

The working so far has assumed that \(y^2\neq 0\) and hence that \(y\neq 0\text{.}\) Thus to check that we have found all of the solutions to the DE we must check whether the function \(y(x)=0\) is also a solution. Clearly it is. Thus the set of all solutions to the DE is

\begin{equation*} y(x)=\frac{1}{2x^2+C}, \hspace{5mm} y(x)=0 \hspace{5mm} \textrm{ for } C\in\mathbb{R} \end{equation*}

See Figure 10.1.5 for a sketch of these solutions for various values of \(C\text{.}\)

Figure 10.1.5.

Find the solution to the initial-value problem

\begin{equation*} (4y-\cos(y))\frac{dy}{dt}-3t^2=0, \hspace{5mm} y(0)=0 \end{equation*}
Answer.

\(2y^2-\sin(y)=t^3\)

Solution.

This is a first order separable DE so begin by separating the variables, i.e.

\begin{equation*} (4y-\cos(y))\frac{dy}{dt}=3t^2 \end{equation*}

Integrating both sides with respect to \(t\) and applying the integration by substitution formula to the left hand side gives

\begin{equation*} \int 4y-\cos(y)\hspace{2mm} dy=\int 3t^2\hspace{2mm} dt \end{equation*}

Evaluating the integrals on both sides (and combining the two constants of integration) gives

\begin{equation*} 2y^2-\sin(y)=t^3+C \end{equation*}

We can't make \(y\) the subject of this equation and so in this case we can't find an explicit formula for the general solution to the DE. Substituting the initial condition into the implicit equation gives

\begin{equation*} 2\times 0^2-\sin(0)=0^3+C \end{equation*}

i.e.

\begin{equation*} C=0 \end{equation*}

Thus the solution to the initial-value problem is the relevant function \(y(t)\) defined implicitly by

\begin{equation*} 2y^2-\sin(y)=t^3 \end{equation*}

The curve defined implicitly by this equation is shown in Figure 10.1.7 and from this we can see that the "bottom" part of the curve will be the function that is the solution to the initial-value problem.

Figure 10.1.7.

Find the general solution to the DE

\begin{equation*} \frac{dy}{dx}=y(1-y) \end{equation*}

Note: We looked at this example in Chapter 9. There we sketched a direction field for the DE.

Answer.

\(y(x)=\dfrac{Ae^x}{1+Ae^x}\)

Solution.

This is a first order separable DE with \(f(x)=1\) (i.e. it is autonomous) and \(g(y)=y(1-y)\text{.}\) On separating the variables and integrating both sides with respect to \(x\) we obtain

\begin{equation*} \int \frac{1}{y(1-y)}\hspace{2mm}dy=\int 1\hspace{2mm}dx \end{equation*}

To evaluate the integral on the left hand side we have to use partial fraction decomposition, by which we can determine that

\begin{equation*} \frac{1}{y(1-y)}=\frac{1}{y}+\frac{1}{1-y} \end{equation*}

Thus

\begin{align*} \int \frac{1}{y(1-y)}\hspace{2mm}dy \amp=\int \frac{1}{y}\hspace{2mm}dy +\int \frac{1}{1-y}\hspace{2mm}dy\\ \amp =\ln(\vert y\vert)-\ln(\vert 1-y\vert)+C \end{align*}
(Some more detail on partial fraction decomposition can be found in an appendix to this lecture.) So, on evaluating the integral on the right hand side and combining the two constants of integration we obtain

\begin{equation*} \ln(\vert y\vert)-\ln(\vert 1-y\vert)=x+K \end{equation*}

This can be rearranged as

\begin{equation*} y(x)=\frac{Ae^x}{1+Ae^x} \end{equation*}

Figure 10.1.9 shows this curve when \(A=1\) superimposed on top of the direction field for the DE. Also shown in the figure are the solutions \(y(x)=0\) and \(y(x)=1\) which come from checking separately the cases where \(g(y)=0\text{.}\)

Figure 10.1.9.

Find the solution to the initial-value problem

\begin{equation*} \frac{dy}{dx}=xy+x, \hspace{5mm} y(0)=1 \end{equation*}

Note: We looked at this example in section Chapter 9 where we used Euler’s method with \(\Delta x=0.1\) to approximate the value of the solution at \(x=0.3\text{.}\)

Answer.

\(y(x)=2e^{x^2/2}-1\)

Solution.

This is a first order separable DE with \(f(x)=x\) and \(g(y)=y+1\text{.}\) On separating the variables and integrating both sides with respect to \(x\) we obtain

\begin{equation*} \int \frac{1}{y+1}\hspace{2mm}dy=\int x\hspace{2mm}dx \end{equation*}

Evaluating the integrals and rearranging gives

\begin{equation*} y(x)=Ce^{x^2/2}-1 \end{equation*}

To satisfy the initial condition

\begin{align*} 1 \amp=Ce^0-1\\ C \amp =2 \end{align*}
Thus the solution to the initial-value problem is

\begin{equation*} y(x)=2e^{x^2/2}-1 \end{equation*}

Note: From this solution

\begin{equation*} y(0.3)=2e^{(0.3)^2/2}-1=1.0921 \textrm{ to 4.d.p.} \end{equation*}

The Euler method approximation was

\begin{equation*} y(0.3)=1.0604 \textrm{ to 4.d.p.} \end{equation*}

Figure 10.1.11 shows both the analytic solution and the Euler approximation over the domain \(0\leq x\leq 0.3\text{.}\)

Figure 10.1.11.

Exercises Example Tasks

1.

Find the general solution to the DE

\begin{equation*} \frac{\sqrt{1+x^2}}{y+1}\frac{dy}{dx}=-x \end{equation*}

2.

Solve the initial-value problem

\begin{equation*} y'=-\frac{x}{y+1}, \hspace{5mm} y(0)=2 \end{equation*}