42.1.6 problem Example 3.6

Internal problem ID [8793]
Book : THEORY OF DIFFERENTIAL EQUATIONS IN ENGINEERING AND MECHANICS. K.T. CHAU, CRC Press. Boca Raton, FL. 2018
Section : Chapter 3. Ordinary Differential Equations. Section 3.2 FIRST ORDER ODE. Page 114
Problem number : Example 3.6
Date solved : Tuesday, September 30, 2025 at 05:51:26 PM
CAS classification : [_exact]

\begin{align*} {\mathrm e}^{x}+y+\left (x -2 \sin \left (y\right )\right ) y^{\prime }&=0 \end{align*}
Maple. Time used: 0.006 (sec). Leaf size: 16
ode:=exp(x)+y(x)+(x-2*sin(y(x)))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ {\mathrm e}^{x}+x y+2 \cos \left (y\right )+c_1 = 0 \]
Mathematica. Time used: 0.152 (sec). Leaf size: 27
ode=(Exp[x]+y[x])+(x-2*Sin[y[x]])*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\int _1^{y(x)}-2 \sin (K[1])dK[1]+x y(x)+e^x=c_1,y(x)\right ] \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x - 2*sin(y(x)))*Derivative(y(x), x) + y(x) + exp(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out