Define random variables $X,\,Y$ and functions $f_n,\,g_n$ such that $$I_n=E(f_n(X))=\int\limits_0^n\frac{x^2+5}{x^3+nx^2+1}\,\mathrm{d}x,~~~~J_n=E(g_n(X))=\int\limits_0^nne^{-nx}\,\frac{\cos x}{\sqrt{x^2+1}}\,\mathrm{d}x.$$ Then evaluate
$$\lim_{n\to +\infty} I_n ~~~\textrm{and}~~~\lim_{n\to +\infty} J_n.$$
Attempt. I am aware of the formula: $$E_{\mathrm{P}}\big(f(X)\big)=E_{\mathrm{P}^X}(f)=\int_{\mathbb{R}}f(x)\mathrm{d}\mathrm{P}^X(x).$$ According to this, regarding the first integral, we could use: $$f_n(x)=\frac{x^2+5}{x^3+nx^2+1}\,I_{[0,n]}(x)$$ and a suitable random variable such that $\mathrm{P}^X$ is the Lebesgue measure on $\mathbb{R}.$ But 1) the Lebesgue measure on $\mathbb{R}$ is not probability measure and 2) if so, what would $(\Omega,\mathcal{F},P)$ and $X:\Omega \to \mathbb{R}$ be?
Regarding the second part, $(f_n)$ converges pointwise to $0$, but $|f_n(x)|\leq \frac{1}{x}$ for all $n$ and $x>0$, whereas $\int\limits_0^{+\infty}\frac{\mathrm{d}x}{x}=+\infty,$ so we may not apply the domination convergence theorem this way.
Thanks in advance.
Start with, for $n\ge2$, $$\begin{align}0&\le\int_0^n\frac{5x+5n-1}{(x^3+nx^2+1)(x+n)}dx\\ &\le\int_0^{n^{-1/2}}\frac{10n}{(1)(n)}dx+\int_{n^{-1/2}}^n\frac{10n}{(nx^2)(n)}dx\\ &=10n^{-1/2}+10n^{-1/2}-10n^{-2}\end{align}$$ So $$\begin{align}\lim_{n\rightarrow\infty}\int_0^n\frac{x^2+5}{x^3+nx^2+1}dx &=\lim_{n\rightarrow\infty}\int_0^n\frac{dx}{x+n}+\lim_{n\rightarrow\infty}\int_0^n\frac{5x+5n-1}{(x^3+nx^2+1)(x+n)}dx\\ &=\ln2+0=\ln2\end{align}$$ Then we have, for $0\le x\le1$, $$1-\frac{x^2}2\le\cos x\le1$$ $$1-\frac{x^2}2\le\frac1{\sqrt{x^2+1}}\le1$$ So $$1-x^2\le\left(1-\frac{x^2}2\right)^2\le\frac{\cos x}{\sqrt{x^2+1}}\le1$$ So for $n\ge2$ $$0\le\int_0^{n^{-1/2}}ne^{-nx}\left(\frac{\cos x}{\sqrt{x^2+1}}-(1-x^2)\right)dx\le\int_0^{n^{-1/2}}nx^2dx=\frac13n^{-1/2}$$ So $$\begin{align}\lim_{n\rightarrow\infty}\int_0^{n^{-1/2}}ne^{-nx}\frac{\cos }{\sqrt{x^2+1}}dx&=\lim_{n\rightarrow\infty}\int_0^{n^{-1/2}}ne^{-nx}(1-x^2)dx\\ &+\lim_{n\rightarrow\infty}\int_0^{n^{-1/2}}ne^{-nx}\left(\frac{\cos x}{\sqrt{x^2+1}}-(1-x^2)\right)dx\\ &=\lim_{n\rightarrow\infty}-\left.\left(1-x^2-\frac{2x}n-\frac2{n^2}\right)e^{-nx}\right|_0^{n^{-1/2}}+0\\ &=1\end{align}$$ And then since $$\left|ne^{-nx}\frac{\cos x}{\sqrt{x^2+1}}\right|\le ne^{-nx}$$ We have $$\begin{align}\left|\int_{n^{-1/2}}^nne^{-nx}\frac{\cos x}{\sqrt{x^2+1}}dx\right|&\le\int_{n^{-1/2}}^n\left|ne^{-nx}\frac{\cos x}{\sqrt{x^2+1}}\right|dx\\ &\le\int_{n^{-1/2}}^nne^{-nx}dx=e^{-n^{1/2}}-e^{-n^2}\end{align}$$ So $$\lim_{n\rightarrow\infty}\int_{n^{-1/2}}^nne^{-nx}\frac{\cos x}{\sqrt{x^2+1}}dx=0$$ Adding these last two limits, $$\lim_{n\rightarrow\infty}\int_0^nne^{-nx}\frac{\cos x}{\sqrt{x^2+1}}dx=1+0=1$$ So our strategy in both cases was to find an estimate of the integrand valid in the region where it mattered and integrate the estimate.