$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
\newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
\newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
\newcommand{\dd}{\mathrm{d}}
\newcommand{\ds}[1]{\displaystyle{#1}}
\newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
\newcommand{\ic}{\mathrm{i}}
\newcommand{\mc}[1]{\mathcal{#1}}
\newcommand{\mrm}[1]{\mathrm{#1}}
\newcommand{\on}[1]{\operatorname{#1}}
\newcommand{\pars}[1]{\left(\,{#1}\,\right)}
\newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
\newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
\newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
\newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
Define
$\ds{\bbox[5px,#ffd]{\on{f}\pars{x} =
\left\{\begin{array}{lcl}
\ds{\on{f}\pars{-x}} & \mbox{if} & \ds{x < 0}
\\[1mm]
\ds{x^{2}\pars{x - \pi}^{2}} & \mbox{if} & \ds{0 \leq x \leq \pi}
\\[1mm]
\ds{\on{f}\pars{x - \pi}} & \mbox{if} & \ds{x > \pi}
\end{array}\right.}}$
which is an even and periodic function
of period $\ds{\pi}$ which looks like the following picture:

Lets
$\ds{\on{f}\pars{x} = a_{0} +
\sum_{n = 1}^{\infty}a_{n}\cos\pars{2nx}}$
$$
\mbox{with}\quad
\left\{\begin{array}{lcl}
\ds{\int_{-\pi/2}^{\pi/2}\cos\pars{2mx}\cos\pars{2mx}
\,\dd x} & \ds{=} & \ds{{\pi \over 2}\,\delta_{mn}}
\\[2mm]
\ds{\int_{-\pi/2}^{\pi/2}\cos\pars{2nx}\,\dd x} & \ds{=} & \ds{\pi\,\delta_{n0}}
\end{array}\right.
$$
- $\ds{\int_{-\pi/2}^{\pi/2}\on{f}\pars{x}\,\dd x =
{\pi^{5} \over 30} \implies \bbx{a_{0} =
{\pi^{4} \over 30}}}$.
- $\ds{\int_{-\pi/2}^{\pi/2}\on{f}\pars{x}\cos\pars{2nx}\,\dd x =
-{3\pi \over 2}\,{1 \over n^{4}} \implies \bbx{a_{n} =
-{3 \over n^{4}}}}$.
\begin{align}
\on{f}\pars{x} & =
{\pi^{4} \over 30} -
3\sum_{n = 1}^{\infty}{\cos\pars{2nx} \over n^{4}} =
\bbx{6\sum_{n = 1}^{\infty}
{\sin^{2}\pars{nx} \over n^{4}}}
\label{1}\tag{1}
\\ &
\end{align}
because
$\ds{\sum_{n = 1}^{\infty}{1 \over n^{4}} = {\pi^{4} \over 90}}$.
In plotting the above series ( see (\ref{1}) ), you'll get the above picture again.