Finding $\int^{\pi}_{0}f^{-1}(x)\,\mathrm dx$ 
$\def\d{\mathrm{d}}$If $f:\mathbb{R}\rightarrow \mathbb{R}$ and $f(x)=x+\cos x$, find$$\int^{\pi}_{0}f^{-1}(x) \,\d x.$$

Try: put $x=f(t)$ and $\d x=f'(t) \,\d t$, so
\begin{align*}
\int^{f^{-1}(\pi)}_{f^{-1}(0)}tf'(t) \,\d t &=\int^{f^{-1}(\pi)}_{f^{-1}(0)}t(1-\sin t) \,\d t\\
&= \left.\left(t \cos t-\sin t+\frac{t^2}{2}\right)\right|^{f^{-1}(\pi)}_{f^{-1}(0)}.
\end{align*}
Could someone help me how to find $f^{-1}(\pi)$ and $f^{-1}(0)$, thanks.
 A: Since $\cos(\pi-x)=-\cos x$, we have
$$f(\pi-x)=\pi-f(x).$$ Applying $f^{-1}$ to both sides and replacing $x$ by $f^{-1}(x)$, this gives $$f^{-1}(\pi-x)=\pi-f^{-1}(x).$$
Then, $$\int^\pi_0f^{-1}(\pi-x)\,dx=\int^\pi_0(\pi-f^{-1}(x))\,dx.$$ The substitution $x\to\pi-x$ on the LHS gives
$$\int^\pi_0f^{-1}(x)\,dx=\pi^2-\int^\pi_0f^{-1}(x)\,dx,$$ i.e.
$$\int^\pi_0f^{-1}(x)\,dx=\frac{\pi^2}2,$$ as @Patrick Stevens guessed from numerical calculation in a comment, already.
REMARK: originally, I started with $x_0=f^{-1}(0)$, and found that then, we must have $f^{-1}(\pi)=\pi-x_0$. If we plug both values into the expression given by the OP and use $\sin(\pi-x_0)=\sin x_0$, $\cos x_0=-x_0$ and $\cos(\pi-x_0)=x_0$, it miraculously simplifies to $\pi^2/2$. Thinking about "why?", I came up with the above. 
A: Using graph and symmetry arguments, we can find the integral. The graph of inverse of $f(x)$ will look like:

It is now possible to show that the inverse function has a point of symmetry $(\pi/2, \pi/2)$. 
The red regions actually cancel out, and green region is half of the rectangle namely $\frac{\pi(\pi-2)}{2}$. The blue region is $\pi$. 
So the answer is $\dfrac{\pi^2}{2}$.
A: Denote the single solution of the equation $\cos t=t$ by $\alpha\ (\approx0.739085)$.
One has $f'(x)=1-\sin x\geq0$ with isolated points of equality. It follows that $f$ is strictly increasing. Furthermore
$$f(-\alpha)=-\alpha+\cos\alpha=0,\quad f(\pi+\alpha)=\pi+\alpha-\cos\alpha=\pi\ .$$
Let $g:=f^{-1}$ be the inverse function of $f$. Then
$$\int_0^\pi g(t)\>dt=\int_{-\alpha}^{\pi+\alpha} g\bigl(f(x)\bigr)\>f'(x)\>dx=\int_{-\alpha}^{\pi+\alpha}x f'(x)\>dx\ .$$
Since $f'$ is even with respect to the midpoint ${\pi\over2}$ of the interval of integration we rewrite the first factor in the last integral as ${\pi\over2}+\bigl(x-{\pi\over2}\bigr)$ and obtain
$$\int_{-\alpha}^{\pi+\alpha}x f'(x)\>dx={\pi\over2}\int_{-\alpha}^{\pi+\alpha}f'(x)\>dx={\pi\over2}\bigl(f(\pi+\alpha)-f(-\alpha)\bigr)={\pi^2\over2}\ .$$
