55.10.4 problem 17

Internal problem ID [13411]
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-2. Equations with cosine.
Problem number : 17
Date solved : Wednesday, October 01, 2025 at 10:54:43 AM
CAS classification : [_Riccati]

\begin{align*} y^{\prime }&=y^{2}+a \cos \left (\beta x \right ) y+a b \cos \left (\beta x \right )-b^{2} \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 73
ode:=diff(y(x),x) = y(x)^2+a*cos(beta*x)*y(x)+a*b*cos(beta*x)-b^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {b \int {\mathrm e}^{\frac {-2 \beta b x +a \sin \left (\beta x \right )}{\beta }}d x -b c_1 +{\mathrm e}^{\frac {-2 \beta b x +a \sin \left (\beta x \right )}{\beta }}}{-\int {\mathrm e}^{\frac {-2 \beta b x +a \sin \left (\beta x \right )}{\beta }}d x +c_1} \]
Mathematica. Time used: 1.997 (sec). Leaf size: 208
ode=D[y[x],x]==y[x]^2+a*Cos[\[Beta]*x]*y[x]+a*b*Cos[\[Beta]*x]-b^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\int _1^x\frac {\exp \left (-\int _1^{K[2]}(2 b-a \cos (\beta K[1]))dK[1]\right ) (-b+a \cos (\beta K[2])+y(x))}{a \beta (b+y(x))}dK[2]+\int _1^{y(x)}\left (-\int _1^x\left (\frac {\exp \left (-\int _1^{K[2]}(2 b-a \cos (\beta K[1]))dK[1]\right )}{a \beta (b+K[3])}-\frac {\exp \left (-\int _1^{K[2]}(2 b-a \cos (\beta K[1]))dK[1]\right ) (-b+a \cos (\beta K[2])+K[3])}{a \beta (b+K[3])^2}\right )dK[2]-\frac {\exp \left (-\int _1^x(2 b-a \cos (\beta K[1]))dK[1]\right )}{a \beta (b+K[3])^2}\right )dK[3]=c_1,y(x)\right ] \]
Sympy
from sympy import * 
x = symbols("x") 
BETA = symbols("BETA") 
a = symbols("a") 
b = symbols("b") 
y = Function("y") 
ode = Eq(-a*b*cos(BETA*x) - a*y(x)*cos(BETA*x) + b**2 - y(x)**2 + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -a*b*cos(BETA*x) - a*y(x)*cos(BETA*x) + b**2 - y(x)**2 + Derivative(y(x), x) cannot be solved by the lie group method