General Solution of second order differential equation ${\frac {d^2y}{dx^2}}+{\frac {dy}{dx}} = x^2$ ${\frac {d^2y}{dx^2}}+{\frac {dy}{dx}} = x^2$

I'm not sure how to solve it, in textbook solution for this problem is

$y = \frac13x^3 - x^2 + 2x +c_1+c_2e^{-x}$
A simpler solution would be $v=y'$ and then it becomes $v'+v=x^2$ which has an integrating factor of $e^x$ which makes it $\left (ve^x\right )'=x^2e^x$ and integrating both sides $ve^x=e^x(x^2-2x+2)+C_1$ and then we get $v=y'=x^2-2x+2+C_1e^{-x}$ $$\boxed{y=\frac{1}{3}x^3-x^2+2x+C_1e^{-x}+C_2}$$ I didn't really understand the whole kernel thing from the previous answer. I apologize to the severe incorrectness of my last answer.
Integrate once to get $$\frac{dy}{dx} + y = \frac{1}{3}x^3 + c_1.$$ Formally this is $$(D+I)y = \frac{1}{3}x^3 + c_1$$ with the derivative $D$. Since $(I+D)(I - D + D^2 - D^3) = I - D^4$ acts as $I$ on polynomials of degree $3$ it follows that \begin{align*} y &amp;= (I-D+D^2-D^3) \Big( \frac{1}{3}x^3 + c_1 \Big) + \mathrm{Ker}(D+I) \\ &amp;= \frac{1}{3}x^3 - x^2 + 2x - 2 + c_1 + \mathrm{Ker}(D+I) \\ &amp;= \frac{1}{3}x^3 - x^2 + 2x + c_1 + c_2 e^{-x} \end{align*} since the kernel of $D+I$ is $\{f: f' + f = 0\} = \{c_2 e^{-x}: \, c_2 \in \mathbb{R}\}.$