85.18.3 problem 1 (c)

Internal problem ID [22549]
Book : Applied Differential Equations. By Murray R. Spiegel. 3rd edition. 1980. Pearson. ISBN 978-0130400970
Section : Chapter two. First order and simple higher order ordinary differential equations. A Exercises at page 52
Problem number : 1 (c)
Date solved : Thursday, October 02, 2025 at 08:49:46 PM
CAS classification : [`y=_G(x,y')`]

\begin{align*} y^{2} \cos \left (x \right )-y+\left (x +y^{2}\right ) y^{\prime }&=0 \end{align*}
Maple. Time used: 0.008 (sec). Leaf size: 63
ode:=y(x)^2*cos(x)-y(x)+(x+y(x)^2)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= -\frac {\sin \left (x \right )}{2}-\frac {c_1}{2}-\frac {\sqrt {\sin \left (x \right )^{2}+2 \sin \left (x \right ) c_1 +c_1^{2}+4 x}}{2} \\ y &= -\frac {\sin \left (x \right )}{2}-\frac {c_1}{2}+\frac {\sqrt {\sin \left (x \right )^{2}+2 \sin \left (x \right ) c_1 +c_1^{2}+4 x}}{2} \\ \end{align*}
Mathematica. Time used: 0.332 (sec). Leaf size: 72
ode=(y[x]^2*Cos[x]-y[x])+(x+y[x]^2)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{2} \left (-\sin (x)-\sqrt {4 x+(-\sin (x)+c_1){}^2}+c_1\right )\\ y(x)&\to \frac {1}{2} \left (-\sin (x)+\sqrt {4 x+(-\sin (x)+c_1){}^2}+c_1\right )\\ y(x)&\to 0 \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x + y(x)**2)*Derivative(y(x), x) + y(x)**2*cos(x) - y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out