4.27.29 \(y''(x)-\sin (x) y'(x)+y(x) (-\cos (x))=a-x+x \log (x)\)

ODE
\[ y''(x)-\sin (x) y'(x)+y(x) (-\cos (x))=a-x+x \log (x) \] ODE Classification

[[_2nd_order, _exact, _linear, _nonhomogeneous]]

Book solution method
TO DO

Mathematica
cpu = 2.85066 (sec), leaf count = 56

\[\left \{\left \{y(x)\to e^{-\cos (x)} \left (\int _1^x\frac {1}{4} e^{\cos (K[1])} \left (2 \log (K[1]) K[1]^2-3 K[1]^2+4 a K[1]+4 c_1\right )dK[1]+c_2\right )\right \}\right \}\]

Maple
cpu = 0.289 (sec), leaf count = 35

\[\left [y \left (x \right ) = \left (\textit {\_C2} +\int \left (\textit {\_C1} -\frac {3 x^{2}}{4}+a x +\frac {x^{2} \ln \left (x \right )}{2}\right ) {\mathrm e}^{\cos \left (x \right )}d x \right ) {\mathrm e}^{-\cos \left (x \right )}\right ]\] Mathematica raw input

DSolve[-(Cos[x]*y[x]) - Sin[x]*y'[x] + y''[x] == a - x + x*Log[x],y[x],x]

Mathematica raw output

{{y[x] -> (C[2] + Inactive[Integrate][(E^Cos[K[1]]*(4*C[1] + 4*a*K[1] - 3*K[1]^2
 + 2*K[1]^2*Log[K[1]]))/4, {K[1], 1, x}])/E^Cos[x]}}

Maple raw input

dsolve(diff(diff(y(x),x),x)-diff(y(x),x)*sin(x)-y(x)*cos(x) = a-x+x*ln(x), y(x))

Maple raw output

[y(x) = (_C2+Int((_C1-3/4*x^2+a*x+1/2*x^2*ln(x))*exp(cos(x)),x))*exp(-cos(x))]