83.6.2 problem 2 (b)

Internal problem ID [21945]
Book : Differential Equations By Kaj L. Nielsen. Second edition 1966. Barnes and nobel. 66-28306
Section : Chapter III. First order differential equations of the first degree. Ex. VII at page 50
Problem number : 2 (b)
Date solved : Thursday, October 02, 2025 at 08:18:58 PM
CAS classification : [_linear]

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