15.4.17 problem 18

Internal problem ID [2930]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 8, page 34
Problem number : 18
Date solved : Tuesday, March 04, 2025 at 03:31:44 PM
CAS classification : [_exact, [_1st_order, `_with_symmetry_[F(x)*G(y),0]`]]

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

Maple. Time used: 0.037 (sec). Leaf size: 18
ode:=cos(y(x))-(x*sin(y(x))-y(x)^2)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ x +\frac {\sec \left (y\right ) \left (y^{3}-3 c_1 \right )}{3} = 0 \]
Mathematica. Time used: 0.148 (sec). Leaf size: 23
ode=Cos[y[x]]-(x*Sin[y[x]]-y[x]^2)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [x=-\frac {1}{3} y(x)^3 \sec (y(x))+c_1 \sec (y(x)),y(x)\right ] \]
Sympy. Time used: 3.341 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((-x*sin(y(x)) + y(x)**2)*Derivative(y(x), x) + cos(y(x)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ C_{1} + x \cos {\left (y{\left (x \right )} \right )} + \frac {y^{3}{\left (x \right )}}{3} = 0 \]