Find the smallest possible value of an integral Say a have an integral, like this one
$$\int_{0}^1 (x-a)^2\, dx$$ 
and asked to find the smallest possible value of it, as a varies. How can I do this? Besides, is there a certain rule I can use to solve this type of questions?
I will be grateful for any help.

$$\frac{d}{da}\int_{0}^{1}(x-a)^2 = 2\int_{0}^{1}(a-x)\,dx $$
equals zero iff $a=\frac{1}{2}$, and such value is clearly associated with an absolute minimum, equal to
$$\int_{0}^{1}\left(x-\tfrac{1}{2}\right)^2\,dx\stackrel{\text{Archimedes}}{=}\frac{1}{3}\cdot 1 \cdot\frac{1}{4} = \frac{1}{12}.$$
You like an overkill? Shifted Legendre polynomials give an orthogonal base of $L_2(0,1)$ with respect to the usual inner product. It follows that the  $L^2$-norm of a polynomial of the form $\alpha P_0(2x-1)+\frac{1}{2}P_1(2x-1)$ attains its minimum at $\alpha=0$ and such minimum equals $\frac{1}{2^2(2\cdot 1+1)}$.
The last approach leads to the uber-generalization
$$ \min_{\deg q < n}\int_{0}^{1}\left(x^n+q(x)\right)^2\,dx = \frac{1}{(2n+1)\binom{2n}{n}^2}.$$
