Which one is bigger? $ \int_0^{\frac{\pi}{2}}\frac{\sin x}{1+x^2}dx$ or $ \int_0^{\frac{\pi}{2}}\frac{\cos x}{1+x^2}dx$ Which is bigger
$$ \int_0^{\frac{\pi}{2}}\frac{\sin x}{1+x^2}dx$$ or $$ \int_0^{\frac{\pi}{2}}\frac{\cos x}{1+x^2}dx~?$$
I let $x=\frac{\pi}{2}-t$ in the second integral, and I obtain this
$$\int_0^{\frac{\pi}{2}}\frac{\sin x}{1+(\frac{\pi}{2}-x)^2}dx$$
But it is still to decide which is the bigger.
 A: Suppose that you use the two $1,400^+$ years old approximations
$$\sin(x) \simeq \frac{16 (\pi -x) x}{5 \pi ^2-4 (\pi -x) x}\qquad (0\leq x\leq\pi)$$
$$\cos(x) \simeq\frac{\pi ^2-4x^2}{\pi ^2+x^2}\qquad (-\frac \pi 2 \leq x\leq\frac \pi 2)$$
the antiderivatives are simple and you obtain
$$\int_0^{\frac{\pi}{2}}\frac{\sin (x)}{1+x^2}dx\sim 0.527077$$
$$\int_0^{\frac{\pi}{2}}\frac{\cos (x)}{1+x^2}dx\sim 0.748683$$ wile the exact values are respectively $0.526979$ and $0.749042$.
A: Actually, this is rather crude:
$$\int_0^{\frac{\pi}{2}}\dfrac{\sin x}{1+x^2}dx<\int_0^{\frac{\pi}{2}}\dfrac{x}{1+x^2}dx = \dfrac{1}{2}\ln\dfrac{4+\pi^2}{4}\approx 0.62 < 0.72\approx \dfrac{3}{2}\arctan\frac{\pi}{2} - \frac{\pi}{4}=\int_0^{\frac{\pi}{2}}\dfrac{1-x^2/2}{1+x^2}dx <\int_0^{\frac{\pi}{2}}\dfrac{\cos x}{1+x^2}dx $$
A: $g(x) = 1/(1+x)^2$ is strictly decreasing on $[0, \pi/2]$, therefore is
$$
 \int_0^{\pi/2} (\cos(x)-\sin(x))g(x) \, dx =  \int_0^{\pi/4} (\cos(x)-\sin(x))g(x) \, dx +  \int_{\pi/4}^{\pi/2} (\cos(x)-\sin(x))g(x) \, dx\\
 \underset{(*)}{=} \int_0^{\pi/4} (\cos(x)-\sin(x))g(x) \, dx +  \int_{0}^{\pi/4} (\sin(x)-\cos(x))g(\frac \pi 2 - x) \, dx \\
= \int_0^{\pi/4} \left( \cos(x)-\sin(x)\right)(g(x) - g(\pi/2-x)) \, dx > 0 \, .
$$
In $(*)$ I have substituted $x$ by $\pi/2 - x$ in the second integral, and the integral in the last line is positive
since both factors are strictly positive on $[0, \pi/4)$.
This shows that
$$
\int_0^{\pi/2} \cos(x)g(x) \, dx > \int_0^{\pi/2} \sin(x)g(x) \, dx
$$
for any strictly decreasing function on $[0, \pi/2]$.
A: Let $f$ and $g$ be strictly decreasing nonnegative continuous functions on the interval $[0,1].$ Then for $0\le x< {1\over 2}$ we have
$$[ f(x)-f(1-x)]\,[g(x)-g(1-x)]> 0$$ and $$f(x)g(x)+f(1-x)g(1-x)>f(1-x)g(x)+f(x)g(1-x)$$
Therefore $$\int\limits_0^1f(x)g(x)\,dx\\ = \int\limits_0^{1/2}[f(x)g(x)+f(1-x)g(1-x)]\,dx\\ >\int\limits_0^{1/2}[f(x)g(1-x)+f(1-x)g(x)]\,dx\\ =\int\limits_0^1f(x)g(1-x)\,dx$$
By rescaling the following inequality holds
$$\int\limits_0^af(x)g(x)\,dx>\int\limits_0^af(x)g(a-x)\,dx$$ for strictly decreasing nonnegative functions $f$ and $g.$ Now apply the inequality for $a=\pi/4,$ $f(x)={1\over x^2+1}$ and $g(x)=\cos x.$
A: Hardy-Littlewood-Polya ...
Consider two nonnegative functions $f(x),g(x)$ on $[a,b]$.  Among all rearrangements
$f_1$ of $f$ and all rearrangements $g_1$ of $g$, the largest value
of $\int_a^b f_1(x)g_1(x)\;dx$ occurs when both $f_1$ and $g_1$ are increasing (or both decreasing).  The smallest value of $\int_a^b f_1(x)g_1(x)\;dx$ occurs when one of $f_1,g_1$ is increasing and the other decreasing, since $\sin x$ is increasing and $\cos x$ is decreasing.
In this case, since $1/(1+x^2)$ is decreasing on $[0,\pi/2]$ and $\sin(x), \cos(x)$ are rearrangements of each other, we see that
$$
\int_0^{\frac{\pi}{2}}\frac{\sin x}{1+x^2}dx
\quad\text{ is smallest, and }\quad
\int_0^{\frac{\pi}{2}}\frac{\cos x}{1+x^2}dx \quad\text{ is largest}
$$
among all
$$
\int_0^{\pi/2}\frac{f_1(x)}{1+x^2}\;dx
$$
as $f_1$ ranges over all rearrangements of $\sin x$ on $[0,\pi/2]$.

For the technical definition of "rearrangement" see the text
Hardy, G. H.; Littlewood, J. E.; Pólya, G., Inequalities., Cambridge: University Press. xii, 314 p. (1934). ZBL60.0169.01.
