50.6.5 problem 1(e)

Internal problem ID [7897]
Book : Differential Equations: Theory, Technique, and Practice by George Simmons, Steven Krantz. McGraw-Hill NY. 2007. 1st Edition.
Section : Chapter 1. What is a differential equation. Section 1.8. Integrating Factors. Page 32
Problem number : 1(e)
Date solved : Sunday, March 30, 2025 at 12:36:29 PM
CAS classification : [_separable]

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

Maple. Time used: 0.009 (sec). Leaf size: 16
ode:=(x+2)*sin(y(x))+x*cos(y(x))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \arcsin \left (\frac {{\mathrm e}^{-x}}{c_1 \,x^{2}}\right ) \]
Mathematica. Time used: 46.612 (sec). Leaf size: 24
ode=(x+2)*Sin[y[x]]+x*Cos[y[x]]*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \arcsin \left (\frac {e^{-x-2+c_1}}{x^2}\right ) \\ y(x)\to 0 \\ \end{align*}
Sympy. Time used: 0.451 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*cos(y(x))*Derivative(y(x), x) + (x + 2)*sin(y(x)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = \pi - \operatorname {asin}{\left (\frac {C_{1} e^{- x}}{x^{2}} \right )}, \ y{\left (x \right )} = \operatorname {asin}{\left (\frac {C_{1} e^{- x}}{x^{2}} \right )}\right ] \]