2.9.10 Problem 12

2.9.10.1 Solved using first_order_ode_riccati_by_guessing_particular_solution
2.9.10.2 Maple
2.9.10.3 Mathematica
2.9.10.4 Sympy

Internal problem ID [13376]
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-1. Equations with sine
Problem number : 12
Date solved : Wednesday, December 31, 2025 at 02:08:10 PM
CAS classification : [_Riccati]

2.9.10.1 Solved using first_order_ode_riccati_by_guessing_particular_solution

8.563 (sec)

Entering first order ode riccati guess solver

\begin{align*} \left (\sin \left (\lambda x \right ) a +b \right ) y^{\prime }&=y^{2}+c \sin \left (\mu x \right ) y-d^{2}+c d \sin \left (\mu 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) & =\frac {c d \sin \left (\mu x \right )}{\sin \left (\lambda x \right ) a +b}-\frac {d^{2}}{\sin \left (\lambda x \right ) a +b}\\ f_1(x) & =\frac {c \sin \left (\mu x \right )}{\sin \left (\lambda x \right ) a +b}\\ f_2(x) &=\frac {1}{\sin \left (\lambda x \right ) a +b} \end{align*}

Using trial and error, the following particular solution was found

\[ y_p = -d \]
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 = -d +\frac {{\mathrm e}^{\int \left (-\frac {2 d}{\sin \left (\lambda x \right ) a +b}+\frac {c \sin \left (\mu x \right )}{\sin \left (\lambda x \right ) a +b}\right )d x}}{c_1 -\int \frac {{\mathrm e}^{\int \left (-\frac {2 d}{\sin \left (\lambda x \right ) a +b}+\frac {c \sin \left (\mu x \right )}{\sin \left (\lambda x \right ) a +b}\right )d x}}{\sin \left (\lambda x \right ) a +b}d x} \]

Summary of solutions found

\begin{align*} y &= -d +\frac {{\mathrm e}^{\int \left (-\frac {2 d}{\sin \left (\lambda x \right ) a +b}+\frac {c \sin \left (\mu x \right )}{\sin \left (\lambda x \right ) a +b}\right )d x}}{c_1 -\int \frac {{\mathrm e}^{\int \left (-\frac {2 d}{\sin \left (\lambda x \right ) a +b}+\frac {c \sin \left (\mu x \right )}{\sin \left (\lambda x \right ) a +b}\right )d x}}{\sin \left (\lambda x \right ) a +b}d x} \\ \end{align*}
2.9.10.2 Maple. Time used: 0.010 (sec). Leaf size: 265
ode:=(sin(lambda*x)*a+b)*diff(y(x),x) = y(x)^2+c*sin(mu*x)*y(x)-d^2+c*d*sin(mu*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {-d \int \frac {{\mathrm e}^{\frac {c \int \frac {\sin \left (\mu x \right )}{a \sin \left (\lambda x \right )+b}d x \sqrt {-a^{2}+b^{2}}\, \lambda -4 d \arctan \left (\frac {b \tan \left (\frac {\lambda x}{2}\right )+a}{\sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \lambda }}}{a \sin \left (\lambda x \right )+b}d x +d c_1 -{\mathrm e}^{\frac {c \int \frac {\sin \left (\mu x \right )}{a \sin \left (\lambda x \right )+b}d x \sqrt {-a^{2}+b^{2}}\, \lambda -4 d \arctan \left (\frac {b \tan \left (\frac {\lambda x}{2}\right )+a}{\sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \lambda }}}{\int \frac {{\mathrm e}^{\frac {c \int \frac {\sin \left (\mu x \right )}{a \sin \left (\lambda x \right )+b}d x \sqrt {-a^{2}+b^{2}}\, \lambda -4 d \arctan \left (\frac {b \tan \left (\frac {\lambda x}{2}\right )+a}{\sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \lambda }}}{a \sin \left (\lambda x \right )+b}d x -c_1} \]

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 sub-methods: 
   <- Riccati particular case Kamke (b) successful
 

Maple step by step

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left (a \sin \left (\lambda x \right )+b \right ) \left (\frac {d}{d x}y \left (x \right )\right )=y \left (x \right )^{2}+c \sin \left (\mu x \right ) y \left (x \right )-d^{2}+c d \sin \left (\mu 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 )=\frac {y \left (x \right )^{2}+c \sin \left (\mu x \right ) y \left (x \right )-d^{2}+c d \sin \left (\mu x \right )}{a \sin \left (\lambda x \right )+b} \end {array} \]
2.9.10.3 Mathematica. Time used: 3.223 (sec). Leaf size: 289
ode=(a*Sin[\[Lambda]*x]+b)*D[y[x],x]==y[x]^2+c*Sin[\[Mu]*x]*y[x]-d^2+c*d*Sin[\[Mu]*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\int _1^x-\frac {\exp \left (-\int _1^{K[2]}\frac {2 d-c \sin (\mu K[1])}{b+a \sin (\lambda K[1])}dK[1]\right ) (-d+c \sin (\mu K[2])+y(x))}{c \mu (b+a \sin (\lambda K[2])) (d+y(x))}dK[2]+\int _1^{y(x)}\left (\frac {\exp \left (-\int _1^x\frac {2 d-c \sin (\mu K[1])}{b+a \sin (\lambda K[1])}dK[1]\right )}{c \mu (d+K[3])^2}-\int _1^x\left (\frac {\exp \left (-\int _1^{K[2]}\frac {2 d-c \sin (\mu K[1])}{b+a \sin (\lambda K[1])}dK[1]\right ) (-d+K[3]+c \sin (\mu K[2]))}{c \mu (d+K[3])^2 (b+a \sin (\lambda K[2]))}-\frac {\exp \left (-\int _1^{K[2]}\frac {2 d-c \sin (\mu K[1])}{b+a \sin (\lambda K[1])}dK[1]\right )}{c \mu (d+K[3]) (b+a \sin (\lambda K[2]))}\right )dK[2]\right )dK[3]=c_1,y(x)\right ] \]
2.9.10.4 Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
c = symbols("c") 
d = symbols("d") 
lambda_ = symbols("lambda_") 
mu = symbols("mu") 
y = Function("y") 
ode = Eq(-c*d*sin(mu*x) - c*y(x)*sin(mu*x) + d**2 + (a*sin(lambda_*x) + b)*Derivative(y(x), x) - y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out