How to bound $\int_{0}^{a}{\frac{1-\cos x}{x^2}}$? I was trying to prove 
$$\left|\int_{0}^{a}{\frac{1-\cos{x}}{x^2}}dx-\frac{\pi}{2}\right|\leq \frac{3}{a}$$ or $\leq \frac{2}{a}$. My work: I would like to use Fubini's theorem to prove it. 
I notice that $\frac{1}{x^2}=\int^{\infty}_{0}{ue^{-xu}}du$. 
Then, I got $\int_{0}^{a}{\frac{1-\cos{x}}{x^2}}dx=\int_{0}^{\infty}u\int_{0}^{a}{(1-\cos{x})e^{-xu}}dxdu$. 
Then, I got $\int_{0}^{a}{(1-\cos{x})e^{-xu}}dx=-e^{-au}u+\frac{1}{u+u^3}+e^{-au}\frac{u^2\cos{a}-u\sin{a}}{u+u^3}$.
Then, $\int_{0}^{a}{\frac{1-\cos{x}}{x^2}}dx=\int_0^{\infty}u(\frac{e^{au}-1}{u}+\frac{u-e^{au}(u\cos{a}+\sin{a})}{1+u^2})du\\=\int_0^{\infty}({e^{au}+\frac{-ue^{au}(u\cos{a}+\sin{a}-2)}{1+u^2}})du+\frac{\pi}{2}.$ 
I was trying to show $|\int_0^{\infty}({e^{au}+\frac{-ue^{au}(u\cos{a}+\sin{a}-2)}{1+u^2}})du|\leq\frac{3}{a}$ or $\frac{2}{a}$. 
But I do not have a clue. Can some give me hints?
 A: To circumvent possible divergence issues at the origin, 
write $\int_0^afdx=\int_0^{\infty}fdx-\int_a^{\infty}fdx$
because the first integral is just $\frac{\pi}{2}$ as @Julian Rosen pointed out, we have to inspect
$$
J(a)=\int_a^{\infty}\frac{1-\cos(x)}{x^2}=2\int_a^{\infty}\frac{\sin^2(x/2)}{x^2}= \int_{a/2}^{\infty}\frac{\sin^2(y)}{y^2}dx
$$
We used the trigonmetric identity $1-\cos(x)=2\sin^2(x/2)$
this integral is now easily bounded (use $\sin(y)\leq1$)
$$
J(a)<\int_{a/2}^{\infty}\frac{1}{y^2}=\frac{2}{a}
$$
which is equivalent to the original claim
A: Since we have:
$$ \frac{\pi}{2}-\int_{0}^{a}\frac{1-\cos x}{x^2}\,dx = \int_{a}^{+\infty}\frac{1-\cos x}{x^2}\,dx \tag{1}$$
it trivially follows that:
$$\left|\frac{\pi}{2}-\int_{0}^{a}\frac{1-\cos x}{x^2}\,dx\right|\leq \int_{a}^{+\infty}\frac{2}{x^2}\,dx = \frac{2}{a}.\tag{2}$$
If we use integration by parts, from:
$$\int_{a}^{+\infty}\frac{1-\cos x}{x^2}\,dx = \frac{\sin(a)+a}{a^2}-2\int_{a}^{+\infty}\frac{\sin x}{x^3}\,dx \tag{3}$$
we also have an improved upper bound:

$$\left|\frac{\pi}{2}-\int_{0}^{a}\frac{1-\cos x}{x^2}\,dx\right|\leq \frac{a+2}{a^2}.\tag{4}$$

A: There appears to be a minor mistake in your computation. We have:
$$\begin{align*}
\int_0^a \frac{1-\cos(x)}{x^2}dx&=\int_0^a(1-\cos x)\int_0^\infty u e^{-xu}\,du\,dx\\
&=\int_0^\infty u\int_0^a (1-\cos x)e^{-xu}dx\,du\\
&=\int_0^\infty (1-e^{-au})-\frac{u^2}{1+u^2}+\frac{u^2\cos a-u\sin a}{1+u^2}\\
&=\int_0^\infty e^{-au}\left(-1+\frac{u^2\cos a-u\sin a}{1+u^2}\right)du+\int_0^\infty\frac{1}{1+u^2}du\\
&=\int_0^\infty e^{-au}\left(-1+\frac{u^2\cos a-u\sin a}{1+u^2}\right)du+\frac{\pi}{2}.
\end{align*}
$$
To complete your proof, you need to show that
$$
\left|\int_0^\infty e^{-au}\left(-1+\frac{u^2\cos(a)-u\sin(a)}{1+u^2}\right)du\right|\leq \frac{2}{a}.
$$
Now $\int_0^\infty e^{-au}\,du=1/a$, so it will suffice to check that
$$
\left|\frac{u^2\cos(a)-u\sin(a)}{1+u^2}\right|\leq 1.
$$
The numerator above is the dot prodcut of $(u^2,u)$ and $(\cos(a),-\sin(a))$, so the Cauchy-Schwarz inequality implies
$$
|u^2\cos(a)-u\sin(a)|\leq u \sqrt{1+u^2}\leq 1+u^2.
$$
