0

So i Have created a Fourier as $$f(x)=\frac{1}{3} + \sum^{\infty}_{n=1}(\frac{-4}{n^{2} \pi^{2}}\cos(n \pi x))$$ and i believe i can rearrange this to: $$ f(x) = \frac{1}{3} - \frac{4}{\pi^{2}}\sum^{\infty}_{n=1} \frac{1}{n^2}\cos(n \pi x)$$ Now how would i use this to get a answer for $$S = \sum^{\infty}_{k=1} \frac{1}{k^{2}} $$ So by taking a suitable point x. Can i use x=0, giving $\cos(n \pi x)=1$ Giving the equation: $$f(0)=\frac{1}{3}-\frac{4}{\pi^{2}}\sum^{\infty}_{k=1}\frac{1}{k^{2}}$$ and rearrange this to (using$\quad f(0)=0)$: $$\frac{\pi^{2}}{12} = \sum^{\infty}_{k=1}\frac{1}{k^{2}}$$

Would this be the right final answer for the approximation of this sum? Any help would be appreciated thanks in advance.

Alex M.
  • 35,207

2 Answers2

2

Your 1/3 is wrong. It has to be 2/3: $$ a_0 = \frac 2 P\int_0^P f(x)\,dx = \int_0^2 (2x-x^2)\,dx = \left[x^2 - \frac 1 3 x^3\right]_0^2 = 4 - \frac 8 3 = \frac 4 3. $$ So, $\frac{a_0}2 = \frac 2 3$. For the other coefficients we get $$ a_n = \int_0^2 (2x-x^2)\cos(n\pi x)\,dx = -\int_0^2 x^2\cos(n\pi x)\,dx, $$ because $x\cos(n\pi x)$ is odd with resp. to $1$ (not $0$ as usual). Now, \begin{align*} \int_0^2 x^2\cos(n\pi x)\,dx &= \left[\frac{x^2}{n\pi}\sin(n\pi x)\right]_0^2 - \frac 2{n\pi}\int_0^2 x\sin(n\pi x)\,dx\\ &= -\frac 2 {n\pi}\left( \left[-\frac x {n\pi}\cos(n\pi x)\right]_0^2 + \frac 1 {n\pi}\int_0^2\cos(n\pi x)\,dx \right)\\ &= \frac 4 {n^2\pi^2}, \end{align*} hence $a_n = -4/(n^2\pi^2)$.

  • 2
    This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review – Alex M. Mar 26 '16 at 16:04
  • 3
    @Alex M. If you followed the discussion above, you would realize that you are wrong. The OP knows very well how to integrate and which formulas to use. Everything in his/her calculations is correct, up to a simple small calculation error in the first term. He/she thought that the problem is in the other terms, so didn't pay attention to the first term. This answer makes him/her aware of that he/she was looking at the false place for the error. – Friedrich Philipp Mar 26 '16 at 16:13
  • I do not deny what you are saying, I just say that your remark should have been a comment, not an answer. You might disagree, but please notice that, at the time of writing this, 2 people have upvoted my comment and none yours. Think about it, and please don't take it personally. – Alex M. Mar 26 '16 at 16:32
  • 1
    I thought about it and came to the conclusion that those two people upvoted your comment before I wrote mine. So, they didn't either follow the discussion above. I think this is an answer because it solves OP's problem (in contrast to the other answer which says things OP already knows). However, I edited my answer to point out the issue more clearly. – Friedrich Philipp Mar 26 '16 at 16:35
  • @FriedrichPhilipp in that answer you use L as 2. But if the period is 2. P=2L so shouldn't L=1? If not and L = 2, the Fourier itself changes to $$f(x) = \frac{2}{3} + \sum^{\infty}_{n=1} \frac{8(-1)^{1+n}-8}{n^{2} \pi^{2}}cos(\frac{n \pi x}{2})$$ or not? – Jack Griffiths Mar 26 '16 at 18:45
  • Then from this subbing in f(0)=0 this dosen't give the answer $\frac{ \pi^{2}}{6}$? – Jack Griffiths Mar 26 '16 at 18:51
  • No, your original sum over the cosines was correct. You have$$a_n = \int_0^2f(x)\cos(n\pi x),dx\quad\text{and}\quad f(x) = \frac{a_0}{2} + \sum_{n=1}^\infty a_n\cos(n\pi x).$$Then $a_0 = 4/3$ and $a_n = -4/(n^2\pi^2)$ for $n > 0$. – Friedrich Philipp Mar 26 '16 at 19:08
  • @FriedrichPhilipp in that case though wouldn't it be $cos(\frac{n \pi x}{L})$ and that would mean it would be $cos(\frac{n \pi x}{2})$? – Jack Griffiths Mar 26 '16 at 20:08
  • Based on a follow on question later on it says the Fourier has vanishing terms so that brings me to assume then there needs to be a $(-1)^{n}$ term as when n is even $a_{n}$ would have vanishing terms when this has the 8s in? – Jack Griffiths Mar 26 '16 at 20:12
  • I don't know how you get this $(-1)^n$ when you consider the period $2$. It appears when using period $4$. See http://ocw.mit.edu/courses/mathematics/18-03sc-differential-equations-fall-2011/unit-iii-fourier-series-and-laplace-transform/fourier-series-basics/MIT18_03SCF11_s21_6text.pdf for the correct formulas (there, $L=1$). – Friedrich Philipp Mar 26 '16 at 23:06
0

You have $f(x) = \begin{cases} -2x-x^2, & -2 \leq x <0 \\ 2x-x^2, & 0 \leq x < 2 \end{cases}$. Note that $f(-x) = f(x)$, a fact that will simplify our computations.

The formulae for the Fourier coefficients are:

$$a_0 = \frac 1 2 \int \limits _{-2} ^2 f(x) \textrm d x = \int \limits _0 ^2 f(x) \textrm d x = \frac 4 3 \\ a_n = \frac 1 2 \int \limits _{-2} ^2 f(x) \cos \frac {n \pi x} 2 \textrm d x = \int \limits _0 ^2 f(x) \cos \frac {n \pi x} 2 \textrm d x = -8 \frac {1 + (-1)^n} {n^2 \pi^2} \\ b_n = \frac 1 2 \int \limits _{-2} ^2 f(x) \sin \frac {n \pi x} 2 \textrm d x = 0 .$$

(The last integral is $0$ because it is the integral of an odd integrand over a symmetric interval, no need to compute anything. The value of $a_n$ has been obtained by integrating by parts twice and the interval has been halved because the integrand is even and the interval symmetric.)

Therefore, you may write that (remembering that the first term is $\frac {a_0} 2$)

$$f(x) = \frac 2 3 + \sum \limits _{n=1} ^\infty -8 \frac {1 + (-1)^n} {n^2 \pi^2} \cos \frac {n \pi x} 2 .$$

Since $-8 \frac {1 + (-1)^n} {n^2 \pi^2}$ is $0$ for odd $n$, and $- \frac {16 } {n^2 \pi^2}$ when $n=2k$, the previous formula becomes

$$f(x) = \frac 2 3 - \frac {16} {\pi^2} \sum \limits _{k=1} ^\infty \frac {\cos (k \pi x)} {(2k)^2} = \frac 2 3 - \frac 4 {\pi^2} \sum \limits _{k=1} ^\infty \frac {\cos (k \pi x)} {k^2} .$$

Take now $x=0$ making all the numerators inside the series equal to $1$. Then

$$0 = \frac 2 3 - \frac 4 {\pi^2} \sum \limits _{k=1} ^\infty \frac 1 {k^2}$$

which can be rearranged as

$$\frac {\pi^2} 6 = \sum \limits _{k=1} ^\infty \frac 1 {k^2}$$

(notice that it is $\frac {\pi^2} 6$, not $\frac {\pi^2} {12}$ as you wrote in your question).

Alex M.
  • 35,207
  • If you use the period $2$ (the function is $2$-periodic), you get $4$ instead of $8((-1)^k+1)$. – Friedrich Philipp Mar 26 '16 at 23:04
  • @FriedrichPhilipp: If you really want to be rigorous, notice that $f$ is defined on $(-2,2)$ and then extended to the whole of $\Bbb R$ by periodicity, so the period is $2 - (-2) = 4$, not $2$. You are getting an eroneous result because you use $n \pi x$ inside of your trigonometric functions, instead of the correct $\frac {n \pi x} 2$. – Alex M. Mar 27 '16 at 14:14
  • @Alex M. Just to make you understand: The function is 2-periodic because $f(x+2) = f(x)$ for $x\in [-2,0)$. If you want to use the period $4$, that's fine. The formulas are different, but the results for the Fourier expansion will be the same. They just look a little different. – Friedrich Philipp Mar 27 '16 at 17:15