Bernoulli's Equation/x^2 dy = (2 x y + y^2) dx

Theorem
The first order ODE:
 * $(1): \quad x^2 \, \mathrm d y = \left({2 x y + y^2}\right) \mathrm d x$

has the solution:
 * $y = - \dfrac {x^2} {x + C}$

Proof
Rearranging $(1)$:


 * $(2): \quad \dfrac {\mathrm d y} {\mathrm d x} - \dfrac 2 x y = \dfrac {y^2} {x^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 2 x$
 * $Q \left({x}\right) = \dfrac 1 {x^2}$
 * $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)$: