4.1.2 \(y'(x)=y(x)+x+\sin (x)\)

ODE
\[ y'(x)=y(x)+x+\sin (x) \] ODE Classification

[[_linear, `class A`]]

Book solution method
Linear ODE

Mathematica
cpu = 0.0345287 (sec), leaf count = 28

\[\left \{\left \{y(x)\to c_1 e^x-x-\frac {\sin (x)}{2}-\frac {\cos (x)}{2}-1\right \}\right \}\]

Maple
cpu = 0.122 (sec), leaf count = 21

\[ \left \{ y \left ( x \right ) =-{\frac {\cos \left ( x \right ) }{2}}-{\frac {\sin \left ( x \right ) }{2}}-x-1+{{\rm e}^{x}}{\it \_C1} \right \} \] Mathematica raw input

DSolve[y'[x] == x + Sin[x] + y[x],y[x],x]

Mathematica raw output

{{y[x] -> -1 - x + E^x*C[1] - Cos[x]/2 - Sin[x]/2}}

Maple raw input

dsolve(diff(y(x),x) = x+sin(x)+y(x), y(x),'implicit')

Maple raw output

y(x) = -1/2*cos(x)-1/2*sin(x)-x-1+exp(x)*_C1