Populate legend items with values from another layer
If we admit that $$\sum_{n=1}^\infty \frac{1}{n^2}=\frac{\pi^2}{6}$$ Then $$\sum_{n=1}^\infty \frac{1}{(2n)^2}=\frac{\pi^2}{24}$$ And, finally : $$\sum_{n=1}^\infty \frac{1}{(2n-1)^2} = \sum_{n=1}^\infty \frac{1}{n^2} - \sum_{n=1}^\infty \frac{1}{(2n)^2} = \frac{3\pi^2}{24} = \frac{\pi^2}{8}$$
If you must use $\cos (x)$, you can focus on zeros of it. $(...,-\frac{(2n-1)\pi}{2},....,-\frac{3\pi}{2},-\frac{\pi}{2},\frac{\pi}{2},\frac{3\pi}{2},...,\frac{(2n-1)\pi}{2},..)$ where $n$ is a positive integer
Hint: $$\cos x = \cdots\left(1+\frac{x}{\frac{3\pi}{2}}\right)\left(1+\frac{x}{\frac{\pi}{2}}\right)\left(1-\frac{x}{\frac{\pi}{2}}\right)\left(1-\frac{x}{\frac{3\pi}{2}}\right)\cdots =\left(1-\frac{x^2}{\frac{\pi^2}{4}}\right)\left(1-\frac{x^2}{\frac{3^2\pi^2}{4}}\right)\cdots$$
Take derivatives of both side and divide to $\cos (x)$ .
Please let me know if you cannot go forward.
EDIT:
$$\frac{\cos' x}{\cos x} =\frac{-\sin x}{\cos x} =\cfrac{\left(-\frac{2x}{\frac{\pi^2}{4}}\right)\left(1-\frac{x^2}{\frac{3^2\pi^2}{4}}\right)\left(1-\frac{x^2}{\frac{5^2\pi^2}{4}}\right)\cdots+\left(1-\frac{x^2}{\frac{\pi^2}{4}}\right)\left(-\frac{2x}{\frac{3^2\pi^2}{4}}\right)\left(1-\frac{x^2}{\frac{5^2\pi^2}{4}}\right)\cdots}{\left(1-\frac{x^2}{\frac{\pi^2}{4}}\right)\left(1-\frac{x^2}{\frac{3^2\pi^2}{4}}\right)\left(1-\frac{x^2}{\frac{5^2\pi^2}{4}}\right)\cdots}$$
$$\frac{\cos' x}{\cos x} =\frac{-\sin x}{\cos x} =-\frac{8x}{\pi^2}[\cfrac{\left(\frac{1}{1}\right)}{\left(1-\frac{x^2}{\frac{\pi^2}{4}}\right)}+\cfrac{\left(\frac{1}{3^2}\right)}{\left(1-\frac{x^2}{\frac{3^2\pi^2}{4}}\right)}+....]$$
Is it clear what I mean now? I believe you can handle after that.