29.2.23 problem 48

Internal problem ID [4656]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 2
Problem number : 48
Date solved : Sunday, March 30, 2025 at 03:32:44 AM
CAS classification : [_Riccati]

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

Maple. Time used: 0.003 (sec). Leaf size: 25
ode:=diff(y(x),x) = cos(x)-(sin(x)-y(x))*y(x); 
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: 60.943 (sec). Leaf size: 90
ode=D[y[x],x]==Cos[x]-(Sin[x]-y[x])*y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {c_1 \sin (x) \int _1^xe^{-\cos (K[1])}dK[1]+\sin (x)+c_1 \left (-e^{-\cos (x)}\right )}{1+c_1 \int _1^xe^{-\cos (K[1])}dK[1]} \\ y(x)\to \sin (x)-\frac {e^{-\cos (x)}}{\int _1^xe^{-\cos (K[1])}dK[1]} \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((-y(x) + sin(x))*y(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 factorable group method