10.6.2 problem 2

Internal problem ID [1219]
Book : Elementary differential equations and boundary value problems, 10th ed., Boyce and DiPrima
Section : Miscellaneous problems, end of chapter 2. Page 133
Problem number : 2
Date solved : Saturday, March 29, 2025 at 10:47:55 PM
CAS classification : [_separable]

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

Maple. Time used: 0.008 (sec). Leaf size: 17
ode:=diff(y(x),x) = (1+cos(x))/(2-sin(y(x))); 
dsolve(ode,y(x), singsol=all);
 
\[ x +\sin \left (x \right )-2 y-\cos \left (y\right )+c_1 = 0 \]
Mathematica. Time used: 0.326 (sec). Leaf size: 27
ode=D[y[x],x] == (1+Cos[x])/(2-Sin[y[x]]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \text {InverseFunction}[-2 \text {$\#$1}-\cos (\text {$\#$1})\&][-x-\sin (x)+c_1] \]
Sympy. Time used: 2.669 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - (cos(x) + 1)/(2 - sin(y(x))),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ x - 2 y{\left (x \right )} + \sin {\left (x \right )} - \cos {\left (y{\left (x \right )} \right )} = C_{1} \]