Skip to main content

First order separable

The \(x\) and \(y\) terms in first order separable differential equations can be separated to make them easier to solve. These equations are seen when modelling population growth or chemical reactions. Use this resource to learn how to solve them.

First order separable differential equations

A first order separable differential equation is a special type of differential equation in which we can isolate the variables on opposite sides of the equation.

The general form for a first order separable equation is:

\[\frac{dy}{dx}=g(x)h(y)\]

This is considered separable because we can rearrange it to:

\[\frac{1}{h(y)}dy=g(x)dx\]

Once we separate it out, we can integrate each side independently to find the solution. This gives us a simpler understanding of how the variables relate to each other.

Exercise – identifying first order separable differential equations

Which of the following are first order separable differential equations?

  1. \(\dfrac{dy}{dx}=xy^{2}\)
  2. \(y'+xy=\sin(x)\)
  3. \(\dfrac{dy}{dx}=\dfrac{x}{y}\)
  4. \(x^{2}\dfrac{dy}{dx}=y+x\)

\(A\) and \(B\) only

Solving first order separable differential equations

The method for solving first order separable differential equations is straightforward.

  1. Rearrange the differential equation so that the \(y\) terms and \(dy\) are on one side, and the \(x\) terms and \(dx\) are on the other side.
  2. Integrate each side separately.
  3. Solve for \(y\) and don't forget to include a constant.

In some cases, we don't have enough information to find an exact solution, so we give a general solution that includes a constant.

But if we are given a set of coordinates that satisfy the equation, we can find a particular solution. All we need to do is substitute the \(x\) and \(y\) values into our general solution to find the constant.

Example 1 – solving first order separable differential equations

Solve for \(y(x)\) given \(\dfrac{dy}{dx}-x^{2}y=0\).

Rearrange the differential equation so that the \(y\) terms and \(dy\) are on one side, and the \(x\) terms and \(dx\) are on the other side.
\[\begin{align*} \frac{dy}{dx}-x^{2}y & = 0\\
\frac{1}{y}\frac{dy}{dx} & = x^{2}\\
\frac{1}{y}dy & = x^{2}dx
\end{align*}\]

Now that we have separated the variables, we can integrate each side separately.
\[\begin{align*} \int\frac{1}{y}dy & = \int x^{2}dx\\
\ln(y) & = \frac{x^{3}}{3}+c\\
e^{\ln(y)} & = e^{\frac{x^{3}}{3}+c}\\
y & = e^{\frac{x^{3}}{3}}\times e^{c}\\
& = Ae^{\frac{x^{3}}{3}}
\end{align*}\]

where \(A=e^{c}\). We can do this because \(e^{c}\) will just be a constant.

Solve for \(y(x)\) given \(\dfrac{dy}{dx}=3y+1\) and \(y(0)=1\).

Rearrange the differential equation so that the \(y\) terms and \(dy\) are on one side, and the \(x\) terms and \(dx\) are on the other side.
\[\begin{align*} \frac{dy}{dx} & = 3y+1\\
\frac{1}{3y+1}\frac{dy}{dx} & = 1\\
\frac{1}{3+1}dy & = 1dx
\end{align*}\]

Now that we have separated the variables, we can integrate each side separately.
\[\int\frac{1}{3y+1}dy = \int1dx\]

For the left side, we have to use the substitution rule. We let \(u=3y+1\), so \(\dfrac{du}{dy}=3\) and \(dy=\dfrac{dy}{3}\).
\[\begin{align*} \int\frac{1}{3y+1}dy & = \int1dx\\
\int\frac{1}{u}\frac{du}{3} & = \int1dx\\
\frac{1}{3}\ln(u) & = x+c\\
\ln(u) & = 3(x+c)\\
\ln(u) & = 3x+3c\\
\ln(3y+1) & = 3x+3c\\
3y+1 & = e^{3x+3c}\\
& = e^{3x}e^{3c}\\
y & = \frac{1}{3}(e^{3x}e^{3c}-1)\\
& = \frac{1}{3}e^{3x}e^{3c}-\frac{1}{3}\\
& = Ae^{3x}-\frac{1}{3}
\end{align*}\]

where \(A=\dfrac{1}{3}e^{3c}\).

We know that \(y(0)=1\), so we can solve for \(A\).
\[\begin{align*} 1 & = Ae^{3\times0}-\frac{1}{3}\\
A & = \frac{4}{3}
\end{align*}\]

Putting this altogether:
\[y(x)=\frac{4}{3}e^{3x}-\frac{1}{3}\]

Exercise – solving first order separable differential equations

  1. Solve the following.
    1. \(\dfrac{dy}{dx}=\sin(5x)\)
    2. \(\dfrac{dy}{dx}=\dfrac{y^{3}}{x^{2}}\)
    3. \(\dfrac{dy}{dx}=\dfrac{x^{2}y^{2}}{1+x}\)
    4. \(\dfrac{dy}{dx}=e^{3x+2y}\)
  2. Find the general solutions for the following.
    1. \(dx+e^{3x}dy=0\)
    2. \((x+1)\dfrac{dy}{dx}=x+6\)
    3. \(xy'=4y\)
  3. Find the particular solutions for the following.
    1. \(\dfrac{dy}{dx}=yx\sin(5x)\) where \(y(0)=1\)
    2. \(\dfrac{dy}{dx}+ty=y\) where \(y(1)=3\)
    3. \(\dfrac{dy}{dx}=y^{2}-1\) where \(y(0)=2\)

    1. \(y=-\dfrac{1}{5}\cos(5x)+c\)
    2. \(y=\pm\sqrt{\dfrac{x}{cx+2}}\)
    3. \(y=\left(-\dfrac{1}{2}x^{2}+x-\ln\left|x+1\right|+c\right)^{-1}\)
    4. \(y=-\dfrac{1}{2}\ln\left(\dfrac{2}{3}e^{3x}+c\right)\)
    1. \(y=\dfrac{1}{3}e^{-3x}+c\)
    2. \(y=x+5\ln\left|x+1\right|+c\)
    3. \(y=cx^{4}\)
    1. \(y=e^{-\frac{x}{5}\cos(5x)+\frac{1}{25}\sin(5x)}\)
    2. \(y=3e^{t-\frac{1}{2}t^{2}-\frac{1}{2}}\)
    3. \(y=\dfrac{3+e^{2x}}{3-e^{2x}}\)