Solve $y'+2xy^2 = 1$

I've tried to test if the equation is exact or if it can be made exact. Nothing worked and then I understood that it's a non-linear equation. I've tried a lot to think of a substitution so that I can do separation of variables but that also didn't work. It's also not even a Bernoulli's equation.

This might be a simple problem for some but I can't get my head around it. Can I please get some hint? I'm not asking for a full solution so please don't close this question. I can't solve it and I need some help doing it on my own.

  • 1
    $\begingroup$ Look at this post math.stackexchange.com/q/3761357/399263 it is a Ricatti ODE reducible to Bessel ODE with probably ugly looking solutions... $\endgroup$
    – zwim
    Commented May 10, 2022 at 20:20
  • $\begingroup$ @Itachi: as zwim mentions, this very simple looking ODE has a ugly solution! See: wolframalpha.com/input?i=y%27+%2B+2+x+y%5E2+%3D+1 . A direction field plot will show why the analytic solution is not simple. $\endgroup$
    – Moo
    Commented May 10, 2022 at 20:22
  • 1
    $\begingroup$ Then I think there must be a mistake. This kind of method aren't even talked about in my class. It is indeed an ugly looking solution. Thank you @Moo $\endgroup$
    – Itachi
    Commented May 10, 2022 at 20:26
  • $\begingroup$ Why not to try a series solution ? $\endgroup$ Commented May 11, 2022 at 2:54

2 Answers 2


This is not a full solution, just some pointers which might help on the way towards a solution.

This is a Riccati equation which according to Wolfram Alpha has solutions in so called Airy and Bairy functions which are defined as solutions to the related family of differential equations.

$$\frac{d^2y}{dy^2} -xy = 0$$

These solutions can not be expressed in elementary functions, but are rather commonly expressed as trigonometric integrals $$Ai(x) = \frac 1 \pi \int_0^\infty \cos\left(\frac{t^3}3 +xt\right)dt$$

Moreover, we can easily see by ocular inspection that there can't be a polynomial solution to our question.

This is because the $y'$ shrinks in order, while $2xy^2$ grows (as compared to $y$).

If we slightly modify the differential equation to $$y' + y^2 = 1$$ This becomes a separable equation: $$\frac{y'}{(1+y)(1-y)} = 1$$ which we can integrate $$\int\frac{dy}{(1+y)(1-y)} = \int 1 dx$$

This gives us a hint that exponential functions shall be involved as the left hand sides gives us logarithms in $y$ (after some partial fraction decomposition).

How to handle the $2x$ factor, I don't know. Maybe we can do $\sqrt{2x}$ and a variable substitution of some kind.


To transform the original nonlinear differential equation into a linear one, we make the substitution $y=\varphi\frac{u'}{u}$, where $\varphi$ is a function to be determined. Thus, $$ y'+2x^2y=1 \implies \varphi'\frac{u'}{u}+\varphi\frac{u''}{u}+(2x\varphi^2-\varphi)\frac{(u')^2}{u^2}=1. \tag{1} $$ Choosing $\varphi(x)=\frac{1}{2x}$, we eliminate the nonlinear term $\frac{(u')^2}{u^2}$ from $(1)$, which then we can rewrite as $$ -\frac{1}{2x^2}\frac{u'}{u}+\frac{1}{2x}\frac{u''}{u}=1 \implies xu''-u'-2x^2u=0. \tag{2} $$ Although not obvious, Eq. $(2)$ is related to Airy equation, $$ z''-tz=0, \tag{3} $$ whose general solution is $z(t)=c_1\text{Ai}(t)+c_2\text{Bi}(t)$. Indeed, differentiating $(3)$ one obtains $$ z'''-tz'-z=0 \implies z'''-tz'-\frac{z''}{t}=0 \implies tz'''-z''-t^2z'=0. \tag{4} $$ One can transform Eq. (2) into Eq. (4) with the substitutions $u(x)=z'(t)$, $t=\sqrt[3]{2}x$. Therefore, the solution to Eq. $(2)$ is $$ u(t)=c_1\text{Ai}'(\sqrt[3]{2}x)+c_2\text{Bi}'(\sqrt[3]{2}x). \tag{5} $$ Plugging $(5)$ into $y=\varphi\frac{u'}{u}$, we finally obtain $$ y(x)=\frac{1}{2x}\frac{\sqrt[3]{2}[c_1\text{Ai}''(\sqrt[3]{2}x)+c_2\text{Bi}''(\sqrt[3]{2}x)]}{c_1\text{Ai}'(\sqrt[3]{2}x)+c_2\text{Bi}'(\sqrt[3]{2}x)}=2^{-1/3}\frac{c_1\text{Ai}(\sqrt[3]{2}x)+c_2\text{Bi}(\sqrt[3]{2}x)}{c_1\text{Ai}'(\sqrt[3]{2}x)+c_2\text{Bi}'(\sqrt[3]{2}x)}, \tag{6} $$ where we used $(3)$ to simplify the numerator of the last fraction.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .