$$ \begin{aligned} & y^{\prime \prime \prime}+2 y^{\prime \prime}-y^{\prime}-2 y=x^{2}+x \\ \Rightarrow & k^{3}+2 k^{2}-k-2=0 \\ \Rightarrow &(k-1)(k+1)(k+2)=0 \end{aligned} $$
$$ \begin{array}{l}{k_{1}=1\quad \Rightarrow y_{1}=c_{1} e^{x}} \\ {k_{2}=-1 \Rightarrow y_{2}=c_{2} e^{-x}} \\ {k_{3}=-2 \Rightarrow y_{3}=c_{3} e^{-2 x}}\end{array} $$
$$ \Rightarrow y_{n}=c_{1} e^{x}+c_{2} e^{-x}+c_{3} e^{-2 x} $$
$$ \begin{array}{l}{Y p=A+B x+C x^{2}} \\ {y_{p}^{\prime}=B+2 C x} \\ {y p^{\prime \prime}=2} \\ {y_{p}^{\prime \prime \prime }=0}\end{array} $$
⇒ in die Aufgabe einsetzen
⇒ Koeff. vergleichen
⇒ Lösung
$$\begin{aligned} y &=y_{n}+y_{p} \\ &=c_{1} e^{x}+c_{2} e^{-x}+c_{3} e^{-2 x}-\frac{x}{2}-1 \end{aligned}$$