Calculating limit of two integrals What's $\displaystyle\lim_{r \to \infty} \frac{\int_0^{\pi/2}\left(\frac{x}{\pi/2}\right)^{r-1}\cos x\,dx}{\int_0^{\pi/2}\left(\frac{x}{\pi/2}\right)^r\cos{x}\,dx} $? 
I got the limit as part of Putnam 2011 A3. I know I'm supposed to chop $[0, \frac{\pi}{2}]$ in $[0, \frac{\pi}{2}- \epsilon], [ \frac{\pi}{2}- \epsilon, \frac{\pi}{2}]$ and the contribution from the first part is very small but I don't know in which direction you approach $(\epsilon, r) \mapsto (0, \infty)$ to make it work properly. 

Let $x=\pi y/2$ to see the integral downstairs equals
$$\tag 1 (\pi/2) \int_0^1 y^r\cos (\pi y/2)\,dy.$$
Integrate by parts twice to see $(1)$ equals
$$\frac{(\pi/2)^2}{(r+1)(r+2)} -\, (\pi/2)^3\cdot\int_0^1 \frac{y^{r+2}}{(r+1)(r+2)}\cos (\pi y/2)\, dy.$$
Since $\cos (\pi y/2)\le 1,$ the last integral is majorized by
$$\int_0^1 \frac{y^{r+2}}{(r+1)(r+2)}\, dy=O(1/r^3).$$ 
Thus $(1)$ equals $(\pi/2)^2/[(r+1)(r+2)] +O(1/r^3).$ Similarly the upstairs integral equals $(\pi/2)^2/[r(r+1)] +O(1/r^3).$ Dividing top by bottom and letting $r\to \infty$ then gives a limit of $1.$
