1.3.5.1 Algorithm

Given \(y^{\prime }=f_{0}+f_{1}y+f_{2}y^{2}\), and also given one known particular solution \(y_{1}\). This is easy case. See section (3-1-2) on how to try to find a particular solution if one is not given. Once one particular solution is known (either given or by using 3-1-2) then finding the solution is done as follows. Let

\[ y=y_{1}+u\left ( x\right ) \]

The ode becomes Bernoulli as shown below

Assuming we are given a particular solution \(y_{1}\) to the general Riccati ode \(y^{\prime }=f_{0}\left ( x\right ) +f_{1}\left ( x\right ) y+f_{2}\left ( x\right ) y^{2}\). Then we can either let \(y=y_{1}+u\) or \(y=y_{1}+\frac {1}{u}\).

Using \(y=y_{1}+u\) method, then the the Riccati ode \(y^{\prime }=f_{0}+f_{1}y+f_{2}y^{2}\) becomes a Bernoulli ode.

\begin{align*} \left ( y_{1}+u\right ) ^{\prime } & =f_{0}+f_{1}\left ( y_{1}+u\right ) +f_{2}\left ( y_{1}+u\right ) ^{2}\\ y_{1}^{\prime }+u^{\prime } & =f_{0}+f_{1}y_{1}+f_{1}u+f_{2}\left ( y_{1}^{2}+u^{2}+2y_{1}u\right ) \\ y_{1}^{\prime }+u^{\prime } & =f_{0}+f_{1}y_{1}+f_{1}u+f_{2}y_{1}^{2}+f_{2}u^{2}+2f_{2}y_{1}u\\ y_{1}^{\prime }+u^{\prime } & =\overbrace {f_{0}+f_{1}y_{1}+f_{2}y_{1}^{2}}+f_{1}u+f_{2}u^{2}+2f_{2}y_{1}u\\ u^{\prime } & =f_{1}u+f_{2}u^{2}+2f_{2}y_{1}u\\ & =u\left ( f_{1}+2f_{2}y_{1}\right ) +f_{2}u^{2}\end{align*}

Which is Bernoulli ode. Solving this for \(u\) then \(y=y_{1}+u\). Another possibility is to assume that \(y=y_{1}+\frac {1}{u\left ( x\right ) }\) which results in Linear ode instead of Bernoulli which is a little simpler to solve. A direct formula to obtain the general solution if particular solution \(y_{1}\) is known is given on page 105 of the handbook of exact solutions of ordinary differential equation as

\begin{align} y & =y_{1}+\Phi \frac {1}{c_{1}-\int \Phi f_{2}dx}\nonumber \\ \Phi & =e^{\int 2f_{2}y_{1}+f_{1}dx} \tag {1}\end{align}

If the input ode was \(g\left ( x\right ) y^{\prime }=f_{0}+f_{1}y+f_{2}y^{2}\) instead, then (1) is modified to be

\begin{align} y & =y_{1}+\Phi \frac {1}{c_{1}-\int \Phi \frac {f_{2}}{g}dx}\nonumber \\ \Phi & =e^{\int \frac {2f_{2}y_{1}+f_{1}}{g}dx} \tag {2}\end{align}

Examples below show how to use these formulas. The above formula can be derived from using \(y=y_{1}+\frac {1}{u\left ( x\right ) }\) and using an integrating factor to solve for \(u\).