## Separation of variables

There exists a class of first order differentiable equations, ones of the form $\frac{dy}{dx} = f(x)g(y)$ that can be separated using multiplication and division operations only and then solved by directly integrating them.

The process is as follows $$ \frac{dy}{dx} = f(x)g(y) \Leftrightarrow \int \frac{1}{g(y)} dy = \int f(x)dx $$

Note that many first order differential equations cannot be solved using this method and two very similar equations could be separable and non-separable. For example the equation $$ \frac{dy}{dx} = xy + x $$ is separable, however, the equation $$ \frac{dy}{dx} = xy + x^2 $$ is not separable

## Separation of variables 1

## Separation of variables 2

Separation of variable yields $$ \int \frac{1}{y}dy = \int x\sin(x)dx $$ This now requires integration by parts on the right hand side. Proceeding with $u = x,\; v'= \sin(x)$ yields

$$ \ln(y) = -x\cos(x) + sin(x) + c $$

Making $y$ the subject gives a general equation of $$ y = Ae^{-x\cos(x) + \sin(x)} $$

## Separation of variables 3

The fraction on the left hand side decomposes as $$ \frac{4y+2}{y^2-1} = \frac{3}{y-1} + \frac{1}{y+1} $$

Our integrals therefore reduce to

$$ \int \frac{3}{y-1} + \frac{1}{y+1} dy = \frac{1}{2}x^2 + c $$Integrating the left hand side yields

$$ 3\ln(y-1) + \ln(y+1) = \frac{1}{2}x^2 + c $$