# What is the general solution of the differential equation  dy/dx + y = xy^3 ?

## Hint: try a substitution $z = \frac{1}{y} ^ 2$

Sep 22, 2017

${y}^{2} = \frac{2}{2 x + 1 + A {e}^{2 x}}$

#### Explanation:

We have:

$\frac{\mathrm{dy}}{\mathrm{dx}} + y = x {y}^{3}$ ..... [A]

As suggested we perform a substitution:

$z = \frac{1}{y} ^ 2 \iff {y}^{2} = \frac{1}{z}$

The differentiating wrt $x$ we have:

$\frac{\mathrm{dz}}{\mathrm{dy}} = - \frac{2}{y} ^ 3 \implies \frac{\mathrm{dy}}{\mathrm{dz}} = - {y}^{3} / 2$

And from the chain rule, we have:

$\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{\mathrm{dy}}{\mathrm{dz}} \cdot \frac{\mathrm{dz}}{\mathrm{dx}} = - {y}^{3} / 2 \frac{\mathrm{dz}}{\mathrm{dx}}$

Substituting into the initial Differential Equation [A], we have:

$- {y}^{3} / 2 \frac{\mathrm{dz}}{\mathrm{dx}} + y = x {y}^{3}$

Dividing by ${y}^{3}$ we have:

$- \frac{1}{2} \frac{\mathrm{dz}}{\mathrm{dx}} + \frac{1}{y} ^ 2 = x$

$\therefore - \frac{1}{2} \frac{\mathrm{dz}}{\mathrm{dx}} + \frac{1}{\frac{1}{z}} = x$

$\therefore \frac{\mathrm{dz}}{\mathrm{dx}} - 2 z = - 2 x$ ..... [B}

This substitution has reduced the equation [A] to a Ordinary Differential Equation of the form, which can be solved using an integrating Factor;

$\frac{\mathrm{dz}}{\mathrm{dx}} + P \left(x\right) z = Q \left(x\right)$

Then the integrating factor is given by;

$I = {e}^{\int P \left(x\right) \mathrm{dx}}$
$\setminus \setminus = \exp \left(\int \setminus - 2 \setminus \mathrm{dx}\right)$
$\setminus \setminus = \exp \left(- 2 x\right)$
$\setminus \setminus = {e}^{- 2 x}$

And if we multiply the DE [B] by this Integrating Factor, $I$, we will have a perfect product differential;

$\frac{\mathrm{dz}}{\mathrm{dx}} {e}^{- 2 x} - 2 {e}^{- 2 x} z = - 2 x {e}^{- 2 x}$
$\therefore \frac{d}{\mathrm{dx}} \left({e}^{- 2 x} z\right) = - 2 x {e}^{- 2 x}$

We can now "separate the variables", to get:

${e}^{- 2 x} z = - 2 \setminus \int \setminus x {e}^{- 2 x} \setminus \mathrm{dx}$ ..... [C]

To integrate this integral we will require an application of Integration By Parts:

Let $\left\{\begin{matrix}u & = x & \implies \frac{\mathrm{du}}{\mathrm{dx}} & = 1 \\ \frac{\mathrm{dv}}{\mathrm{dx}} & = {e}^{- 2 x} & \implies v & = - \frac{1}{2} {e}^{- 2 x}\end{matrix}\right.$

Then plugging into the IBP formula:

$\int \setminus \left(u\right) \left(\frac{\mathrm{dv}}{\mathrm{dx}}\right) \setminus \mathrm{dx} = \left(u\right) \left(v\right) - \int \setminus \left(v\right) \left(\frac{\mathrm{du}}{\mathrm{dx}}\right) \setminus \mathrm{dx}$

gives us

$\int \setminus \left(x\right) \left({e}^{- 2 x}\right) \setminus \mathrm{dx} = \left(x\right) \left(- \frac{1}{2} {e}^{- 2 x}\right) - \int \setminus \left(- \frac{1}{2} {e}^{- 2 x}\right) \left(1\right) \setminus \mathrm{dx}$
$\therefore \int \setminus x {e}^{- 2 x} \setminus \mathrm{dx} = - \frac{1}{2} x {e}^{- 2 x} + \frac{1}{2} \int \setminus {e}^{- 2 x} \setminus \mathrm{dx}$
$\therefore \int \setminus x {e}^{- 2 x} \setminus \mathrm{dx} = - \frac{1}{2} x {e}^{- 2 x} - \frac{1}{4} {e}^{- 2 x}$

Using this result, we can now integrate [C] to get:

${e}^{- 2 x} z = - 2 \left\{- \frac{1}{2} x {e}^{- 2 x} - \frac{1}{4} {e}^{- 2 x}\right\} + c$

$\therefore z {e}^{- 2 x} = x {e}^{- 2 x} + \frac{1}{2} {e}^{- 2 x} + c$

$\therefore z = x + \frac{1}{2} + c {e}^{2 x}$

Restoring the substitution we get:

$\therefore \frac{1}{y} ^ 2 = \frac{1}{2} \left(2 x + 1 + 2 c {e}^{2 x}\right)$

$\therefore {y}^{2} = \frac{2}{2 x + 1 + 2 c {e}^{2 x}}$

Which we can write as:

${y}^{2} = \frac{2}{2 x + 1 + A {e}^{2 x}}$

Which is the general solution, or:

$y = \pm \sqrt{\frac{2}{2 x + 1 + A {e}^{2 x}}}$

The initial conditions are invalid as $y$ is given as a function, rather than a value!