General Solution of Riccati Equation from Particular Solution

Theorem
Consider the Riccati equation:
 * $(1): \quad y' = p \left({x}\right) + q \left({x}\right) y + r \left({x}\right) y^2$

Let $y_1 \left({x}\right)$ be a particular solution to $(1)$.

Then the general solution to $(1)$ has the form:
 * $y \left({x}\right) = y_1 \left({x}\right) + z \left({x}\right)$

where $z \left({x}\right)$ is the general solution to the Bernoulli equation:
 * $z' - \left({q - 2 r y_1}\right) z = r z^2$

Proof
Let $y \left({x}\right) = y_1 \left({x}\right) + z \left({x}\right)$ be a particular solution to $(1)$.

Then: