60.1.21 problem 21

Internal problem ID [10035]
Book : Differential Gleichungen, E. Kamke, 3rd ed. Chelsea Pub. NY, 1948
Section : Chapter 1, linear first order
Problem number : 21
Date solved : Sunday, March 30, 2025 at 02:54:28 PM
CAS classification : [_Riccati]

\begin{align*} y^{\prime }-y^{2}+y \sin \left (x \right )-\cos \left (x \right )&=0 \end{align*}

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