### 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∕y.$

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 left-hand side is an integral involving just $y$ ; the right-hand 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 left-hand 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=±\sqrt{2{x}^{3}+2c}$

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:

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$ :

##### Exercises
1. Solve the equation

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

2. 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}$

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

$\phantom{\rule{2em}{0ex}}\frac{dx}{dt}=t\left(x-2\right).$

2. Find the particular solution which satisfies the condition $x\left(0\right)=5$ .
4. 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∕x$ solve the equation

$\phantom{\rule{2em}{0ex}}\frac{dy}{dx}=\frac{{y}^{2}}{{x}^{2}}+\frac{y}{x}+1$

5. 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$ .

1. $y=±\sqrt{D-2{\text{e}}^{-x}}$ .
2. $y=ln\left({x}^{3}+e\right)$ .
1. $y=3x+C$ ,
2. $\frac{1}{2}{y}^{2}=C-6cosx$ .
1. $x=2+A{\text{e}}^{{t}^{2}∕2}$ ,
2. $x=2+3{\text{e}}^{{t}^{2}∕2}$ .
3. $z=tan\left(lnDx\right)$   so that   $y=xtan\left(lnDx\right)$ .
4. $i=\frac{E}{R}\left(1-{\text{e}}^{-t∕\tau }\right)$ where $\tau =L∕R$ .