Problem 2. (a) Calculate

$$
\int_{0}^{1} x \sin \left(\pi x^{2}\right) \mathrm{d} x
$$

(b) Calculate

$$
\lim _{n \rightarrow \infty} \frac{1}{n} \sum_{k=0}^{n-1} k \int_{\frac{k}{n}}^{\frac{k+1}{n}} \sin \left(\pi x^{2}\right) \mathrm{d} x
$$
Solution. (a) Making the substitution $t=\pi x^{2}$, the integral becomes

$$
\frac{1}{2 \pi} \int_{0}^{\pi} \sin t \, \mathrm{d} t=\left.\frac{1}{2 \pi}(-\cos t)\right|_{0} ^{\pi}=\frac{1}{\pi}
$$

## 2 points

(b) Let $f:[0,1] \rightarrow \mathbb{R}, f(x)=\sin \left(\pi x^{2}\right)$, and $F:[0,1] \rightarrow \mathbb{R}, F(x)=\int_{0}^{x} f(t) \, \mathrm{d} t$. Then

$$
\begin{aligned}
\frac{1}{n} \sum_{k=0}^{n-1} k \int_{\frac{k}{n}}^{\frac{k+1}{n}} f(x) \, \mathrm{d} x & =\frac{1}{n} \sum_{k=0}^{n-1}\left(k F\left(\frac{k+1}{n}\right)-k F\left(\frac{k}{n}\right)\right) \\
& =\frac{1}{n} \sum_{k=0}^{n-1}\left((k+1) F\left(\frac{k+1}{n}\right)-k F\left(\frac{k}{n}\right)-F\left(\frac{k+1}{n}\right)\right) \\
& =\frac{1}{n}\left(n F(1)-\sum_{k=1}^{n} F\left(\frac{k}{n}\right)\right)=F(1)-\frac{1}{n} \sum_{k=1}^{n} F\left(\frac{k}{n}\right)
\end{aligned}
$$

The desired limit is

$$
F(1)-\int_{0}^{1} F(x) \, \mathrm{d} x=\int_{0}^{1} x F^{\prime}(x) \, \mathrm{d} x=\int_{0}^{1} x f(x) \, \mathrm{d} x=\frac{1}{\pi}
$$

2 points