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 general 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 {\d y} {\d x} + \dfrac 1 x y = \dfrac {\cos x} {y^2}$

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

where:
 * $\map P x = \dfrac 1 x$
 * $\map Q x = \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 {\map \mu x} {y^{n - 1} } = \paren {1 - n} \int \map Q x \, \map \mu x \rd x + C$

where:
 * $\map \mu x = e^{\paren {1 - n} \int \map P x \rd x}$

Thus $\map \mu x$ 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}$