I'm trying to do what Euler did with the $\sin(x)$ for the Basel problem, but for $\cos(x)$. This seems to be leading to an incorrect result.
First, the Taylor series of $\cos(x)$ about $x=0$:
$$\cos(x) = 1-\frac{x^2}{2!}+\frac{x^4}{4!}+\dots \tag{1}$$
Next, we can express $\cos(x)$ as a polynomial:
$$\begin{align}\cos(x) = a(x+\frac{\pi}{2})(x-\frac{\pi}{2})(x+\frac{3\pi}{2})(x-\frac{3\pi}{2}) \dots\\ = a\left(x-\left(\frac{\pi}{2}\right)^2\right)\left(x-\left(\frac{3\pi}{2}\right)^2\right) \dots \end{align}$$ Plugging in $x=0$, we get:
$$a = \frac{1}{\left(\frac{\pi i}{2}\right)^2\left(\frac{3\pi i}{2}\right)^2 \dots}$$ And this gives:
$$\cos(x) = \left(1-\frac{x^2}{\left(\frac{\pi}{2}\right)^2}\right)\left(1-\frac{x^2}{\left(\frac{3\pi}{2}\right)^2}\right)\dots \tag{2}$$
Now, let's compare the coefficients of $x^2$ in equations (1) and (2) gives us:
$$-\frac{1}{2!} = -\left(\frac{1}{\left(\frac{\pi}{2}\right)^2} + \frac{1}{\left(\frac{3\pi}{2}\right)^2} + \dots\right)$$
This leads to:
$$\frac{\pi^2}{8} = \frac{1}{1^2}+\frac{1}{3^2}+\frac{1}{5^2}+\dots$$
But this is obviously incorrect since that sum on the right is $\frac{\pi^2}{12}$.
Where did I go wrong?
This was a mistake on my part. The sum we get in the question is actually correct as Misha pointed out. The alternate method I was using to get the same sum had a bug. I'm adding the correct version here for my own future reference.
We know from the Basel problem:
$$\frac{\pi^2}{6} = \frac{1}{1^2}+\frac{1}{2^2}+\frac{1}{3^2}+\dots$$
Dividing both sides by $2^2$:
$$\frac{\pi^2}{24} = \frac{1}{2^2}+\frac{1}{4^2}+\dots$$
Subtracting the two equations above:
$$\frac{\pi^2}{8} = \frac{1}{1^2}+\frac{1}{3^2}+\dots$$