Calculate the following limit
$$\lim_{n\to\infty}\int_{0}^{\infty} \frac{x^{n-2}}{1+ x^{n}}\cos(n\pi x) dx$$
I tried by broke down the integration from 0 to 1 and 1 to infinity. I am done with 0 to 1 part but I could not figure out second part. I am thinking of applying Riemann lebesgue lemma. is that work here?
Hint:
$$\int_1^\infty\frac{x^{n-2}}{1+x^n}\cos (n\pi x)\, dx = \int_1^\infty\left (\frac{x^{n-2}}{1+x^n} - \frac{1}{x^2}\right)\cos (n\pi x)\, dx$$ $$ + \int_1^\infty \frac{1}{x^2}\cos (n\pi x)\, dx.$$