2.4.17 Problem 38
Internal
problem
ID
[13317]
Book
:
Handbook
of
exact
solutions
for
ordinary
differential
equations.
By
Polyanin
and
Zaitsev.
Second
edition
Section
:
Chapter
1,
section
1.2.
Riccati
Equation.
subsection
1.2.3-2.
Equations
with
power
and
exponential
functions
Problem
number
:
38
Date
solved
:
Wednesday, December 31, 2025 at 01:17:36 PM
CAS
classification
:
[_Riccati]
2.4.17.1 Solved using first_order_ode_riccati
3.661 (sec)
Entering first order ode riccati solver
\begin{align*}
y^{\prime }&=a \,{\mathrm e}^{-\lambda \,x^{2}} y^{2}+\lambda x y+a \,b^{2} \\
\end{align*}
In canonical form the ODE is \begin{align*} y' &= F(x,y)\\ &= a \,{\mathrm e}^{-\lambda \,x^{2}} y^{2}+\lambda x y+a \,b^{2} \end{align*}
This is a Riccati ODE. Comparing the ODE to solve
\[
y' = \textit {the\_rhs}
\]
With Riccati ODE standard form \[ y' = f_0(x)+ f_1(x)y+f_2(x)y^{2} \]
Shows
that \(f_0(x)=a \,b^{2}\), \(f_1(x)=\lambda x\) and \(f_2(x)={\mathrm e}^{-\lambda \,x^{2}} a\). Let \begin{align*} y &= \frac {-u'}{f_2 u} \\ &= \frac {-u'}{u a \,{\mathrm e}^{-\lambda \,x^{2}}} \tag {1} \end{align*}
Using the above substitution in the given ODE results (after some simplification) in a second
order ODE to solve for \(u(x)\) which is
\begin{align*} f_2 u''(x) -\left ( f_2' + f_1 f_2 \right ) u'(x) + f_2^2 f_0 u(x) &= 0 \tag {2} \end{align*}
But
\begin{align*} f_2' &=-2 a \,{\mathrm e}^{-\lambda \,x^{2}} \lambda x\\ f_1 f_2 &=a \,{\mathrm e}^{-\lambda \,x^{2}} \lambda x\\ f_2^2 f_0 &=a^{3} {\mathrm e}^{-2 \lambda \,x^{2}} b^{2} \end{align*}
Substituting the above terms back in equation (2) gives
\[
a \,{\mathrm e}^{-\lambda \,x^{2}} u^{\prime \prime }\left (x \right )+a \,{\mathrm e}^{-\lambda \,x^{2}} \lambda x u^{\prime }\left (x \right )+a^{3} {\mathrm e}^{-2 \lambda \,x^{2}} b^{2} u \left (x \right ) = 0
\]
Entering second order change of variable
on \(x\) method 2 solverIn normal form the ode \begin{align*} a \,{\mathrm e}^{-\lambda \,x^{2}} \left (\frac {d^{2}u}{d x^{2}}\right )+a \,{\mathrm e}^{-\lambda \,x^{2}} \lambda x \left (\frac {d u}{d x}\right )+a^{3} {\mathrm e}^{-2 \lambda \,x^{2}} b^{2} u = 0\tag {1} \end{align*}
Becomes
\begin{align*} \frac {d^{2}u}{d x^{2}}+p \left (x \right ) \left (\frac {d u}{d x}\right )+q \left (x \right ) u&=0 \tag {2} \end{align*}
Where
\begin{align*} p \left (x \right )&=\lambda x\\ q \left (x \right )&={\mathrm e}^{-\lambda \,x^{2}} a^{2} b^{2} \end{align*}
Applying change of variables \(\tau = g \left (x \right )\) to (2) gives
\begin{align*} \frac {d^{2}}{d \tau ^{2}}u \left (\tau \right )+p_{1} \left (\frac {d}{d \tau }u \left (\tau \right )\right )+q_{1} u \left (\tau \right )&=0 \tag {3} \end{align*}
Where \(\tau \) is the new independent variable, and
\begin{align*} p_{1} \left (\tau \right ) &=\frac {\frac {d^{2}}{d x^{2}}\tau \left (x \right )+p \left (x \right ) \left (\frac {d}{d x}\tau \left (x \right )\right )}{\left (\frac {d}{d x}\tau \left (x \right )\right )^{2}}\tag {4} \\ q_{1} \left (\tau \right ) &=\frac {q \left (x \right )}{\left (\frac {d}{d x}\tau \left (x \right )\right )^{2}}\tag {5} \end{align*}
Let \(p_{1} = 0\). Eq (4) simplifies to
\begin{align*} \frac {d^{2}}{d x^{2}}\tau \left (x \right )+p \left (x \right ) \left (\frac {d}{d x}\tau \left (x \right )\right )&=0 \end{align*}
This ode is solved resulting in
\begin{align*} \tau &= \int {\mathrm e}^{-\int p \left (x \right )d x}d x\\ &= \int {\mathrm e}^{-\int \lambda x d x}d x\\ &= \int e^{-\frac {\lambda \,x^{2}}{2}} \,dx\\ &= \int {\mathrm e}^{-\frac {\lambda \,x^{2}}{2}}d x\\ &= \frac {\sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\tag {6} \end{align*}
Using (6) to evaluate \(q_{1}\) from (5) gives
\begin{align*} q_{1} \left (\tau \right ) &= \frac {q \left (x \right )}{\left (\frac {d}{d x}\tau \left (x \right )\right )^{2}}\\ &= \frac {{\mathrm e}^{-\lambda \,x^{2}} a^{2} b^{2}}{{\mathrm e}^{-\lambda \,x^{2}}}\\ &= a^{2} b^{2}\tag {7} \end{align*}
Substituting the above in (3) and noting that now \(p_{1} = 0\) results in
\begin{align*} \frac {d^{2}}{d \tau ^{2}}u \left (\tau \right )+q_{1} u \left (\tau \right )&=0 \\ \frac {d^{2}}{d \tau ^{2}}u \left (\tau \right )+a^{2} b^{2} u \left (\tau \right )&=0 \end{align*}
The above ode is now solved for \(u \left (\tau \right )\).Entering second order linear constant coefficient ode
solver
This is second order with constant coefficients homogeneous ODE. In standard form the
ODE is
\[ A u''(\tau ) + B u'(\tau ) + C u(\tau ) = 0 \]
Where in the above \(A=1, B=0, C=a^{2} b^{2}\). Let the solution be \(u \left (\tau \right )=e^{\lambda \tau }\). Substituting this into the ODE
gives \[ \lambda ^{2} {\mathrm e}^{\tau \lambda }+a^{2} b^{2} {\mathrm e}^{\tau \lambda } = 0 \tag {1} \]
Since exponential function is never zero, then dividing Eq(2) throughout by \(e^{\lambda \tau }\)
gives \[ a^{2} b^{2}+\lambda ^{2} = 0 \tag {2} \]
Equation (2) is the characteristic equation of the ODE. Its roots determine the
general solution form.Using the quadratic formula \[ \lambda _{1,2} = \frac {-B}{2 A} \pm \frac {1}{2 A} \sqrt {B^2 - 4 A C} \]
Substituting \(A=1, B=0, C=a^{2} b^{2}\) into the above gives
\begin{align*} \lambda _{1,2} &= \frac {0}{(2) \left (1\right )} \pm \frac {1}{(2) \left (1\right )} \sqrt {0^2 - (4) \left (1\right )\left (a^{2} b^{2}\right )}\\ &= \pm \sqrt {-a^{2} b^{2}} \end{align*}
Hence
\begin{align*} \lambda _1 &= + \sqrt {-a^{2} b^{2}}\\ \lambda _2 &= - \sqrt {-a^{2} b^{2}} \end{align*}
Which simplifies to
\begin{align*}
\lambda _1 &= i \sqrt {a^{2} b^{2}} \\
\lambda _2 &= -i \sqrt {a^{2} b^{2}} \\
\end{align*}
Since roots are complex conjugate of each others, then let the roots be \[
\lambda _{1,2} = \alpha \pm i \beta
\]
Where \(\alpha =0\) and \(\beta =\sqrt {a^{2} b^{2}}\). Therefore the final solution, when using Euler relation, can be written as \[
u \left (\tau \right ) = e^{\alpha \tau } \left ( c_1 \cos (\beta \tau ) + c_2 \sin (\beta \tau ) \right )
\]
Which becomes \[
u \left (\tau \right ) = e^{0}\left (c_1 \cos \left (\sqrt {a^{2} b^{2}}\, \tau \right )+c_2 \sin \left (\sqrt {a^{2} b^{2}}\, \tau \right )\right )
\]
Or \[
u \left (\tau \right ) = c_1 \cos \left (\sqrt {a^{2} b^{2}}\, \tau \right )+c_2 \sin \left (\sqrt {a^{2} b^{2}}\, \tau \right )
\]
The above solution is now transformed back to \(u\) using (6) which
results in \[
u = c_1 \cos \left (\frac {\sqrt {a^{2} b^{2}}\, \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\right )+c_2 \sin \left (\frac {\sqrt {a^{2} b^{2}}\, \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\right )
\]
Taking derivative gives \begin{equation}
\tag{4} u^{\prime }\left (x \right ) = -c_1 \sqrt {a^{2} b^{2}}\, {\mathrm e}^{-\frac {\lambda \,x^{2}}{2}} \sin \left (\frac {\sqrt {a^{2} b^{2}}\, \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\right )+c_2 \sqrt {a^{2} b^{2}}\, {\mathrm e}^{-\frac {\lambda \,x^{2}}{2}} \cos \left (\frac {\sqrt {a^{2} b^{2}}\, \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\right )
\end{equation}
Substituting equations (3,4) into (1) results in \begin{align*}
y &= \frac {-u'}{f_2 u} \\
y &= \frac {-u'}{u a \,{\mathrm e}^{-\lambda \,x^{2}}} \\
y &= -\frac {\left (-c_1 \sqrt {a^{2} b^{2}}\, {\mathrm e}^{-\frac {\lambda \,x^{2}}{2}} \sin \left (\frac {\sqrt {a^{2} b^{2}}\, \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\right )+c_2 \sqrt {a^{2} b^{2}}\, {\mathrm e}^{-\frac {\lambda \,x^{2}}{2}} \cos \left (\frac {\sqrt {a^{2} b^{2}}\, \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\right )\right ) {\mathrm e}^{\lambda \,x^{2}}}{a \left (c_1 \cos \left (\frac {\sqrt {a^{2} b^{2}}\, \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\right )+c_2 \sin \left (\frac {\sqrt {a^{2} b^{2}}\, \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\right )\right )} \\
\end{align*}
Doing change of constants, the above solution becomes \[
y = -\frac {\left (-\sqrt {a^{2} b^{2}}\, {\mathrm e}^{-\frac {\lambda \,x^{2}}{2}} \sin \left (\frac {\sqrt {a^{2} b^{2}}\, \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\right )+c_3 \sqrt {a^{2} b^{2}}\, {\mathrm e}^{-\frac {\lambda \,x^{2}}{2}} \cos \left (\frac {\sqrt {a^{2} b^{2}}\, \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\right )\right ) {\mathrm e}^{\lambda \,x^{2}}}{a \left (\cos \left (\frac {\sqrt {a^{2} b^{2}}\, \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\right )+c_3 \sin \left (\frac {\sqrt {a^{2} b^{2}}\, \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\right )\right )}
\]
Simplifying the above gives
\begin{align*}
y &= \frac {\sqrt {a^{2} b^{2}}\, {\mathrm e}^{\frac {\lambda \,x^{2}}{2}} \left (\sin \left (\frac {\sqrt {a^{2} b^{2}}\, \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\right )-c_3 \cos \left (\frac {\sqrt {a^{2} b^{2}}\, \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\right )\right )}{a \left (\cos \left (\frac {\sqrt {a^{2} b^{2}}\, \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\right )+c_3 \sin \left (\frac {\sqrt {a^{2} b^{2}}\, \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\right )\right )} \\
\end{align*}
Summary of solutions found
\begin{align*}
y &= \frac {\sqrt {a^{2} b^{2}}\, {\mathrm e}^{\frac {\lambda \,x^{2}}{2}} \left (\sin \left (\frac {\sqrt {a^{2} b^{2}}\, \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\right )-c_3 \cos \left (\frac {\sqrt {a^{2} b^{2}}\, \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\right )\right )}{a \left (\cos \left (\frac {\sqrt {a^{2} b^{2}}\, \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\right )+c_3 \sin \left (\frac {\sqrt {a^{2} b^{2}}\, \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )}{2 \sqrt {\lambda }}\right )\right )} \\
\end{align*}
2.4.17.2 ✓ Maple. Time used: 0.008 (sec). Leaf size: 45
ode:=diff(y(x),x) = a*exp(-lambda*x^2)*y(x)^2+lambda*y(x)*x+b^2*a;
dsolve(ode,y(x), singsol=all);
\[
y = \tan \left (\frac {b a \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, \sqrt {\lambda }\, x}{2}\right )-2 c_1 \sqrt {\lambda }}{2 \sqrt {\lambda }}\right ) b \,{\mathrm e}^{\frac {\lambda \,x^{2}}{2}}
\]
Maple trace
Methods for first order ODEs:
--- Trying classification methods ---
trying a quadrature
trying 1st order linear
trying Bernoulli
trying separable
trying inverse linear
trying homogeneous types:
trying Chini
<- Chini successful
Maple step by step
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \frac {d}{d x}y \left (x \right )=a \,{\mathrm e}^{-\lambda \,x^{2}} y \left (x \right )^{2}+\lambda x y \left (x \right )+a \,b^{2} \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & \frac {d}{d x}y \left (x \right ) \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & \frac {d}{d x}y \left (x \right )=a \,{\mathrm e}^{-\lambda \,x^{2}} y \left (x \right )^{2}+\lambda x y \left (x \right )+a \,b^{2} \end {array} \]
2.4.17.3 ✓ Mathematica. Time used: 0.939 (sec). Leaf size: 63
ode=D[y[x],x]==a*Exp[-\[Lambda]*x^2]*y[x]^2+\[Lambda]*x*y[x]+a*b^2;
ic={};
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
\begin{align*} y(x)&\to \sqrt {b^2} e^{\frac {\lambda x^2}{2}} \tan \left (\frac {\sqrt {\frac {\pi }{2}} a \sqrt {b^2} \text {erf}\left (\frac {\sqrt {\lambda } x}{\sqrt {2}}\right )}{\sqrt {\lambda }}+c_1\right ) \end{align*}
2.4.17.4 ✗ Sympy
from sympy import *
x = symbols("x")
a = symbols("a")
b = symbols("b")
lambda_ = symbols("lambda_")
y = Function("y")
ode = Eq(-a*b**2 - a*y(x)**2*exp(-lambda_*x**2) - lambda_*x*y(x) + Derivative(y(x), x),0)
ics = {}
dsolve(ode,func=y(x),ics=ics)
NotImplementedError : The given ODE -a*b**2 - a*y(x)**2*exp(-lambda_*x**2) - lambda_*x*y(x) + Derivative(y(x), x) cannot be solved by the lie group method