Evaluating a summation of inverse squares over odd indices $$ \sum_{n=1}^\infty \frac{1}{n^2}  = \frac{\pi^2}{6}$$
I want to evaluate this sum when $n$ takes only odd values.
 A: This can be shown in a similar way to Euler's proof of $\zeta(2) = \frac{\pi^2}{6}$, which starts with the function $\frac{\sin(x)}{x}$
(i.e. the sinc function). Here we start with the cosine function which can be expressed as the infinite product
\begin{align}
\cos(x) &= \prod_{n=1}^\infty \left(1-\frac{4x^2}{\pi^2(2n-1)^2}\right) \\
 &= \left(1- \frac{4x^2}{\pi^2}\right)\left(1- \frac{4x^2}{9\pi^2}\right)\left(1- \frac{4x^2}{25\pi^2}\right) ... \\
&=1-x^2\left(\frac{4}{\pi^2}+\frac{4}{9\pi^2}+\frac{4}{25\pi^2}+...\right)+...
\end{align}
$\cos(x)$ can also be expressed by the following Maclaurin series expansion:
$$\cos(x) = \sum_{n=1}^\infty \frac{(-1)^n}{(2n)!}x^{2n} = 1-\frac{x^2}{2!}+\frac{x^4}{4!}-\frac{x^6}{6!} +...$$ 
Comparing the $x^2$ coefficients gives:
$$-\frac{1}{2!} = -\frac{4}{\pi^2}\left(1+\frac{1}{9} + \frac{1}{25} + ...\right)$$
Thus,
$$\sum_{n=1}^\infty \frac{1}{(2n-1)^2} = \frac{\pi^2}{8}$$
A: 
Here, we present a way forward that does not require prior knowledge of the value of the series $\sum_{n=1}\frac{1}{n^2}=\frac{\pi^2}{6}$, the Riemann-Zeta Function, or dilogarithm function.  Rather, we apply straightforward analysis that includes application of the residue theorem.

To that end, note that we can write the series of interest as
$$\begin{align}
\sum_{n=0}^\infty \frac{1}{(2n+1)^2}&=\sum_{n=1}^N \int_0^1 x^{2n}\,dx\int_0^1y^{2n}\,dy\\\\
&=\int_0^1\int_0^1 \sum_{n=0}^\infty(x^2y^2)^n\,dx\,dy\\\\
&=\int_0^1\int_0^1 \frac{1}{1-x^2y^2}\,dx\,dy\\\\
&=\frac12\int_0^1\frac{\log(1+x)-\log(1-x)}{x}\,dx\tag 1
\end{align}$$
Then, we enforce the substitution $x\to \frac{x-1}{x+1}$ in $(1)$ to obtain
$$\frac12\int_0^1\frac{\log(1+x)-\log(1-x)}{x}\,dx=\int_1^\infty \frac{\log(x)}{x^2-1}\,dx\tag 2$$
Next, enforcing the substitution $x\to 1/x$ in $(2)$ reveals
$$\int_1^\infty \frac{\log(x)}{x^2-1}\,dx=\int_0^1 \frac{\log(x)}{x^2-1}\,dx \tag 3$$
Adding $(2)$ and $(3)$ and dividing by $(2)$ yields
$$\sum_{n=0}^\infty \frac{1}{(2n+1)^2}=\frac12\int_0^\infty \frac{\log(x)}{x^2-1}\,dx$$

Moving to the complex plane, we evaluate the integral $J$ defined by 
$$J=\oint_C \frac{\log^2(z)}{z^2-1}\,dz$$
where $C$ is the classical keyhole contour with (i) the branch cut along the non-negative real axis and (ii) with deformations around $z=1$.  Applying the residue theorem, it is easy to see that $J=i\pi^3$.  Therefore, we find that 
$$\begin{align}
J&=i\pi^3\\\\
&=\int_{0}^{\infty}\frac{\log^2(x)}{x^2-1}\,dx-\text{PV}\int_0^\infty \frac{\left(\log(x)+i2\pi\right)^2}{x^2-1}\,dx\\\\
&=-i4\pi\int_0^\infty \frac{\log(x)}{x^2-1}\,dx\\\\
&+\color{blue}{(4\pi^2)\text{PV}\left(\int_0^\infty \frac{1}{x^2-1}\,dx\right)}\\\\
&+\color{red}{(4\pi^2)\lim_{\epsilon \to 0^+}\int_{\pi}^{2\pi} \frac{1}{(1+\epsilon e^{i\phi})^2-1}\,(i\epsilon e^{i\phi})\,d\phi}\\\\
&=-i4\pi\int_0^\infty \frac{\log(x)}{x^2-1}\,dx+\color{blue}{0}+\color{red}{i2\pi^3}\tag 4
\end{align}$$
Finally, solving $(4)$ for the integral of interest yields
$$\frac12\int_0^\infty \frac{\log(x)}{x^2-1}\,dx=\frac{\pi^2}{8}$$ 
and hence we find that the series of interest is 
$$\bbox[5px,border:2px solid #C0A000]{\sum_{n=0}^\infty \frac{1}{(2n+1)^2}=\frac{\pi^2}{8}}$$
A: Note that
$$\sum_{n \text{ is even}} \dfrac1{n^2} = \sum_{k=1}^{\infty} \dfrac1{(2k)^2} = \dfrac14 \sum_{k=1}^{\infty} \dfrac1{k^2} = \dfrac{\zeta(2)}4$$
Also,
$$\sum_{k=1}^{\infty} \dfrac1{k^2} = \sum_{k \text{ is odd}} \dfrac1{k^2} + \sum_{k \text{ is even}} \dfrac1{k^2}$$
Hence,
$$\sum_{k \text{ is odd}} \dfrac1{k^2} = \dfrac34 \zeta(2)$$
A: This is found using Fourier series in Brown and Churchill's Fourier Series and Boundary Value Problems by expanding $$f(x)=\begin{cases}x & 0<x<\pi\\
0 & -\pi<x\leq 0
\end{cases}
$$
into 
$$\frac{a_0}{2}+\sum_{n=1}^{\infty}\Big[a_n\cos(nx)+b_n\sin(nx)\Big],$$
a Fourier series that converges to $f$ when $-\pi<x<\pi$, its periodic extension over values of $x$ at which the periodic extension is continuous, and the mean value of one-sided limits of the periodic extension at discontinuities. 
The coefficient $a_n$ is 
\begin{align}
a_n&=\frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\cos(nx)dx\\
&=\frac{1}{\pi}\int_{0}^{\pi}x\cos(nx)dx+\frac{1}{\pi}\int_{-\pi}^{0}0\cos(nx)dx.
\end{align}
When $n\neq 0$, integration by parts gives us
\begin{align}a_n&=\frac{1}{\pi}\Big[\frac{1}{n}x\sin(nx)\Big|_0^{\pi}-\int_0^\pi\frac{1}{n}\sin(nx)dx\Big]\\
&=\frac{1}{\pi}\Big[0+\frac{1}{n^2}\cos(nx)\Big|_0^{\pi}\Big]\\
&=\frac{1}{\pi n^2}(\cos(n\pi)-\cos(0))\\
&=\frac{(-1)^n-1}{\pi n^2}.
\end{align}
When $n=0$, 
\begin{align}
a_n&=\frac{1}{\pi}\int_{0}^{\pi}x\cos(0x)dx\\
&=\frac{1}{\pi}\int_{0}^{\pi}xdx\\
&=\frac{1}{\pi}\big(\frac{1}{2}x^2\Big|_{0}^{\pi}\big)\\
&=\frac{1}{2\pi}\pi^2\\
&=\frac{\pi}{2}.
\end{align}
The coefficient $b_n$ is 
\begin{align}
b_n&=\frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\sin(nx)dx\\
&=\frac{1}{\pi}\int_{0}^{\pi}x\sin(nx)dx+\frac{1}{\pi}\int_{-\pi}^{0}0\sin(nx)dx.
\end{align}
Again using integration by parts, this becomes 
\begin{align}
b_n&=\frac{1}{\pi}\Big[\frac{-1}{n}x\cos(nx)\Big|_{0}^{\pi}-\int_0^{\pi}\frac{-1}{n}\cos(nx) \Big]\\
&=\frac{1}{\pi}\Big[\frac{-\pi}{n}\cos(\pi n)+\frac{1}{n^2}\sin(nx)\Big|_0^{\pi} \Big]\\
&=\frac{-1}{n}\cos(\pi n)\\
&=\frac{(-1)^{n+1}}{n}.
\end{align}
So we have $$\frac{\pi}{4}+\sum_{n=1}^{\infty}\Big[ \frac{(-1)^n-1}{\pi n^2}\cos(nx)+\frac{(-1)^{n+1}}{n}\sin(nx)\Big]$$
as our Fourier series.
This converges to $f$ when $x=0$, so 
\begin{align}f(0)=0&=\frac{\pi}{4}+\sum_{n=1}^{\infty}\Big[ \frac{(-1)^n-1}{\pi n^2}\cos(n0)+\frac{(-1)^{n+1}}{n}\sin(n0)\Big]\\
\frac{-\pi}{4}&=\sum_{n=1}^{\infty}\Big[ \frac{(-1)^n-1}{\pi n^2}\cos(n0)+\frac{(-1)^{n+1}}{n}\sin(n0)\Big]\\
&=\sum_{n=1}^{\infty}\frac{(-1)^n-1}{\pi n^2}.
\end{align}
When $n$ is even, $(-1)^n-1=1-1=0$, so the summand will be $0$. Discarding these $0$-summands gives us
\begin{align}
\frac{-\pi}{4}&=\sum_{\substack{n\in \Bbb{N};\\n\text{ odd}}}\frac{(-1)^n-1}{\pi n^2}\\
&=\sum_{\substack{n\in \Bbb{N};\\n\text{ odd}}}\frac{(-1)-1}{\pi n^2}\\
&=\sum_{\substack{n\in \Bbb{N};\\n\text{ odd}}}\frac{-2}{\pi n^2}\\
&=\frac{-2}{\pi}\sum_{\substack{n\in \Bbb{N};\\n\text{ odd}}}\frac{1}{n^2}\\
\frac{\pi^2}{8}&=\sum_{\substack{n\in \Bbb{N};\\n\text{ odd}}}\frac{1}{n^2}.
\end{align}
