Suppose that $f$ is continuous on $\mathbb{R}$ and $\int_{x-1}^{x}f(t)\,dt=x^{2}$. Find $f(x)$. Suppose that $f$ is continuous on $\mathbb{R}$ and $\int_{x-1}^{x}f(t)\,dt=x^{2}$. Find $f(x)$.
Using that Fundamental Theorem of Calculus, I get $f(x)-f(x-1)=2x$.
 A: If you put $g(x) = f(x) - (x + \frac{1}{2})^2 + \frac{1}{12}$, you get $g(x) - g(x-1) = 0$.
Now you can pick any continuous function $g:[0,1]\to \mathbb{R}$, such that $g(0) = g(1)$, $\int_{0}^{1} g(x) dx = 0$, and extend it to whole of $\mathbb{R}$, with $g(x+1) = g(x)$.
Take $f(x) = g(x) + (x + \frac{1}{2})^2 -\frac{1}{12}$. 
For example, you can take $g(x) = \sin 2 \pi x$.
A: $$
\begin{align}
\frac{\mathrm{d}}{\mathrm{d}x}\int_{x-1}^xf(t)\,\mathrm{d}t
&=f(x)-f(x-1)\\
&=2x\\
&=2\binom{x}{1}\\
&=2\binom{x+1}{2}-2\binom{x}{2}\\
f(x)&=2\binom{x+1}{2}+g(x)
\end{align}
$$
Since $f(x)-f(x-1)=0\Rightarrow f(x)=g(x)$ is the homogenous solution where $g(x)$ is a periodic function with period $1$.
To compute the constant of integration, we substitute back in to get
$$
\begin{align}
\int_{x-1}^x((t+1)t+g(t))\,\mathrm{d}t
&=\frac13(3x^2-3x+1)+\frac12(2x-1)+\int_0^1g(t)\,\mathrm{d}t\\
&=x^2-\frac16+\int_0^1g(t)\,\mathrm{d}t
\end{align}
$$

Thus, $f(x)=x(x+1)+g(t)$ where $g(x)=g(x-1)$ and $\int_0^1g(t)\,\mathrm{d}t=\frac16$.

