# Separable Differential Equations

What are separable differential equations and how to solve them?
 This is a tutorial on solving separable differential equations of the form $\dfrac{dy}{dx} = \dfrac{f(x)}{g(y)}$ Examples with detailed solutions are presented and a set of exercises is presented after the tutorials. Depending on $$f(x)$$ and $$g(y)$$, these equations may be solved analytically.

## Examples with Solutions

### Example 1:

Solve and find a general solution to the differential equation.
$\dfrac{dy}{dx} = 3e^{y}x^{2}$
Solution to Example 1:
We first rewrite the given equations in differential form and with variables separated, the y's on one side and the x's on the other side as follows.
$e^{-y} dy = 3x^{2} dx$
Integrate both side.
$\int e^{-y} dy = \int 3x^{2} dx$
which gives
$-e^{-y} + C_{1} = x^{3} + C_{2}$, $$C_{1}$$ and $$C_{2}$$ are constant of integration.
We now solve the above equation for y
$-e^{-y} = x^{3} + C_{2} - C_{1}$ $e^{-y} = - x^{3} - C_{2} + C_{1}$ $- y = \ln(- x^{3} - C_{2} + C_{1})$ $y = -\ln(-x^{3} - C)$, where $$C = C_{2} - C_{1}$$.
As practice, verify that the solution $$y = -\ln(-x^{3} - C)$$ obtained satisfy the differential equation given above.

### Example 2:

Solve and find a general solution to the differential equation.
$\dfrac{dy}{dx} = \dfrac{\sin x}{y\cos y}$
Solution to Example 2:
Separate variables and write in differential form.
$y \; \cos y \;dy = \sin x \;dx$
Integrate both sides
$\int y\cos y dy = \int \sin x dx$
The left side may be integrated by parts
$y\; \sin y - \int \sin y \; dy = -\cos x$
$y\sin y + \cos y + C_{1} = -\cos x + C_{2}$, $$C_{1}$$ and $$C_{2}$$ are constants of integration.
In this case there is no simple formula for $$y$$ as a function of $$x$$.
$y = \dfrac{-\cos x - \cos y + C}{\sin y}$, where $$C = C_{2} - C_{1}$$

## Exercises:

Solve the following separable differential equations.
a) $$\dfrac{dy}{dx} = -9x^{2}y^{2}$$
b) $$\dfrac{dy}{dx} = -2xe^{y}$$

Solutions to the above exercises
a) $$y = \dfrac{1}{3x^{3} + C}$$
b) $$y = -\ln(x^{2} + C)$$