38.1.10 problem 10

Internal problem ID [6427]
Book : Engineering Mathematics. By K. A. Stroud. 5th edition. Industrial press Inc. NY. 2001
Section : Program 24. First order differential equations. Test excercise 24. page 1067
Problem number : 10
Date solved : Wednesday, March 05, 2025 at 12:41:23 AM
CAS classification : [_linear]

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

Maple. Time used: 0.003 (sec). Leaf size: 12
ode:=x*diff(y(x),x)-2*y(x) = x^3*cos(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (\sin \left (x \right )+c_1 \right ) x^{2} \]
Mathematica. Time used: 0.036 (sec). Leaf size: 14
ode=x*D[y[x],x]-2*y[x]==x^3*Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x^2 (\sin (x)+c_1) \]
Sympy. Time used: 0.373 (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 ) \]