64.5.33 problem 37 (a)

Internal problem ID [13275]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 2, section 2.3 (Linear equations). Exercises page 56
Problem number : 37 (a)
Date solved : Monday, March 31, 2025 at 07:44:51 AM
CAS classification : [`y=_G(x,y')`]

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

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