67.2.51 problem Problem 19(d)

Internal problem ID [13937]
Book : APPLIED DIFFERENTIAL EQUATIONS The Primary Course by Vladimir A. Dobrushkin. CRC Press 2015
Section : Chapter 4, Second and Higher Order Linear Differential Equations. Problems page 221
Problem number : Problem 19(d)
Date solved : Monday, March 31, 2025 at 08:19:34 AM
CAS classification : [[_2nd_order, _exact, _nonlinear], [_2nd_order, _reducible, _mu_y_y1], [_2nd_order, _reducible, _mu_xy]]

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

Maple. Time used: 1.579 (sec). Leaf size: 877
ode:=y(x)*diff(diff(y(x),x),x)*sin(x)+(sin(x)*diff(y(x),x)+cos(x)*y(x))*diff(y(x),x) = cos(x); 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} \text {Solution too large to show}\end{align*}

Mathematica. Time used: 60.145 (sec). Leaf size: 92
ode=y[x]*D[y[x],{x,2}]*Sin[x]+ ( D[y[x],x]*Sin[x]+y[x]*Cos[x] )*D[y[x],x]==Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\sqrt {2} \sqrt {\int _1^x-\csc (K[2]) \left (c_1+\int _1^{K[2]}-\cos (K[1])dK[1]\right )dK[2]+c_2} \\ y(x)\to \sqrt {2} \sqrt {\int _1^x-\csc (K[2]) \left (c_1+\int _1^{K[2]}-\cos (K[1])dK[1]\right )dK[2]+c_2} \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((y(x)*cos(x) + sin(x)*Derivative(y(x), x))*Derivative(y(x), x) + y(x)*sin(x)*Derivative(y(x), (x, 2)) - cos(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
PolynomialDivisionFailed : couldnt reduce degree in a polynomial division algorithm when dividing [[], [ANP([mpq(-1,1)], [mpq(1,1), mpq(0,1), mpq(1,1)], QQ), ANP([mpq(4,1), mpq(0,1)], [mpq(1,1), mpq(0,1), mpq(1,1)], QQ), ANP([mpq(6,1)], [mpq(1,1), mpq(0,1), mpq(1,1)], QQ), ANP([mpq(-4,1), mpq(0,1)], [mpq(1,1), mpq(0,1), mpq(1,1)], QQ), ANP([], [mpq(1,1), mpq(0,1), mpq(1,1)], QQ)]] by [[ANP([mpq(1,1)], [mpq(1,1), mpq(0,1), mpq(1,1)], QQ), ANP([mpq(-2,1), mpq(0,1)], [mpq(1,1), mpq(0,1), mpq(1,1)], QQ), ANP([mpq(-2,1)], [mpq(1,1), mpq(0,1), mpq(1,1)], QQ)]]. This can happen when its not possible to detect zero in the coefficient domain. The domain of computation is QQ<I>. Zero detection is guaranteed in this coefficient domain. This may indicate a bug in SymPy or the domain is user defined and doesnt implement zero detection properly.