2.13.9 Problem 58

2.13.9.1 Maple
2.13.9.2 Mathematica
2.13.9.3 Sympy

Internal problem ID [13417]
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.6-5. Equations containing combinations of trigonometric functions.
Problem number : 58
Date solved : Friday, December 19, 2025 at 04:05:53 AM
CAS classification : [_Riccati]

\begin{align*} y^{\prime }&=y^{2}-\frac {\lambda ^{2}}{2}-\frac {3 \tan \left (\lambda x \right )^{2} \lambda ^{2}}{4}+a \cos \left (\lambda x \right )^{2} \sin \left (\lambda x \right )^{n} \\ \end{align*}
Entering first order ode riccati solver
\begin{align*} y^{\prime }&=y^{2}-\frac {\lambda ^{2}}{2}-\frac {3 \tan \left (\lambda x \right )^{2} \lambda ^{2}}{4}+a \cos \left (\lambda x \right )^{2} \sin \left (\lambda x \right )^{n} \\ \end{align*}
In canonical form the ODE is
\begin{align*} y' &= F(x,y)\\ &= y^{2}-\frac {\lambda ^{2}}{2}-\frac {3 \tan \left (\lambda x \right )^{2} \lambda ^{2}}{4}+a \cos \left (\lambda x \right )^{2} \sin \left (\lambda x \right )^{n} \end{align*}

This is a Riccati ODE. Comparing the ODE to solve

\[ y' = y^{2}-\frac {\lambda ^{2}}{2}-\frac {3 \tan \left (\lambda x \right )^{2} \lambda ^{2}}{4}+a \cos \left (\lambda x \right )^{2} \sin \left (\lambda x \right )^{n} \]
With Riccati ODE standard form
\[ y' = f_0(x)+ f_1(x)y+f_2(x)y^{2} \]
Shows that \(f_0(x)=-\frac {\lambda ^{2}}{2}-\frac {3 \tan \left (\lambda x \right )^{2} \lambda ^{2}}{4}+a \cos \left (\lambda x \right )^{2} \sin \left (\lambda x \right )^{n}\), \(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 &=-\frac {\lambda ^{2}}{2}-\frac {3 \tan \left (\lambda x \right )^{2} \lambda ^{2}}{4}+a \cos \left (\lambda x \right )^{2} \sin \left (\lambda x \right )^{n} \end{align*}

Substituting the above terms back in equation (2) gives

\[ u^{\prime \prime }\left (x \right )+\left (-\frac {\lambda ^{2}}{2}-\frac {3 \tan \left (\lambda x \right )^{2} \lambda ^{2}}{4}+a \cos \left (\lambda x \right )^{2} \sin \left (\lambda x \right )^{n}\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 ) = \frac {c_1 \operatorname {hypergeom}\left (\left [\right ], \left [\frac {n +1}{n +2}\right ], -\frac {a \sin \left (\lambda x \right )^{n +2}}{\lambda ^{2} \left (n +2\right )^{2}}\right )}{\sqrt {\cos \left (\lambda x \right )}}+\frac {c_2 \sin \left (\lambda x \right ) \operatorname {hypergeom}\left (\left [\right ], \left [\frac {n +3}{n +2}\right ], -\frac {a \sin \left (\lambda x \right )^{n +2}}{\lambda ^{2} \left (n +2\right )^{2}}\right )}{\sqrt {\cos \left (\lambda x \right )}} \end{equation}
Taking derivative gives
\begin{equation} \tag{4} u^{\prime }\left (x \right ) = \frac {c_1 \operatorname {hypergeom}\left (\left [\right ], \left [\frac {n +1}{n +2}\right ], -\frac {a \sin \left (\lambda x \right )^{n +2}}{\lambda ^{2} \left (n +2\right )^{2}}\right ) \lambda \sin \left (\lambda x \right )}{2 \cos \left (\lambda x \right )^{{3}/{2}}}-\frac {c_1 \sqrt {\cos \left (\lambda x \right )}\, \operatorname {hypergeom}\left (\left [\right ], \left [\frac {n +1}{n +2}+1\right ], -\frac {a \sin \left (\lambda x \right )^{n +2}}{\lambda ^{2} \left (n +2\right )^{2}}\right ) a \sin \left (\lambda x \right )^{n +2}}{\left (n +1\right ) \lambda \sin \left (\lambda x \right )}+\frac {c_2 \sin \left (\lambda x \right )^{2} \operatorname {hypergeom}\left (\left [\right ], \left [\frac {n +3}{n +2}\right ], -\frac {a \sin \left (\lambda x \right )^{n +2}}{\lambda ^{2} \left (n +2\right )^{2}}\right ) \lambda }{2 \cos \left (\lambda x \right )^{{3}/{2}}}+c_2 \sqrt {\cos \left (\lambda x \right )}\, \lambda \operatorname {hypergeom}\left (\left [\right ], \left [\frac {n +3}{n +2}\right ], -\frac {a \sin \left (\lambda x \right )^{n +2}}{\lambda ^{2} \left (n +2\right )^{2}}\right )-\frac {c_2 \sqrt {\cos \left (\lambda x \right )}\, \operatorname {hypergeom}\left (\left [\right ], \left [\frac {n +3}{n +2}+1\right ], -\frac {a \sin \left (\lambda x \right )^{n +2}}{\lambda ^{2} \left (n +2\right )^{2}}\right ) a \sin \left (\lambda x \right )^{n +2}}{\left (n +3\right ) \lambda } \end{equation}
Substituting equations (3,4) into (1) results in
\begin{align*} y &= \frac {-u'}{f_2 u} \\ y &= \frac {-u'}{u} \\ y &= \text {Expression too large to display} \\ \end{align*}
Doing change of constants, the above solution becomes
\[ y = -\frac {\frac {\operatorname {hypergeom}\left (\left [\right ], \left [\frac {n +1}{n +2}\right ], -\frac {a \sin \left (\lambda x \right )^{n +2}}{\lambda ^{2} \left (n +2\right )^{2}}\right ) \lambda \sin \left (\lambda x \right )}{2 \cos \left (\lambda x \right )^{{3}/{2}}}-\frac {\sqrt {\cos \left (\lambda x \right )}\, \operatorname {hypergeom}\left (\left [\right ], \left [\frac {n +1}{n +2}+1\right ], -\frac {a \sin \left (\lambda x \right )^{n +2}}{\lambda ^{2} \left (n +2\right )^{2}}\right ) a \sin \left (\lambda x \right )^{n +2}}{\left (n +1\right ) \lambda \sin \left (\lambda x \right )}+\frac {c_3 \sin \left (\lambda x \right )^{2} \operatorname {hypergeom}\left (\left [\right ], \left [\frac {n +3}{n +2}\right ], -\frac {a \sin \left (\lambda x \right )^{n +2}}{\lambda ^{2} \left (n +2\right )^{2}}\right ) \lambda }{2 \cos \left (\lambda x \right )^{{3}/{2}}}+c_3 \sqrt {\cos \left (\lambda x \right )}\, \lambda \operatorname {hypergeom}\left (\left [\right ], \left [\frac {n +3}{n +2}\right ], -\frac {a \sin \left (\lambda x \right )^{n +2}}{\lambda ^{2} \left (n +2\right )^{2}}\right )-\frac {c_3 \sqrt {\cos \left (\lambda x \right )}\, \operatorname {hypergeom}\left (\left [\right ], \left [\frac {n +3}{n +2}+1\right ], -\frac {a \sin \left (\lambda x \right )^{n +2}}{\lambda ^{2} \left (n +2\right )^{2}}\right ) a \sin \left (\lambda x \right )^{n +2}}{\left (n +3\right ) \lambda }}{\frac {\operatorname {hypergeom}\left (\left [\right ], \left [\frac {n +1}{n +2}\right ], -\frac {a \sin \left (\lambda x \right )^{n +2}}{\lambda ^{2} \left (n +2\right )^{2}}\right )}{\sqrt {\cos \left (\lambda x \right )}}+\frac {c_3 \sin \left (\lambda x \right ) \operatorname {hypergeom}\left (\left [\right ], \left [\frac {n +3}{n +2}\right ], -\frac {a \sin \left (\lambda x \right )^{n +2}}{\lambda ^{2} \left (n +2\right )^{2}}\right )}{\sqrt {\cos \left (\lambda x \right )}}} \]
Simplifying the above gives
\begin{align*} \text {Expression too large to display} \\ \end{align*}
The solution
\[ \text {Expression too large to display} \]
was found not to satisfy the ode or the IC. Hence it is removed.
2.13.9.1 Maple. Time used: 0.005 (sec). Leaf size: 1300
ode:=diff(y(x),x) = y(x)^2-1/2*lambda^2-3/4*lambda^2*tan(lambda*x)^2+a*cos(lambda*x)^2*sin(lambda*x)^n; 
dsolve(ode,y(x), singsol=all);
 
\[ \text {Expression too large to display} \]

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) = (1/2*lambda^2+3/4* 
lambda^2*tan(lambda*x)^2-a*cos(lambda*x)^2*sin(lambda*x)^n)*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 symmetry of the form [xi=0, eta=F(x)] 
         checking if the LODE is missing y 
         -> Trying an equivalence, under non-integer power transformations, 
            to LODEs admitting Liouvillian solutions. 
            -> Trying a Liouvillian solution using Kovacics algorithm 
            <- No Liouvillian solutions exists 
         -> Trying a solution in terms of special functions: 
            -> Bessel 
            -> elliptic 
            -> Legendre 
            -> Whittaker 
               -> hyper3: Equivalence to 1F1 under a power @ Moebius 
               <- hyper3 successful: received ODE is equivalent to the 0F1 ODE 
            <- Whittaker successful 
         <- special function solution successful 
         Change of variables used: 
            [x = arccos(t)/lambda] 
         Linear ODE actually solved: 
            (4*a*(-t^2+1)^(1/2*n)*t^4+lambda^2*t^2-3*lambda^2)*u(t)-4*t^3*lambd\ 
a^2*diff(u(t),t)+(-4*lambda^2*t^4+4*lambda^2*t^2)*diff(diff(u(t),t),t) = 0 
      <- change of variables successful 
   <- Riccati to 2nd Order successful
 
2.13.9.2 Mathematica
ode=D[y[x],x]==y[x]^2-1/2*\[Lambda]^2-3/4*\[Lambda]^2*Tan[\[Lambda]*x]^2+a*Cos[\[Lambda]*x]^2*Sin[\[Lambda]*x]^n; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 

Not solved

2.13.9.3 Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
lambda_ = symbols("lambda_") 
n = symbols("n") 
y = Function("y") 
ode = Eq(-a*sin(lambda_*x)**n*cos(lambda_*x)**2 + 3*lambda_**2*tan(lambda_*x)**2/4 + lambda_**2/2 - y(x)**2 + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -a*sin(lambda_*x)**n*cos(lambda_*x)**2 + 3*lambda_**2*tan(lambda_*x)**2/4 + lambda_**2/2 - y(x)**2 + Derivative(y(x), x) cannot be solved by the lie group method