Separable Differential Equations

In calculus, a separable differential equation is a first-order differential equation that can be written as

\[ \frac{dy}{dx}=\frac{f(x)}{g(y)} \] which may be written as \[ g(y) dy = f(x) dx \]

The variables can be separated so that all terms involving \(y\) appear on one side and all terms involving \(x\) appear on the other. These equations can usually be solved by direct integration.

This tutorial explains the method and provides worked examples followed by practice exercises.


How to Solve Separable Differential Equations

  1. Rewrite the equation so that all \(y\) terms are on one side and all \(x\) terms on the other.
  2. Integrate both sides.
  3. Solve for \(y\) if possible.

Examples with Detailed Solutions

Example 1

Solve the differential equation:

\[ \frac{dy}{dx}=3x^2 e^{y} \]

Solution:

Separate variables: \[ e^{-y}dy=3x^2dx \] Integrate both sides: \[ \int e^{-y}dy=\int 3x^2dx \] \[ - e^{-y}=x^3+C \] Solve for \(y\): \[ e^{-y}=-x^3-C \] \[ -y=\ln(-x^3-C) \] \[ y=-\ln(-x^3-C) \]

This is the general solution. You may verify it by differentiating.


Example 2

Solve the differential equation:

\[ \frac{dy}{dx}=\frac{\sin x}{y\cos y} \]

Solution:

Separate variables: \[ y\cos y\,dy=\sin x\,dx \] Integrate: \[ \int y\cos y\,dy=\int \sin x\,dx \] Using integration by parts on the left: \[ y\sin y+\cos y=-\cos x+C \]

This solution is implicit; there is no simple explicit formula for \(y(x)\).


Practice Exercises

Solve the following separable differential equations:

a) \(\displaystyle \frac{dy}{dx}=-9x^2y^2\)

b) \(\displaystyle \frac{dy}{dx}=-2xe^{y}\)

Answers

a) \(\displaystyle y=\frac{1}{3x^3+C}\)

b) \(\displaystyle y=-\ln(x^2+C)\)


More References

Differential Equations Overview

Runge–Kutta Method