38.2.11 problem 11

Internal problem ID [6440]
Book : Engineering Mathematics. By K. A. Stroud. 5th edition. Industrial press Inc. NY. 2001
Section : Program 24. First order differential equations. Further problems 24. page 1068
Problem number : 11
Date solved : Sunday, March 30, 2025 at 11:01:12 AM
CAS classification : [_linear]

\begin{align*} x y^{\prime }-y&=x^{3}+3 x^{2}-2 x \end{align*}

Maple. Time used: 0.001 (sec). Leaf size: 21
ode:=-y(x)+x*diff(y(x),x) = x^3+3*x^2-2*x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (x^{2}+6 x -4 \ln \left (x \right )+2 c_1 \right ) x}{2} \]
Mathematica. Time used: 0.029 (sec). Leaf size: 24
ode=x*D[y[x],x]-y[x]==x^3+3*x^2-2*x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x \left (\frac {x^2}{2}+3 x-2 \log (x)+c_1\right ) \]
Sympy. Time used: 0.208 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**3 - 3*x**2 + x*Derivative(y(x), x) + 2*x - y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x \left (C_{1} + x^{2} + 6 x - 4 \log {\left (x \right )}\right )}{2} \]