So my function is $y(x)=x^{3} - x\pi^{2}$ for $|x|\le\pi$.
I found out the Fourier coefficients, and now I am asked to compute a specific sum with Parseval's formula.
The issue for me lies on when computing $\frac{1}{2\pi}\int_{-\pi}^{\pi} |x^{3} - x\pi^{2}|^{2} dx$.
How do I handle the absolute value?
As user JeanMarie said in the comments, if $a \in \Bbb{R}$ then $$ |a|^2 = a^2 \tag{1} $$ Indeed, if $a\geq0$ then $|a|=a$ so certainly $(1)$ holds. If $a<0$ then $|a|=-a$ so $|a|^2=(-a)^2=a^2$ and $(1)$ holds also. So we conclude that $(1)$ holds for all $a \in \Bbb{R}$.
Now, as for your integral, making use of $(1)$, we get \begin{align} \| y\|_2^2 &= \frac{1}{2\pi} \int_{-\pi}^{\pi} |x^{3} - x\pi^{2}|^{2} \,dx \\ &= \frac{1}{2\pi}\int_{-\pi}^{\pi} (x^{3} - x\pi^{2})^{2} dx \\ &= \frac{1}{\pi}\int_{0}^{\pi}(x^6-2x^4\pi^2+x^2\pi^4) dx \quad \text{(even integrand)} \\ &= \frac{1}{\pi} \left[\frac{x^7}{7}-\frac{2\pi^2 x^5}{5} + \frac{\pi^4x^3}{3}\right]_{0}^{\pi} \\ &= \frac{1}{\pi} \left(\frac{\pi^7}{7}-\frac{2\pi^7}{5}+ \frac{\pi^7}{3}\right) \\ &= \frac{8 \pi^6}{105} \end{align}