2.6.5 Problem 22
Internal
problem
ID
[13340]
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.4-2.
Equations
with
hyperbolic
tangent
and
cotangent.
Problem
number
:
22
Date
solved
:
Friday, December 19, 2025 at 03:10:26 AM
CAS
classification
:
[_Riccati]
\begin{align*}
y^{\prime }&=y^{2}+a \lambda -a \left (a +\lambda \right ) \coth \left (\lambda x \right )^{2} \\
\end{align*}
Entering first order ode riccati solver\begin{align*}
y^{\prime }&=y^{2}+a \lambda -a \left (a +\lambda \right ) \coth \left (\lambda x \right )^{2} \\
\end{align*}
In canonical form the ODE is \begin{align*} y' &= F(x,y)\\ &= -a^{2} \coth \left (\lambda x \right )^{2}-a \coth \left (\lambda x \right )^{2} \lambda +a \lambda +y^{2} \end{align*}
This is a Riccati ODE. Comparing the ODE to solve
\[
y' = -a^{2} \coth \left (\lambda x \right )^{2}-a \coth \left (\lambda x \right )^{2} \lambda +a \lambda +y^{2}
\]
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} \coth \left (\lambda x \right )^{2}-a \coth \left (\lambda x \right )^{2} \lambda +a \lambda \), \(f_1(x)=0\) and \(f_2(x)=1\). Let \begin{align*} y &= \frac {-u'}{f_2 u} \\ &= \frac {-u'}{u} \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' &=0\\ f_1 f_2 &=0\\ f_2^2 f_0 &=-a^{2} \coth \left (\lambda x \right )^{2}-a \coth \left (\lambda x \right )^{2} \lambda +a \lambda \end{align*}
Substituting the above terms back in equation (2) gives
\[
u^{\prime \prime }\left (x \right )+\left (-a^{2} \coth \left (\lambda x \right )^{2}-a \coth \left (\lambda x \right )^{2} \lambda +a \lambda \right ) u \left (x \right ) = 0
\]
Unable to solve. Will ask Maple to solve
this ode now.
The solution for \(u \left (x \right )\) is
\begin{equation}
\tag{3} u \left (x \right ) = c_1 \operatorname {LegendreP}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )+c_2 \operatorname {LegendreQ}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )
\end{equation}
Taking derivative gives \begin{equation}
\tag{4} u^{\prime }\left (x \right ) = \frac {c_1 \left (\operatorname {LegendreP}\left (1+\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )-\left (1+\frac {a}{\lambda }\right ) \coth \left (\lambda x \right ) \operatorname {LegendreP}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )\right ) \lambda \left (1-\coth \left (\lambda x \right )^{2}\right )}{\coth \left (\lambda x \right )^{2}-1}+\frac {c_2 \left (\operatorname {LegendreQ}\left (1+\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )-\left (1+\frac {a}{\lambda }\right ) \coth \left (\lambda x \right ) \operatorname {LegendreQ}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )\right ) \lambda \left (1-\coth \left (\lambda x \right )^{2}\right )}{\coth \left (\lambda x \right )^{2}-1}
\end{equation}
Substituting equations (3,4) into (1) results in \begin{align*}
y &= \frac {-u'}{f_2 u} \\
y &= \frac {-u'}{u} \\
y &= \frac {\operatorname {LegendreP}\left (\frac {a +\lambda }{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right ) c_1 \lambda +\operatorname {LegendreQ}\left (\frac {a +\lambda }{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right ) c_2 \lambda -\coth \left (\lambda x \right ) \left (c_1 \operatorname {LegendreP}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )+c_2 \operatorname {LegendreQ}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )\right ) \left (a +\lambda \right )}{c_1 \operatorname {LegendreP}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )+c_2 \operatorname {LegendreQ}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )} \\
\end{align*}
Doing
change of constants, the above solution becomes \[
y = -\frac {\frac {\left (\operatorname {LegendreP}\left (1+\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )-\left (1+\frac {a}{\lambda }\right ) \coth \left (\lambda x \right ) \operatorname {LegendreP}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )\right ) \lambda \left (1-\coth \left (\lambda x \right )^{2}\right )}{\coth \left (\lambda x \right )^{2}-1}+\frac {c_3 \left (\operatorname {LegendreQ}\left (1+\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )-\left (1+\frac {a}{\lambda }\right ) \coth \left (\lambda x \right ) \operatorname {LegendreQ}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )\right ) \lambda \left (1-\coth \left (\lambda x \right )^{2}\right )}{\coth \left (\lambda x \right )^{2}-1}}{\operatorname {LegendreP}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )+c_3 \operatorname {LegendreQ}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )}
\]
Simplifying the above gives \begin{align*}
y &= \frac {\operatorname {LegendreP}\left (\frac {a +\lambda }{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right ) \lambda +\operatorname {LegendreQ}\left (\frac {a +\lambda }{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right ) c_3 \lambda -\coth \left (\lambda x \right ) \left (\operatorname {LegendreP}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )+c_3 \operatorname {LegendreQ}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )\right ) \left (a +\lambda \right )}{\operatorname {LegendreP}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )+c_3 \operatorname {LegendreQ}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )} \\
\end{align*}
The solution \[
y = \frac {\operatorname {LegendreP}\left (\frac {a +\lambda }{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right ) \lambda +\operatorname {LegendreQ}\left (\frac {a +\lambda }{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right ) c_3 \lambda -\coth \left (\lambda x \right ) \left (\operatorname {LegendreP}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )+c_3 \operatorname {LegendreQ}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )\right ) \left (a +\lambda \right )}{\operatorname {LegendreP}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )+c_3 \operatorname {LegendreQ}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )}
\]
was
found not to satisfy the ode or the IC. Hence it is removed.
2.6.5.1 ✓ Maple. Time used: 0.006 (sec). Leaf size: 122
ode:=diff(y(x),x) = y(x)^2+lambda*a-a*(a+lambda)*coth(lambda*x)^2;
dsolve(ode,y(x), singsol=all);
\[
y = \frac {-\left (a +\lambda \right ) \coth \left (\lambda x \right ) \left (c_1 \operatorname {LegendreQ}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )+\operatorname {LegendreP}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )\right )+c_1 \lambda \operatorname {LegendreQ}\left (\frac {a +\lambda }{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )+\operatorname {LegendreP}\left (\frac {a +\lambda }{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right ) \lambda }{c_1 \operatorname {LegendreQ}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )+\operatorname {LegendreP}\left (\frac {a}{\lambda }, \frac {a}{\lambda }, \coth \left (\lambda x \right )\right )}
\]
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
differential order: 1; looking for linear symmetries
trying exact
Looking for potential symmetries
trying Riccati
trying Riccati Special
trying Riccati sub-methods:
trying Riccati_symmetries
trying Riccati to 2nd Order
-> Calling odsolve with the ODE, diff(diff(y(x),x),x) = (a^2*coth(lambda*x)^
2+a*coth(lambda*x)^2*lambda-a*lambda)*y(x), y(x)
*** Sublevel 2 ***
Methods for second order ODEs:
--- Trying classification methods ---
trying a symmetry of the form [xi=0, eta=F(x)]
checking if the LODE is missing y
-> Heun: Equivalence to the GHE or one of its 4 confluent cases under a \
power @ Moebius
-> trying a solution of the form r0(x) * Y + r1(x) * Y where Y = exp(int\
(r(x), dx)) * 2F1([a1, a2], [b1], f)
-> Trying changes of variables to rationalize or make the ODE simpler
trying a quadrature
checking if the LODE has constant coefficients
checking if the LODE is of Euler type
trying a symmetry of the form [xi=0, eta=F(x)]
checking if the LODE is missing y
-> Trying a Liouvillian solution using Kovacics algorithm
A Liouvillian solution exists
Reducible group (found an exponential solution)
Group is reducible, not completely reducible
Solution has integrals. Trying a special function solution free of \
integrals...
-> Trying a solution in terms of special functions:
-> Bessel
-> elliptic
-> Legendre
<- Legendre successful
<- special function solution successful
-> Trying to convert hypergeometric functions to elementary form\
...
<- elementary form could result into a too large expression - re\
turning special function form of solution, free of uncomputed integrals
<- Kovacics algorithm successful
Change of variables used:
[x = arccoth(t)/lambda]
Linear ODE actually solved:
(-a^2*t^2-a*lambda*t^2+a*lambda)*u(t)+(2*lambda^2*t^3-2*lambda^2*t)\
*diff(u(t),t)+(lambda^2*t^4-2*lambda^2*t^2+lambda^2)*diff(diff(u(t),t),t) = 0
<- change of variables successful
<- Riccati to 2nd Order successful
Maple step by step
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \frac {d}{d x}y \left (x \right )=y \left (x \right )^{2}+a \lambda -a \left (a +\lambda \right ) \coth \left (\lambda x \right )^{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 )=y \left (x \right )^{2}+a \lambda -a \left (a +\lambda \right ) \coth \left (\lambda x \right )^{2} \end {array} \]
2.6.5.2 ✓ Mathematica. Time used: 3.395 (sec). Leaf size: 340
ode=D[y[x],x]==y[x]^2+a*\[Lambda]-a*(a+\[Lambda])*Coth[\[Lambda]*x]^2;
ic={};
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
\begin{align*} y(x)&\to \frac {a \int \frac {2 \lambda \left (e^{-2 \lambda x}+1\right )}{1-e^{2 \lambda x}} \, de^{2 \lambda x}}{2 \lambda }+\frac {2 \lambda \exp \left (\int _1^{e^{2 x \lambda }}\frac {K[1] a+a+\lambda -\lambda K[1]}{\lambda (K[1]-1) K[1]}dK[1]+2 \lambda x\right )-2 \lambda \exp \left (\int _1^{e^{2 x \lambda }}\frac {K[1] a+a+\lambda -\lambda K[1]}{\lambda (K[1]-1) K[1]}dK[1]+4 \lambda x\right )+a \left (e^{2 \lambda x}+1\right ) \int _1^{e^{2 x \lambda }}\exp \left (\int _1^{K[2]}\frac {K[1] a+a+\lambda -\lambda K[1]}{\lambda (K[1]-1) K[1]}dK[1]\right )dK[2]+a c_1 e^{2 \lambda x}+a c_1}{\left (e^{2 \lambda x}-1\right ) \left (\int _1^{e^{2 x \lambda }}\exp \left (\int _1^{K[2]}\frac {K[1] a+a+\lambda -\lambda K[1]}{\lambda (K[1]-1) K[1]}dK[1]\right )dK[2]+c_1\right )}\\ y(x)&\to \frac {a \left (e^{2 \lambda x}+1\right )}{e^{2 \lambda x}-1}+\frac {a \int \frac {2 \lambda \left (e^{-2 \lambda x}+1\right )}{1-e^{2 \lambda x}} \, de^{2 \lambda x}}{2 \lambda } \end{align*}
2.6.5.3 ✗ Sympy
from sympy import *
x = symbols("x")
a = symbols("a")
lambda_ = symbols("lambda_")
y = Function("y")
ode = Eq(-a*lambda_ + a*(a + lambda_)/tanh(lambda_*x)**2 - y(x)**2 + Derivative(y(x), x),0)
ics = {}
dsolve(ode,func=y(x),ics=ics)
NotImplementedError : The given ODE a**2 + a**2/sinh(lambda_*x)**2 + a*lambda_/sinh(lambda_*x)**2 -
Python version: 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0]
Sympy version 1.14.0
classify_ode(ode,func=y(x))
('factorable', 'lie_group')