Solving $\frac{d f(x)}{dx} + f(x-1) = x^2$ Given following differential equation:
$$\frac{d f(x)}{dx} + f(x-1) = x^2$$
where $ f(x)=0 $ for $x \leq 0 $. How do I find the solution for $ x \geq 0 $ ?
I understand that for  $ 0 \leq x \leq 1 $ the solution is $ f(x)= \frac{x^3}{3} $.

On $[0,1]$, the differential equation reduces to $\frac{d}{dx}f(x)=x^2$, which can be solved: $f(x)=\frac13x^3+C$. If the solution is continuous, then $C=0$.
Then on $[1,2]$, the differential equation reduces to  $\frac{d}{dx}f(x)=x^2-\frac13(x-1)^3$. So $f(x)=\frac13x^3-\frac1{12}(x-1)^4+C$. To be continuous at $1$, $C$ must be $0$.
Now on $[2,3]$, the differential equation reduces to  $\frac{d}{dx}f(x)=x^2-\frac13(x-1)^3+\frac1{12}(x-2)^4$. And repeat. (Yielding $f(x)=\frac13x^3-\frac1{12}(x-1)^4+\frac1{60}(x-2)^5$.)
It would appear that on $[n,n+1]$, that $f(x)=\sum_{k=0}^{n}(-1)^n\frac{2}{(n+3)!}(x-k)^{k+3}$. Induction could formally prove this.
