22.1.53 problem 54

Internal problem ID [4359]
Book : Differential equations for engineers by Wei-Chau XIE, Cambridge Press 2010
Section : Chapter 2. First-Order and Simple Higher-Order Differential Equations. Page 78
Problem number : 54
Date solved : Tuesday, September 30, 2025 at 07:23:19 AM
CAS classification : [_linear]

\begin{align*} 1+y \cos \left (x \right )-\sin \left (x \right ) y^{\prime }&=0 \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 13
ode:=1+y(x)*cos(x)-sin(x)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \sin \left (x \right ) c_1 -\cos \left (x \right ) \]
Mathematica. Time used: 0.021 (sec). Leaf size: 15
ode=(1+y[x]*Cos[x])-( Sin[x])*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\cos (x)+c_1 \sin (x) \end{align*}
Sympy. Time used: 0.260 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x)*cos(x) - sin(x)*Derivative(y(x), x) + 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} \sin {\left (x \right )} - \cos {\left (x \right )} \]