Let $g:\mathbb{R} \rightarrow [0,\infty)$, where $g(x)=x^2$. Calculate $\int gd\lambda$, where $\lambda$ is the lebesgue measure.
I've done the following, but I am not sure if this is correct:
$$\int x^2d\lambda =\lim_{n\rightarrow \infty}\int x^21_{[-n,n]}d\lambda=\lim_{n\rightarrow \infty}R\int_{-n}^{n}x^2dx=\lim_{n\rightarrow \infty}\left(\frac{n^3}{3}-\frac{-n^3}{3}\right)=\infty$$
If $R$ is used to denote the Riemann-Integral, then what you write is correct:
$$ \begin{align} \int x^2d\lambda &=\lim_{n\rightarrow \infty}\int x^21_{[-n,n]}d\lambda \text{ (Monotone Convergence)} \\ &=\lim_{n\rightarrow \infty}R\int_{-n}^{n}x^2dx \text{ (Riemann=Lebesgue for continuous functions on compact intervals)}\\ &=\lim_{n\rightarrow \infty}\left(\frac{n^3}{3}-\frac{-n^3}{3}\right) \\ &=\infty \end{align} $$