Solution (source code)

= Solution

In the convention with constant term $a_0/2$, <Parseval's identity> is
$$
\int_0^{2\pi}y(x)^2dx=\pi\left[\frac{a_0^2}{2}+\sum_{n=1}^{\infty}(a_n^2+b_n^2)\right].
$$
Only the first harmonic contributes here, so
$$
\boxed{\int_0^{2\pi}y(x)^2dx=\pi[(-\sqrt3)^2+1^2]=4\pi.}
$$