Substituting variables in integral functional equations 
If $f(x)$ is differentiable, and equals $ x^2+\int_0^x{e^{-t}f(x-t)}dt $ , then find $f(x)$

Substituting $x=0$, we find that $f(0)=0$. Then, substituting $x=t$ gives us $f(t)= t^2+\int_0^t{e^{-t}f(0)}dt = t^2$
However, if we differentiate the given equation, and then solve the resulting differential equation, we get $f(x)=x^3/3+x^2$. It can be verified that this is the actual solution to the functional equation.
My doubt is, why does method $1$ not work?

When you write $$\int_{0}^{x} e^{-t} f(x-t) dt$$ here the integrating variable is $t$, and hence, $x$ is to be treated as a constant. Thus the substitution $t=x$ is meaningless, as the variable cannot be substituted to be a constant during integration.
