4

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!!!

rain
  • 793

3 Answers3

6

$$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}$$

amWhy
  • 209,954
Siong Thye Goh
  • 149,520
  • 20
  • 88
  • 149
1

$f(x)=x^2$

$a_n=\frac{2}{\pi}\int^{\pi}_0 x^2 \cos{nx} . dx=\frac {2}{\pi} x^2\frac{ sin{nx}}{n}|^{\pi}_0 -\frac{2}{n\pi}\int^{\pi}_0 x .sin {nx . dx}=\frac{4}{n\pi}. x , \frac{cos nx}{n}|^\pi_0-\frac{4}{n^2\pi}.\int^\pi _0 cos nx. dx=(-1)^n . \frac{4}{n^2}$

In interval $[-\pi, \pi] $ (including ending point) we have:

$x^2=\frac{\pi^2}{3}-4[\frac{cos x}{1^2}-\frac{cos2 x}{2^2}+\frac{cos 3x}{3^2}-\frac{cos4 x}{4^2} + . . .]^\pi _-{\pi}$

And for $x={\pi}$ we have:

$\frac{1}{1^2}+\frac{1}{2^2}+\frac{1}{3^2}+ . . . =\frac{\pi^2}{6}$

For $x=0$ we have:

$\frac{1}{1^2}-\frac{1}{2^2}+\frac{1}{3^2}-\frac{1}{4^2} . . .\frac{(-1)^{n-1}}{n^2} =\frac{\pi^2}{12}$

sirous
  • 10,751
0

We have $\cos (n\pi)=(-1)^n $, hence $a_n=? $

Fred
  • 77,394