Real Analysis – Computing Series Using Fourier Series

analysisfourier seriesreal-analysissequences-and-seriessummation

Suppose that $f$ be defined as $x^2$ on $[-\pi,\pi]$, and then extended to a periodic function on all of $\mathbb{R}$. Express f as a sum of cosine terms and then use it to compute $\sum_{n=1}^{\infty} 1/n^2$.

I feel like something may be off with my Fourier Series.
Computing Fourier Series coefficients,
$$a_n=1/\pi *\int_{-\pi}^{\pi} x^2*cos(nx) dx$$
$$b_n=1/\pi *\int_{-\pi}^{\pi} x^2*sin(nx) dx$$

$b_n$ is always 0 as $f(x)$ is an even function.
Taking n to be 0, I get:$$a_n=1/\pi *\int_{-\pi}^{\pi} x^2 dx=$$=$2\pi^{2}/3$.

Generally computing the integral I get:$$a_n=1/\pi *\int_{-\pi}^{\pi} x^2*cos(nx) dx$$=
enter image description here

Now, this is where I get confused. I know $sin(\pi*n)$ is always 0 for any n. However, the right hand side is $-4/n^2$ when n is odd but when it is even it is $4/n^2$.

If $a_n$ is $ -4/n^2$, then the Fourier series is:
$$f=\pi^2/3-\sum_{n=1}^{\infty} 4/n^2*cos(nx)$$. If I plug in $\pi$, I get $f(\pi)=\pi^2$ and I get this expression above to be $$\pi^2/3-\sum_{n=1}^{\infty}(-1)^n* 4/n^2$$. So I have equating the two $$\sum_{n=1}^{\infty} (-1)^{n+1}4/n^2=2\pi^2/3$$.$$\sum_{n=1}^{\infty} (-1)^{n+1}/n^2=\pi^2/6$$.

I get the alternating series of $1/n^2$ to be $\pi^2/6$.
However, the answer should be $\pi^2/6$ for not the alternating series, but $\sum_{n=1}^{\infty} 1/n^2$=$\pi^2/6$, the alternating series does not equal this.

If I try $a_n$=$4/n^2$, I get the same incorrectly weird answer.

Thus, I believe there is a problem with my $a_n$. If anyone, could help me spot the error, that would be much appreciated. Thank you!!!

Best Answer

$$f=\frac{\pi^2}3+\sum_{n=1}^{\infty} \frac{4\color{blue}{(-1)^n}}{n^2}\cos(nx)$$

As we let $x=\pi$, we have

$$\pi^2=\frac{\pi^2}{3}+\sum_{n=1}^\infty \frac{4}{n^2}$$

$$\sum_{n=1}^{\infty}\frac1{n^2}=\frac{\pi^2}{6}$$

Related Question