Bernoulli's Equation/x y^2 y' + y^3 = x cosine x

Theorem
The first order ODE:
 * $(1): \quad x y^2 y' + y^3 = x \cos x$

has the solution:
 * $y^3 = 3 \sin x + \dfrac {9 \cos x} x - \dfrac {18 \sin x} {x^2} - \dfrac {18 \cos x} {x^3} + \dfrac C {x^3}$

Proof
Let $(1)$ be rearranged as:
 * $(2): \quad \dfrac {\mathrm d y} {\mathrm d x} + \dfrac 1 x y = \dfrac {\cos x} {y^2}$

It can be seen that $(2)$ is in the form:
 * $\dfrac {\mathrm d y}{\mathrm d x} + P \left({x}\right) y = Q \left({x}\right) y^n$

where:
 * $P \left({x}\right) = \dfrac 1 x$
 * $Q \left({x}\right) = \cos x$
 * $n = -2$

and so is an example of Bernoulli's equation.

By Solution to Bernoulli's Equation it has the general solution:
 * $(3): \quad \displaystyle \frac {\mu \left({x}\right)} {y^{n - 1} } = \left({1 - n}\right) \int Q \left({x}\right) \mu \left({x}\right) \, \mathrm d x + C$

where:
 * $\mu \left({x}\right) = e^{\left({1 - n}\right) \int P \left({x}\right) \, \mathrm d x}$

Thus $\mu \left({x}\right)$ is evaluated:

and so substituting into $(3)$:

Hence the general solution to $(1)$ is:


 * $y^3 = 3 \sin x + \dfrac {9 \cos x} x - \dfrac {18 \sin x} {x^2} - \dfrac {18 \cos x} {x^3} + \dfrac C {x^3}$