ODE
\[ x^2 y''(x)+3 x y'(x)+y(x)=a-x+x \log (x) \] ODE Classification
[[_2nd_order, _exact, _linear, _nonhomogeneous]]
Book solution method
TO DO
Mathematica ✓
cpu = 0.0136877 (sec), leaf count = 33
\[\left \{\left \{y(x)\to a+\frac {c_1}{x}+\left (\frac {c_2}{x}+\frac {x}{4}\right ) \log (x)-\frac {x}{2}\right \}\right \}\]
Maple ✓
cpu = 0.016 (sec), leaf count = 32
\[ \left \{ y \left ( x \right ) ={\frac { \left ( {x}^{2}+4\,{\it \_C1} \right ) \ln \left ( x \right ) +4\,ax-2\,{x}^{2}+4\,{\it \_C2}}{4\,x}} \right \} \] Mathematica raw input
DSolve[y[x] + 3*x*y'[x] + x^2*y''[x] == a - x + x*Log[x],y[x],x]
Mathematica raw output
{{y[x] -> a - x/2 + C[1]/x + (x/4 + C[2]/x)*Log[x]}}
Maple raw input
dsolve(x^2*diff(diff(y(x),x),x)+3*x*diff(y(x),x)+y(x) = a-x+x*ln(x), y(x),'implicit')
Maple raw output
y(x) = 1/4*((x^2+4*_C1)*ln(x)+4*a*x-2*x^2+4*_C2)/x