Note
$$2\sin\frac x2(\cos x + \cos2x+\cos3x+...+\cos10x)
= \sin\frac{21x}2-\sin\frac x2 $$
Then,
$$\begin{align}
\int_0^\pi \frac{\sin\frac{21x}{2}}{\sin \frac x2}{\rm d}x
=&\int_0^\pi(1+2\cos x + 2\cos2x+...+2\cos10x){\rm d}x\\
=&\pi + (0+0+...+0)\\
=&\pi \end{align}$$
Let $f(x)$ denote the egregious fraction of sines inside the square. Writing $w = e^{2ix}$, we have
\begin{align*}
f(x)
&:= \frac{(\sin 2x)(\sin 3x)(\sin 5x)(\sin 30x)}{(\sin x)(\sin 6x)(\sin 10x)(\sin 15x)} \\
&= w^{-4} \underbrace{ \frac{(w^2 - 1)(w^3 - 1)(w^5 - 1)(w^{30} - 1)}{(w - 1)(w^6 - 1)(w^{10} - 1)(w^{15} - 1)} }_{=:g(w)}.
\end{align*}
Writing the fraction part in the last line as $g(w)$, algebraic manipulation using the finite geometric series formula yields
\begin{align*}
g(w)
= \frac{(w + 1)(w^{15} + 1)}{(w^3 + 1)(w^5 + 1)}
= \frac{w^{10} - w^5 + 1}{w^2 - w + 1}
= w^8 + w^7 - w^5 - w^4 - w^3 + w + 1,
\end{align*}
where we utilized the long division in the last step.1) Now, we write
$$ g(w) = \sum_{k\geq 0} a_k w^k $$
for simplicity. Then by noting that $f(x)$ is real-valued,
\begin{align*}
\int_{0}^{\pi} f(x)^2 \, \mathrm{d}x
&= \int_{0}^{\pi} f(x)\overline{f(x)} \, \mathrm{d}x \\
&= \int_{0}^{\pi} \left( e^{-8ix} g(e^{2ix}) \right) \overline{\left( e^{-8ix} g(e^{2ix}) \right)} \, \mathrm{d}x \\
&= \sum_{j,k} a_j \overline{a_k} \int_{0}^{\pi} e^{2ix(j-k)} \, \mathrm{d}x \\
&= \pi \sum_{k \geq 0} |a_k|^2 \\
&= 7\pi.
\end{align*}
1) Alternatively, if OP is familiar with some abstract algebra, we can proceed as below:
\begin{align*}
g(w)
= \prod_{d \mid 30} (w^d - 1)^{\mu(30/d)}
= \Phi_{30}(w)
= w^8 + w^7 - w^5 - w^4 - w^3 + w + 1,
\end{align*}
where $\mu$ is the Möbius function and $\Phi_n$ is the cyclotomic polynomial.
Best Answer
Let $x=nt$ and then \begin{eqnarray} &&\frac{1}{n} \int_{0}^{n} \cos^2\left(\frac{\pi x^2}{\sqrt{2}}\right) \,\textrm{d}x \\ &=&\frac12 + \frac12\int_0^1\cos\left(\sqrt2\pi n^2t^2\right) \textrm{d}t\\ &=&\frac12 + \frac12\int_0^1\frac{1}{2\sqrt2\pi n^2t}\textrm{d}\sin\left(\sqrt2\pi n^2t^2\right)\\ &=&\frac12 + \frac{1}{4\sqrt2\pi n^2t}\sin\left(\sqrt2\pi n^2t^2\right)\bigg|_0^1+\frac{1}{4\sqrt2\pi n^2}\int_0^1\frac{\sin\left(\sqrt2\pi n^2t^2\right)}{t^2}\textrm{d}x. \end{eqnarray} Note $$ \frac{1}{4\sqrt2\pi n^2t}\sin\left(\sqrt2\pi n^2t^2\right)\bigg|_0^1=\frac{1}{4\sqrt2\pi n^2}\sin\left(\sqrt2\pi n^2\right). $$ Since $$\frac{1}{4\sqrt2\pi n^2}\bigg|\frac{\sin\left(\sqrt2\pi n^2t^2\right)}{t^2}\bigg|\le\frac14,$$ one has, by DCT, $$ \lim_{n\to\infty}\frac{1}{4\sqrt2\pi n^2}\int_0^1\frac{\sin\left(\sqrt2\pi n^2t^2\right)}{t^2}\textrm{d}x=\int_0^1\lim_{n\to\infty}\frac{1}{4\sqrt2\pi n^2}\frac{\sin\left(\sqrt2\pi n^2t^2\right)}{t^2}\textrm{d}x=0.$$ So $$\lim_{n\to\infty} \frac{1}{n} \int_{0}^{n} \cos^2\left(\frac{\pi x^2}{\sqrt{2}}\right) \,\textrm{d}x = \frac{1}{2}. $$