36.3.17 problem 18

Internal problem ID [6338]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.4, Exact equations. Exercises. page 64
Problem number : 18
Date solved : Sunday, March 30, 2025 at 10:52:02 AM
CAS classification : [_exact]

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

Maple. Time used: 0.015 (sec). Leaf size: 40
ode:=2*x+y(x)^2-cos(x+y(x))+(2*x*y(x)-cos(x+y(x))-exp(y(x)))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -x +\operatorname {RootOf}\left (-\sin \left (\textit {\_Z} \right )+x^{3}-2 x^{2} \textit {\_Z} +x \,\textit {\_Z}^{2}+x^{2}-{\mathrm e}^{-x +\textit {\_Z}}+c_1 \right ) \]
Mathematica. Time used: 0.449 (sec). Leaf size: 36
ode=(2*x+y[x]^2-Cos[x+y[x]])+(2*x*y[x]-Cos[x+y[x]]-Exp[y[x]])*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [x^2+x y(x)^2-e^{y(x)}-\sin (x) \cos (y(x))-\cos (x) \sin (y(x))=c_1,y(x)\right ] \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x + (2*x*y(x) - exp(y(x)) - cos(x + y(x)))*Derivative(y(x), x) + y(x)**2 - cos(x + y(x)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out