2.19.15 Problem 15
Internal
problem
ID
[13463]
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.8-1.
Equations
containing
arbitrary
functions
(but
not
containing
their
derivatives).
Problem
number
:
15
Date
solved
:
Wednesday, December 31, 2025 at 09:42:22 PM
CAS
classification
:
[_Riccati]
2.19.15.1 Solved using first_order_ode_riccati
4.326 (sec)
Entering first order ode riccati solver
\begin{align*}
y^{\prime }&=f \left (x \right ) y^{2}+\lambda y+a^{2} {\mathrm e}^{2 \lambda x} f \left (x \right ) \\
\end{align*}
In canonical form the ODE is \begin{align*} y' &= F(x,y)\\ &= f \left (x \right ) y^{2}+\lambda y+a^{2} {\mathrm e}^{2 \lambda x} f \left (x \right ) \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^{2} {\mathrm e}^{2 \lambda x} f \left (x \right )\), \(f_1(x)=\lambda \) and \(f_2(x)=f \left (x \right )\). Let \begin{align*} y &= \frac {-u'}{f_2 u} \\ &= \frac {-u'}{u f \left (x \right )} \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' &=f^{\prime }\left (x \right )\\ f_1 f_2 &=\lambda f \left (x \right )\\ f_2^2 f_0 &={\mathrm e}^{2 \lambda x} f \left (x \right )^{3} a^{2} \end{align*}
Substituting the above terms back in equation (2) gives
\[
f \left (x \right ) u^{\prime \prime }\left (x \right )-\left (\lambda f \left (x \right )+f^{\prime }\left (x \right )\right ) u^{\prime }\left (x \right )+f \left (x \right )^{3} {\mathrm e}^{2 \lambda x} a^{2} u \left (x \right ) = 0
\]
Entering second order change of variable
on \(x\) method 2 solverIn normal form the ode \begin{align*} f \left (x \right ) \left (\frac {d^{2}u}{d x^{2}}\right )-\left (\lambda f \left (x \right )+\frac {d}{d x}f \left (x \right )\right ) \left (\frac {d u}{d x}\right )+f \left (x \right )^{3} {\mathrm e}^{2 \lambda x} a^{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 )&=\frac {-\lambda f \left (x \right )-\frac {d}{d x}f \left (x \right )}{f \left (x \right )}\\ q \left (x \right )&=a^{2} f \left (x \right )^{2} {\mathrm e}^{2 \lambda x} \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 \frac {-\lambda f \left (x \right )-\frac {d}{d x}f \left (x \right )}{f \left (x \right )}d x}d x\\ &= \int e^{\lambda x +\ln \left (f \left (x \right )\right )} \,dx\\ &= \int f \left (x \right ) {\mathrm e}^{\lambda x}d x\\ &= \int f \left (x \right ) {\mathrm e}^{\lambda x}d x\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 {a^{2} f \left (x \right )^{2} {\mathrm e}^{2 \lambda x}}{f \left (x \right )^{2} {\mathrm e}^{2 \lambda x}}\\ &= a^{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} 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}\). 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} {\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}+\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}\) 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}\right )}\\ &= \pm \sqrt {-a^{2}} \end{align*}
Hence
\begin{align*} \lambda _1 &= + \sqrt {-a^{2}}\\ \lambda _2 &= - \sqrt {-a^{2}} \end{align*}
Which simplifies to
\begin{align*}
\lambda _1 &= i \sqrt {a^{2}} \\
\lambda _2 &= -i \sqrt {a^{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}}\). 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}}\, \tau \right )+c_2 \sin \left (\sqrt {a^{2}}\, \tau \right )\right )
\]
Or \[
u \left (\tau \right ) = c_1 \cos \left (\sqrt {a^{2}}\, \tau \right )+c_2 \sin \left (\sqrt {a^{2}}\, \tau \right )
\]
The above solution is now transformed back to \(u\) using (6) which results in \[
u = c_1 \cos \left (\sqrt {a^{2}}\, \int f \left (x \right ) {\mathrm e}^{\lambda x}d x \right )+c_2 \sin \left (\sqrt {a^{2}}\, \int f \left (x \right ) {\mathrm e}^{\lambda x}d x \right )
\]
Taking
derivative gives \begin{equation}
\tag{4} u^{\prime }\left (x \right ) = -c_1 \sqrt {a^{2}}\, f \left (x \right ) {\mathrm e}^{\lambda x} \sin \left (\sqrt {a^{2}}\, \int f \left (x \right ) {\mathrm e}^{\lambda x}d x \right )+c_2 \sqrt {a^{2}}\, f \left (x \right ) {\mathrm e}^{\lambda x} \cos \left (\sqrt {a^{2}}\, \int f \left (x \right ) {\mathrm e}^{\lambda x}d x \right )
\end{equation}
Substituting equations (3,4) into (1) results in \begin{align*}
y &= \frac {-u'}{f_2 u} \\
y &= \frac {-u'}{u f \left (x \right )} \\
y &= -\frac {-c_1 \sqrt {a^{2}}\, f \left (x \right ) {\mathrm e}^{\lambda x} \sin \left (\sqrt {a^{2}}\, \int f \left (x \right ) {\mathrm e}^{\lambda x}d x \right )+c_2 \sqrt {a^{2}}\, f \left (x \right ) {\mathrm e}^{\lambda x} \cos \left (\sqrt {a^{2}}\, \int f \left (x \right ) {\mathrm e}^{\lambda x}d x \right )}{f \left (x \right ) \left (c_1 \cos \left (\sqrt {a^{2}}\, \int f \left (x \right ) {\mathrm e}^{\lambda x}d x \right )+c_2 \sin \left (\sqrt {a^{2}}\, \int f \left (x \right ) {\mathrm e}^{\lambda x}d x \right )\right )} \\
\end{align*}
Doing change of constants, the
above solution becomes \[
y = -\frac {-\sqrt {a^{2}}\, f \left (x \right ) {\mathrm e}^{\lambda x} \sin \left (\sqrt {a^{2}}\, \int f \left (x \right ) {\mathrm e}^{\lambda x}d x \right )+c_3 \sqrt {a^{2}}\, f \left (x \right ) {\mathrm e}^{\lambda x} \cos \left (\sqrt {a^{2}}\, \int f \left (x \right ) {\mathrm e}^{\lambda x}d x \right )}{f \left (x \right ) \left (\cos \left (\sqrt {a^{2}}\, \int f \left (x \right ) {\mathrm e}^{\lambda x}d x \right )+c_3 \sin \left (\sqrt {a^{2}}\, \int f \left (x \right ) {\mathrm e}^{\lambda x}d x \right )\right )}
\]
Summary of solutions found
\begin{align*}
y &= -\frac {-\sqrt {a^{2}}\, f \left (x \right ) {\mathrm e}^{\lambda x} \sin \left (\sqrt {a^{2}}\, \int f \left (x \right ) {\mathrm e}^{\lambda x}d x \right )+c_3 \sqrt {a^{2}}\, f \left (x \right ) {\mathrm e}^{\lambda x} \cos \left (\sqrt {a^{2}}\, \int f \left (x \right ) {\mathrm e}^{\lambda x}d x \right )}{f \left (x \right ) \left (\cos \left (\sqrt {a^{2}}\, \int f \left (x \right ) {\mathrm e}^{\lambda x}d x \right )+c_3 \sin \left (\sqrt {a^{2}}\, \int f \left (x \right ) {\mathrm e}^{\lambda x}d x \right )\right )} \\
\end{align*}
2.19.15.2 Solved using first_order_ode_riccati_by_guessing_particular_solution
0.210 (sec)
Entering first order ode riccati guess solver
\begin{align*}
y^{\prime }&=f \left (x \right ) y^{2}+\lambda y+a^{2} {\mathrm e}^{2 \lambda x} f \left (x \right ) \\
\end{align*}
This is a Riccati ODE. Comparing the above ODE to
solve with the Riccati standard form \[ y' = f_0(x)+ f_1(x)y+f_2(x)y^{2} \]
Shows that \begin{align*} f_0(x) & =a^{2} {\mathrm e}^{2 \lambda x} f \left (x \right )\\ f_1(x) & =\lambda \\ f_2(x) &=f \left (x \right ) \end{align*}
Using trial and error, the following particular solution was found
\[
y_p = i a \,{\mathrm e}^{\lambda x}
\]
Since a particular solution is
known, then the general solution is given by \begin{align*} y &= y_p + \frac { \phi (x) }{ c_1 - \int { \phi (x) f_2 \,dx} } \end{align*}
Where
\begin{align*} \phi (x) &= e^{ \int 2 f_2 y_p + f_1 \,dx } \end{align*}
Evaluating the above gives the general solution as
\[
y = i a \,{\mathrm e}^{\lambda x}+\frac {{\mathrm e}^{\int \left (2 i a f \left (x \right ) {\mathrm e}^{\lambda x}+\lambda \right )d x}}{c_1 -\int {\mathrm e}^{\int \left (2 i a f \left (x \right ) {\mathrm e}^{\lambda x}+\lambda \right )d x} f \left (x \right )d x}
\]
Summary of solutions found
\begin{align*}
y &= i a \,{\mathrm e}^{\lambda x}+\frac {{\mathrm e}^{\int \left (2 i a f \left (x \right ) {\mathrm e}^{\lambda x}+\lambda \right )d x}}{c_1 -\int {\mathrm e}^{\int \left (2 i a f \left (x \right ) {\mathrm e}^{\lambda x}+\lambda \right )d x} f \left (x \right )d x} \\
\end{align*}
2.19.15.3 ✓ Maple. Time used: 0.018 (sec). Leaf size: 26
ode:=diff(y(x),x) = f(x)*y(x)^2+lambda*y(x)+a^2*exp(2*lambda*x)*f(x);
dsolve(ode,y(x), singsol=all);
\[
y = -\tan \left (-a \int f \left (x \right ) {\mathrm e}^{\lambda x}d x +c_1 \right ) a \,{\mathrm e}^{\lambda x}
\]
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 )=f \left (x \right ) y \left (x \right )^{2}+\lambda y \left (x \right )+a^{2} {\mathrm e}^{2 \lambda x} f \left (x \right ) \\ \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 )=f \left (x \right ) y \left (x \right )^{2}+\lambda y \left (x \right )+a^{2} {\mathrm e}^{2 \lambda x} f \left (x \right ) \end {array} \]
2.19.15.4 ✓ Mathematica. Time used: 0.234 (sec). Leaf size: 47
ode=D[y[x],x]==f[x]*y[x]^2+\[Lambda]*y[x]+a^2*Exp[2*\[Lambda]*x]*f[x];
ic={};
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
\begin{align*} y(x)&\to \sqrt {a^2} e^{\lambda x} \tan \left (\sqrt {a^2} \int _1^xe^{\lambda K[1]} f(K[1])dK[1]+c_1\right ) \end{align*}
2.19.15.5 ✗ Sympy
from sympy import *
x = symbols("x")
a = symbols("a")
lambda_ = symbols("lambda_")
y = Function("y")
f = Function("f")
ode = Eq(-a**2*f(x)*exp(2*lambda_*x) - lambda_*y(x) - f(x)*y(x)**2 + Derivative(y(x), x),0)
ics = {}
dsolve(ode,func=y(x),ics=ics)
NotImplementedError : The given ODE -a**2*f(x)*exp(2*lambda_*x) - lambda_*y(x) - f(x)*y(x)**2 + Derivative(y(x), x) cannot be solved by the lie group method