2 Applying the method of separation of variables to ODEs
Example 3
Use the method of separation of variables to solve the differential equation
$\phantom{\rule{2em}{0ex}}\frac{dy}{dx}=\frac{3{x}^{2}}{y}$
Solution
The equation already has the form
$\phantom{\rule{2em}{0ex}}\frac{dy}{dx}=f\left(x\right)g\left(y\right)$
where
$\phantom{\rule{2em}{0ex}}f\left(x\right)=3{x}^{2}\phantom{\rule{2em}{0ex}}\text{and}\phantom{\rule{2em}{0ex}}g\left(y\right)=1\u2215y.$
Dividing both sides by $g\left(y\right)$ we find
$\phantom{\rule{2em}{0ex}}y\frac{dy}{dx}=3{x}^{2}$
Integrating both sides with respect to $x$ gives
$\phantom{\rule{2em}{0ex}}\int y\frac{dy}{dx}\phantom{\rule{0.3em}{0ex}}dx=\int 3{x}^{2}\phantom{\rule{0.3em}{0ex}}dx$
that is
$\phantom{\rule{2em}{0ex}}\int y\phantom{\rule{0.3em}{0ex}}dy=\int 3{x}^{2}\phantom{\rule{0.3em}{0ex}}dx$
Note that the lefthand side is an integral involving just $y$ ; the righthand side is an integral involving just $x$ . After integrating both sides with respect to the stated variables we find
$\phantom{\rule{2em}{0ex}}\frac{1}{2}{y}^{2}={x}^{3}+c$
where $c$ is a constant of integration. (You might think that there would be a constant on the lefthand side too. You are quite right but the two constants can be combined into a single constant and so we need only write one.)
We now have a relationship between $y$ and $x$ as required. Often it is sufficient to leave your answer in this form but you may also be required to obtain an explicit relation for $y$ in terms of $x$ . In this particular case
$\phantom{\rule{2em}{0ex}}{y}^{2}=2{x}^{3}+2c$
so that
$\phantom{\rule{2em}{0ex}}y=\pm \sqrt{2{x}^{3}+2c}$
Task!
Use the method of separation of variables to solve the differential equation
$\phantom{\rule{2em}{0ex}}\frac{dy}{dx}=\frac{cosx}{sin2y}$
First separate the variables so that terms involving $y$ and $\frac{dy}{dx}$ appear on the left, and terms involving $x$ appear on the right:
You should have obtained
$\phantom{\rule{2em}{0ex}}sin2y\phantom{\rule{0.3em}{0ex}}\frac{dy}{dx}=cosx$
Now reformulate both sides as integrals:
$\phantom{\rule{2em}{0ex}}\int sin2y\phantom{\rule{0.3em}{0ex}}\frac{dy}{dx}\phantom{\rule{0.3em}{0ex}}dx=\int cosx\phantom{\rule{0.3em}{0ex}}dx\phantom{\rule{1em}{0ex}}\text{thatis}\phantom{\rule{1em}{0ex}}\int sin2y\phantom{\rule{0.3em}{0ex}}dy=\int cosx\phantom{\rule{0.3em}{0ex}}dx$
Now integrate both sides:
$\phantom{\rule{2em}{0ex}}\frac{1}{2}cos2y=sinx+c$
Finally, rearrange to obtain an expression for $y$ in terms of $x$ :
$\phantom{\rule{2em}{0ex}}y=\frac{1}{2}{cos}^{1}\left(D2sinx\right)\text{where}D=2c$
Exercises

Solve the equation
$\phantom{\rule{2em}{0ex}}\frac{dy}{dx}=\frac{{\text{e}}^{x}}{y}.$

Solve the following equation subject to the condition
$y\left(0\right)=1$
:
$\phantom{\rule{2em}{0ex}}\frac{dy}{dx}=3{x}^{2}{\text{e}}^{y}$

Find the general solution of the following equations:
 $\frac{dy}{dx}=3$ ,
 $\frac{dy}{dx}=\frac{6sinx}{y}$


Find the general solution of the equation
$\phantom{\rule{2em}{0ex}}\frac{dx}{dt}=t\left(x2\right).$
 Find the particular solution which satisfies the condition $x\left(0\right)=5$ .

Find the general solution of the equation

Some equations which do not appear to be separable can be made so by means of a suitable
substitution. By means of the substitution $z=y\u2215x$ solve the equation
$\phantom{\rule{2em}{0ex}}\frac{dy}{dx}=\frac{{y}^{2}}{{x}^{2}}+\frac{y}{x}+1$

The equation
$\phantom{\rule{2em}{0ex}}iR+L\frac{di}{dt}=E$
where $R$ , $L$ and $E$ are constants arises in electrical circuit theory. This equation can be
solved by separation of variables. Find the solution which satisfies the condition $i\left(0\right)=0$ .
 $y=\pm \sqrt{D2{\text{e}}^{x}}$ .
 $y=ln\left({x}^{3}+e\right)$ .

 $y=3x+C$ ,
 $\frac{1}{2}{y}^{2}=C6cosx$ .

 $x=2+A{\text{e}}^{{t}^{2}\u22152}$ ,
 $x=2+3{\text{e}}^{{t}^{2}\u22152}$ .
 $z=tan\left(lnDx\right)$ so that $y=xtan\left(lnDx\right)$ .
 $i=\frac{E}{R}\left(1{\text{e}}^{t\u2215\tau}\right)$ where $\tau =L\u2215R$ .