2.4.18 problem 18

Internal problem ID [721]
Book : Differential equations and linear algebra, 3rd ed., Edwards and Penney
Section : Section 1.5. Linear first order equations. Page 56
Problem number : 18
Date solved : Tuesday, September 30, 2025 at 04:07:04 AM
CAS classification : [_linear]

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