4.42.42 \(y'''(x)=y(x)+e^x x+\cos ^2(x)\)

ODE
\[ y'''(x)=y(x)+e^x x+\cos ^2(x) \] ODE Classification

[[_3rd_order, _linear, _nonhomogeneous]]

Book solution method
TO DO

Mathematica
cpu = 1.44949 (sec), leaf count = 98

\[\left \{\left \{y(x)\to c_1 e^x+c_3 e^{-x/2} \sin \left (\frac {\sqrt {3} x}{2}\right )+c_2 e^{-x/2} \cos \left (\frac {\sqrt {3} x}{2}\right )+\frac {e^x x^2}{6}-\frac {e^x x}{3}+\frac {2 e^x}{9}-\frac {4}{65} \sin (2 x)-\frac {1}{130} \cos (2 x)-\frac {1}{2}\right \}\right \}\]

Maple
cpu = 0.336 (sec), leaf count = 61

\[ \left \{ y \left ( x \right ) ={\it \_C2}\,{{\rm e}^{-{\frac {x}{2}}}}\cos \left ( {\frac {\sqrt {3}x}{2}} \right ) +{\it \_C3}\,{{\rm e}^{-{\frac {x}{2}}}}\sin \left ( {\frac {\sqrt {3}x}{2}} \right ) -{\frac {\cos \left ( 2\,x \right ) }{130}}-{\frac {4\,\sin \left ( 2\,x \right ) }{65}}-{\frac {1}{2}}+{\frac { \left ( 195\,{x}^{2}+1170\,{\it \_C1}-390\,x+260 \right ) {{\rm e}^{x}}}{1170}} \right \} \] Mathematica raw input

DSolve[y'''[x] == E^x*x + Cos[x]^2 + y[x],y[x],x]

Mathematica raw output

{{y[x] -> -1/2 + (2*E^x)/9 - (E^x*x)/3 + (E^x*x^2)/6 + E^x*C[1] - Cos[2*x]/130 +
 (C[2]*Cos[(Sqrt[3]*x)/2])/E^(x/2) - (4*Sin[2*x])/65 + (C[3]*Sin[(Sqrt[3]*x)/2])
/E^(x/2)}}

Maple raw input

dsolve(diff(diff(diff(y(x),x),x),x) = x*exp(x)+cos(x)^2+y(x), y(x),'implicit')

Maple raw output

y(x) = _C2*exp(-1/2*x)*cos(1/2*3^(1/2)*x)+_C3*exp(-1/2*x)*sin(1/2*3^(1/2)*x)-1/1
30*cos(2*x)-4/65*sin(2*x)-1/2+1/1170*(195*x^2+1170*_C1-390*x+260)*exp(x)