Particular solution to a Riccati equation $y' = 1 + 2y + xy^2$

Approach $1$:

Let $y=-\dfrac{u'}{xu}$ ,

Then $y'=-\dfrac{u''}{xu}+\dfrac{u'}{x^2u}+\dfrac{(u')^2}{xu^2}$

$\therefore-\dfrac{u''}{xu}+\dfrac{u'}{x^2u}+\dfrac{(u')^2}{xu^2}=1-\dfrac{2u'}{xu}+\dfrac{(u')^2}{xu^2}$

$\dfrac{u''}{xu}-\dfrac{2u'}{xu}-\dfrac{u'}{x^2u}+1=0$

$xu''-(2x+1)u'+x^2u=0$

gives a 2nd-order linear ODE which is very difficult to solve, as http://eqworld.ipmnet.ru/en/solutions/ode/ode-toc2.htm cannot find any forms that fits this ODE, and kernel method cannot directly apply as some of the coefficients have nonlinear functions, even using Frobenius method will become troublesome as this involves solving linear recurrence relations with more than two terms and with variable coefficients.

So we can make comparison with another approach, as all Riccati equations with dependent variable $y$ have an interesting property that the substitution $y=\dfrac{1}{u}$ will brings the Riccati equations to the Riccati equations again, but the coefficients are rearranged.

Approach $2$:

Let $y=\dfrac{1}{u}$ ,

Then $y'=-\dfrac{u'}{u^2}$

$\therefore-\dfrac{u'}{u^2}=1+\dfrac{2}{u}+\dfrac{x}{u^2}$

$u'=-u^2-2u-x$

Let $u=\dfrac{v'}{v}$ ,

Then $u'=\dfrac{v''}{v}-\dfrac{(v')^2}{v^2}$

$\therefore\dfrac{v''}{v}-\dfrac{(v')^2}{v^2}=-\dfrac{(v')^2}{v^2}-\dfrac{2v'}{v}-x$

$\dfrac{v''}{v}+\dfrac{2v'}{v}+x=0$

$v''+2v'+xv=0$

The 2nd-order linear ODE obtained by Approach $2$ of course is much easier to solve than that obtained by Approach $1$, so adopt Approach $2$.

In fact this ODE can be solved by kernel method:

Let $v=\int_Ce^{xs}K(s)~ds$ ,

Then $(\int_Ce^{xs}K(s)~ds)''+2(\int_Ce^{xs}K(s)~ds)'+x\int_Ce^{xs}K(s)~ds=0$

$\int_Cs^2e^{xs}K(s)~ds+2\int_Cse^{xs}K(s)~ds+\int_Ce^{xs}K(s)~d(xs)=0$

$\int_C(s^2+2s)e^{xs}K(s)~ds+\int_CK(s)~d(e^{xs})=0$

$\int_C(s^2+2s)e^{xs}K(s)~ds+[e^{xs}K(s)]_C-\int_Ce^{xs}~d(K(s))=0$

$\int_C(s^2+2s)e^{xs}K(s)~ds+[e^{xs}K(s)]_C-\int_Ce^{xs}K'(s)~ds=0$

$[e^{xs}K(s)]_C-\int_C(K'(s)-(s^2+2s)K(s))e^{xs}~ds=0$

$\therefore K'(s)-(s^2+2s)K(s)=0$

$K'(s)=(s^2+2s)K(s)$

$\dfrac{K'(s)}{K(s)}=s^2+2s$

$\int\dfrac{K'(s)}{K(s)}ds=\int(s^2+2s)~ds$

$\ln K(s)=\dfrac{s^3}{3}+s^2+c_1$

$K(s)=ce^{\frac{s^3}{3}+s^2}$

$\therefore v=\int_Cce^{\frac{s^3}{3}+s^2+xs}~ds$

But since the above procedure in fact suitable for any complex number $s$ ,

$\therefore v_n=\int_{a_n}^{b_n}c_ne^{\frac{((p_n+q_ni)t)^3}{3}+((p_n+q_ni)t)^2+x(p_n+q_ni)t}~d((p_n+q_ni)t)$

$=(p_n+q_ni)c_n\int_{a_n}^{b_n}e^{\frac{(p_n^3+3p_n^2q_ni-3p_nq_n^2-q_n^3i)t^3}{3}+(p_n^2+2p_nq_ni-q_n^2)t^2+(p_n+q_ni)xt}~dt$

$=(p_n+q_ni)c_n\int_{a_n}^{b_n}e^{\frac{(p_n^2-3q_n^2)p_nt^3}{3}+(p_n^2-q_n^2)t^2+p_nxt}e^{\left(\frac{(3p_n^2-q_n^2)q_nt^3}{3}+2p_nq_nt^2+q_nxt\right)i}~dt$

For some $x$-independent real number choices of $a_n$ , $b_n$ , $p_n$ and $q_n$ such that:

$\lim\limits_{t\to a_n}e^{\frac{(p_n^2-3q_n^2)p_nt^3}{3}+(p_n^2-q_n^2)t^2+p_nxt}e^{\left(\frac{(3p_n^2-q_n^2)q_nt^3}{3}+2p_nq_nt^2+q_nxt\right)i}$

$=\lim\limits_{t\to b_n}e^{\frac{(p_n^2-3q_n^2)p_nt^3}{3}+(p_n^2-q_n^2)t^2+p_nxt}e^{\left(\frac{(3p_n^2-q_n^2)q_nt^3}{3}+2p_nq_nt^2+q_nxt\right)i}$

$\int_{a_n}^{b_n}e^{\frac{(p_n^2-3q_n^2)p_nt^3}{3}+(p_n^2-q_n^2)t^2+p_nxt}e^{\left(\frac{(3p_n^2-q_n^2)q_nt^3}{3}+2p_nq_nt^2+q_nxt\right)i}~dt$ converges

For $n=1$, the best choice is $a_1=-\infty$ , $b_1=\infty$ , $p_1=0$ , $q_1=-1$

$\therefore v_1=-ic_1\int_{-\infty}^\infty e^{-t^2}e^{\left(\frac{t^3}{3}-xt\right)i}~dt$

$=-ic_1\left(\int_{-\infty}^0e^{-t^2}e^{\left(\frac{t^3}{3}-xt\right)i}~dt+\int_0^\infty e^{-t^2}e^{\left(\frac{t^3}{3}-xt\right)i}~dt\right)$

$=-ic_1\left(\int_\infty^0e^{-(-t)^2}e^{\left(\frac{(-t)^3}{3}-x(-t)\right)i}~d(-t)+\int_0^\infty e^{-t^2}e^{\left(\frac{t^3}{3}-xt\right)i}~dt\right)$

$=-ic_1\left(\int_0^\infty e^{-t^2}e^{\left(-\frac{t^3}{3}+xt\right)i}~dt+\int_0^\infty e^{-t^2}e^{\left(\frac{t^3}{3}-xt\right)i}~dt\right)$

$=-ic_1\left(\int_0^\infty e^{-t^2}e^{-\left(\frac{t^3}{3}-xt\right)i}~dt+\int_0^\infty e^{-t^2}e^{\left(\frac{t^3}{3}-xt\right)i}~dt\right)$

$=C_1\int_0^\infty e^{-t^2}\cos\left(\dfrac{t^3}{3}-xt\right)dt$

Checking:

$\left(C_1\int_0^\infty e^{-t^2}\cos\left(\dfrac{t^3}{3}-xt\right)dt\right)''+2\left(C_1\int_0^\infty e^{-t^2}\cos\left(\dfrac{t^3}{3}-xt\right)dt\right)'+xC_1\int_0^\infty e^{-t^2}\cos\left(\dfrac{t^3}{3}-xt\right)dt$

$=-C_1\int_0^\infty t^2e^{-t^2}\cos\left(\dfrac{t^3}{3}-xt\right)dt+2C_1\int_0^\infty te^{-t^2}\sin\left(\dfrac{t^3}{3}-xt\right)dt+C_1\int_0^\infty xe^{-t^2}\cos\left(\dfrac{t^3}{3}-xt\right)dt$

$=-C_1\int_0^\infty(t^2-x)e^{-t^2}\cos\left(\dfrac{t^3}{3}-xt\right)dt+C_1\int_0^\infty2te^{-t^2}\sin\left(\dfrac{t^3}{3}-xt\right)dt$

$=-C_1\int_0^\infty e^{-t^2}\cos\left(\dfrac{t^3}{3}-xt\right)d\left(\left(\dfrac{t^3}{3}-xt\right)\right)+C_1\int_0^\infty2te^{-t^2}\sin\left(\dfrac{t^3}{3}-xt\right)dt$

$=-C_1\int_0^\infty e^{-t^2}~d\left(\sin\left(\dfrac{t^3}{3}-xt\right)\right)+C_1\int_0^\infty2te^{-t^2}\sin\left(\dfrac{t^3}{3}-xt\right)dt$

$=-C_1\left[e^{-t^2}\sin\left(\dfrac{t^3}{3}-xt\right)\right]_0^\infty+C_1\int_0^\infty\sin\left(\dfrac{t^3}{3}-xt\right)d\left(e^{-t^2}\right)+C_1\int_0^\infty2te^{-t^2}\sin\left(\dfrac{t^3}{3}-xt\right)dt$

$=-C_1\int_0^\infty2te^{-t^2}\sin\left(\dfrac{t^3}{3}-xt\right)dt+C_1\int_0^\infty2te^{-t^2}\sin\left(\dfrac{t^3}{3}-xt\right)dt$

$=0$ , correct!

For $n=2$, unfortunately, no such combinations of $a_n$ , $b_n$ , $p_n$ and $q_n$ can satisfy the above conditions.

So we apply another type of choice:

$v_n=C_n\biggl(k_1\int_{a_{n,1}}^{b_{n,1}}e^{\frac{(p_{n,1}^2-3q_{n,1}^2)p_{n,1}t^3}{3}+(p_{n,1}^2-q_{n,1}^2)t^2+p_{n,1}xt}e^{\Bigl(\frac{(3p_{n,1}^2-q_{n,1}^2)q_{n,1}t^3}{3}+2p_{n,1}q_{n,1}t^2+q_{n,1}xt\Bigr)i}~dt+k_2\int_{a_{n,2}}^{b_{n,2}}e^{\frac{(p_{n,2}^2-3q_{n,2}^2)p_{n,2}t^3}{3}+(p_{n,2}^2-q_{n,2}^2)t^2+p_{n,2}xt}e^{\Bigl(\frac{(3p_{n,2}^2-q_{n,2}^2)q_{n,2}t^3}{3}+2p_{n,2}q_{n,2}t^2+q_{n,2}xt\Bigr)i}~dt\biggr)$

For some $x$-independent constant choices of $k_1$ and $k_2$ and real number choices of $a_{n,1}$ , $b_{n,1}$ , $p_{n,1}$ , $q_{n,1}$ , $a_{n,2}$ , $b_{n,2}$ , $p_{n,2}$ and $q_{n,2}$ such that:

$\lim\limits_{t\to a_{n,1}}e^{\frac{(p_{n,1}^2-3q_{n,1}^2)p_{n,1}t^3}{3}+(p_{n,1}^2-q_{n,1}^2)t^2+p_{n,1}xt}e^{\Bigl(\frac{(3p_{n,1}^2-q_{n,1}^2)q_{n,1}t^3}{3}+2p_{n,1}q_{n,1}t^2+q_{n,1}xt\Bigr)i}$ is $x$-independent

$\lim\limits_{t\to b_{n,1}}e^{\frac{(p_{n,1}^2-3q_{n,1}^2)p_{n,1}t^3}{3}+(p_{n,1}^2-q_{n,1}^2)t^2+p_{n,1}xt}e^{\Bigl(\frac{(3p_{n,1}^2-q_{n,1}^2)q_{n,1}t^3}{3}+2p_{n,1}q_{n,1}t^2+q_{n,1}xt\Bigr)i}$ is $x$-independent

$\int_{a_{n,1}}^{b_{n,1}}e^{\frac{(p_{n,1}^2-3q_{n,1}^2)p_{n,1}t^3}{3}+(p_{n,1}^2-q_{n,1}^2)t^2+p_{n,1}xt}e^{\Bigl(\frac{(3p_{n,1}^2-q_{n,1}^2)q_{n,1}t^3}{3}+2p_{n,1}q_{n,1}t^2+q_{n,1}xt\Bigr)i}~dt$ converges

$\lim\limits_{t\to a_{n,2}}e^{\frac{(p_{n,2}^2-3q_{n,2}^2)p_{n,2}t^3}{3}+(p_{n,2}^2-q_{n,2}^2)t^2+p_{n,2}xt}e^{\Bigl(\frac{(3p_{n,2}^2-q_{n,2}^2)q_{n,2}t^3}{3}+2p_{n,2}q_{n,2}t^2+q_{n,2}xt\Bigr)i}$ is $x$-independent

$\lim\limits_{t\to b_{n,2}}e^{\frac{(p_{n,2}^2-3q_{n,2}^2)p_{n,2}t^3}{3}+(p_{n,2}^2-q_{n,2}^2)t^2+p_{n,2}xt}e^{\Bigl(\frac{(3p_{n,2}^2-q_{n,2}^2)q_{n,2}t^3}{3}+2p_{n,2}q_{n,2}t^2+q_{n,2}xt\Bigr)i}$ is $x$-independent

$\int_{a_{n,2}}^{b_{n,2}}e^{\frac{(p_{n,2}^2-3q_{n,2}^2)p_{n,2}t^3}{3}+(p_{n,2}^2-q_{n,2}^2)t^2+p_{n,2}xt}e^{\Bigl(\frac{(3p_{n,2}^2-q_{n,2}^2)q_{n,2}t^3}{3}+2p_{n,2}q_{n,2}t^2+q_{n,2}xt\Bigr)i}~dt$ converges

For $n=2$, the best choice is $a_{2,1}=0$ , $b_{2,1}=\infty$ , $p_{2,1}=-1$ , $q_{2,1}=0$ , $a_{2,2}=0$ , $b_{2,2}=\infty$ , $p_{2,2}=0$ , $q_{2,2}=-1$

$\therefore v_2=C_2\biggl(k_1\int_0^\infty e^{-\frac{t^3}{3}+t^2-xt}~dt+k_2\int_0^\infty e^{-t^2}e^{\left(\frac{t^3}{3}-xt\right)i}~dt\biggr)$

$=C_2\int_0^\infty\biggl(k_1e^{-\frac{t^3}{3}+t^2-xt}+k_2e^{-t^2}\cos\biggl(\dfrac{t^3}{3}-xt\biggr)+k_2ie^{-t^2}\sin\biggl(\dfrac{t^3}{3}-xt\biggr)\biggr)dt$

$\because\left(\int_0^\infty e^{-\frac{t^3}{3}+t^2-xt}~dt\right)''+2\left(\int_0^\infty e^{-\frac{t^3}{3}+t^2-xt}~dt\right)'+x\int_0^\infty e^{-\frac{t^3}{3}+t^2-xt}~dt$

$=\int_0^\infty t^2e^{-\frac{t^3}{3}+t^2-xt}~dt-2\int_0^\infty te^{-\frac{t^3}{3}+t^2-xt}~dt+\int_0^\infty xe^{-\frac{t^3}{3}+t^2-xt}~dt$

$=\int_0^\infty(t^2-2t+x)e^{-\frac{t^3}{3}+t^2-xt}~dt$

$=-\int_0^\infty e^{-\frac{t^3}{3}+t^2-xt}~d\biggl(-\dfrac{t^3}{3}+t^2-xt\biggr)$

$=-\left[e^{-\frac{t^3}{3}+t^2-xt}\right]_0^\infty$

$=1$

$\because\left(\int_0^\infty e^{-t^2}\sin\left(\dfrac{t^3}{3}-xt\right)dt\right)''+2\left(\int_0^\infty e^{-t^2}\sin\left(\dfrac{t^3}{3}-xt\right)dt\right)'+x\int_0^\infty e^{-t^2}\sin\left(\dfrac{t^3}{3}-xt\right)dt$

$=-\int_0^\infty t^2e^{-t^2}\sin\left(\dfrac{t^3}{3}-xt\right)dt-2\int_0^\infty te^{-t^2}\cos\left(\dfrac{t^3}{3}-xt\right)dt+\int_0^\infty xe^{-t^2}\sin\left(\dfrac{t^3}{3}-xt\right)dt$

$=-\int_0^\infty(t^2-x)e^{-t^2}\sin\left(\dfrac{t^3}{3}-xt\right)dt-\int_0^\infty2te^{-t^2}\cos\left(\dfrac{t^3}{3}-xt\right)dt$

$=-\int_0^\infty e^{-t^2}\sin\left(\dfrac{t^3}{3}-xt\right)d\left(\left(\dfrac{t^3}{3}-xt\right)\right)-\int_0^\infty2te^{-t^2}\cos\left(\dfrac{t^3}{3}-xt\right)dt$

$=\int_0^\infty e^{-t^2}~d\left(\cos\left(\dfrac{t^3}{3}-xt\right)\right)-\int_0^\infty2te^{-t^2}\cos\left(\dfrac{t^3}{3}-xt\right)dt$

$=\left[e^{-t^2}\cos\left(\dfrac{t^3}{3}-xt\right)\right]_0^\infty-\int_0^\infty\cos\left(\dfrac{t^3}{3}-xt\right)d\left(e^{-t^2}\right)-\int_0^\infty2te^{-t^2}\cos\left(\dfrac{t^3}{3}-xt\right)dt$

$=-1+\int_0^\infty2te^{-t^2}\cos\left(\dfrac{t^3}{3}-xt\right)dt-\int_0^\infty2te^{-t^2}\cos\left(\dfrac{t^3}{3}-xt\right)dt$

$=-1$

$\therefore$ choose $k_1=1$ and $k_2=-i$

Hence $v_2=C_2\int_0^\infty\biggl(e^{-\frac{t^3}{3}+t^2-xt}-ie^{-t^2}\cos\biggl(\dfrac{t^3}{3}-xt\biggr)+e^{-t^2}\sin\biggl(\dfrac{t^3}{3}-xt\biggr)\biggr)dt$

Hence $v=C_1\int_0^\infty e^{-t^2}\cos\biggl(\dfrac{t^3}{3}-xt\biggr)dt+C_2\int_0^\infty\biggl(e^{-\frac{t^3}{3}+t^2-xt}-ie^{-t^2}\cos\biggl(\dfrac{t^3}{3}-xt\biggr)+e^{-t^2}\sin\biggl(\dfrac{t^3}{3}-xt\biggr)\biggr)dt=C_1\int_0^\infty e^{-t^2}\cos\biggl(\dfrac{t^3}{3}-xt\biggr)dt+C_2\int_0^\infty\biggl(e^{-\frac{t^3}{3}+t^2-xt}+e^{-t^2}\sin\biggl(\dfrac{t^3}{3}-xt\biggr)\biggr)dt$

$\therefore y=\dfrac{C_1\int_0^\infty e^{-t^2}\cos\biggl(\dfrac{t^3}{3}-xt\biggr)dt+C_2\int_0^\infty\biggl(e^{-\frac{t^3}{3}+t^2-xt}+e^{-t^2}\sin\biggl(\dfrac{t^3}{3}-xt\biggr)\biggr)dt}{\left(C_1\int_0^\infty e^{-t^2}\cos\biggl(\dfrac{t^3}{3}-xt\biggr)dt+C_2\int_0^\infty\biggl(e^{-\frac{t^3}{3}+t^2-xt}+e^{-t^2}\sin\biggl(\dfrac{t^3}{3}-xt\biggr)\biggr)dt\right)'}$

$y=\dfrac{C_1\int_0^\infty e^{-t^2}\cos\biggl(\dfrac{t^3}{3}-xt\biggr)dt+C_2\int_0^\infty\biggl(e^{-\frac{t^3}{3}+t^2-xt}+e^{-t^2}\sin\biggl(\dfrac{t^3}{3}-xt\biggr)\biggr)dt}{C_1\int_0^\infty te^{-t^2}\sin\biggl(\dfrac{t^3}{3}-xt\biggr)dt-C_2\int_0^\infty\biggl(te^{-\frac{t^3}{3}+t^2-xt}+te^{-t^2}\cos\biggl(\dfrac{t^3}{3}-xt\biggr)\biggr)dt}$

$y=\dfrac{\int_0^\infty e^{-t^2}\cos\biggl(\dfrac{t^3}{3}-xt\biggr)dt+\dfrac{C_2}{C_1}\int_0^\infty\biggl(e^{-\frac{t^3}{3}+t^2-xt}+e^{-t^2}\sin\biggl(\dfrac{t^3}{3}-xt\biggr)\biggr)dt}{\int_0^\infty te^{-t^2}\sin\biggl(\dfrac{t^3}{3}-xt\biggr)dt-\dfrac{C_2}{C_1}\int_0^\infty\biggl(te^{-\frac{t^3}{3}+t^2-xt}+te^{-t^2}\cos\biggl(\dfrac{t^3}{3}-xt\biggr)\biggr)dt}$

$y=\dfrac{\int_0^\infty e^{-t^2}\cos\biggl(\dfrac{t^3}{3}-xt\biggr)dt+C\int_0^\infty\biggl(e^{-\frac{t^3}{3}+t^2-xt}+e^{-t^2}\sin\biggl(\dfrac{t^3}{3}-xt\biggr)\biggr)dt}{\int_0^\infty te^{-t^2}\sin\biggl(\dfrac{t^3}{3}-xt\biggr)dt-C\int_0^\infty\biggl(te^{-\frac{t^3}{3}+t^2-xt}+te^{-t^2}\cos\biggl(\dfrac{t^3}{3}-xt\biggr)\biggr)dt}$


This link solve it . The General Solutions of Linear ODE and Riccati Equation http://arxiv.org/abs/1006.4804