I am totally new to Fourier series. Here I try to compute the Fourier series for the function $f(x)=x$ over the interval $-\pi\leq x \leq\pi$.

Since $f(x)$ is an odd function:

$a_n=0$ (why is this the case?), $$b_n=\frac{1}{\pi}\int_{-\pi}^\pi f(x)\sin(nx)dx=\frac{1}{\pi}\int_{-\pi}^\pi x\sin(nx)dx$$.

Which means $${ -\dfrac{x\cos(nx)}{n}+\dfrac{\sin(nx)}{n^2}}$$ (There should be a evaluate sign here but I don't know how to type it in latex)

What should I do next?

I am just tracing the steps from this website: http://www.sosmath.com/fourier/fourier1/fourier1.html

I know the end result should be $2(\sin(x)-\dfrac{\sin(2x)}{2}+\dfrac{\sin(3x)}{3}$...)

  • 1
    $\begingroup$ Since $f$ is odd $f(x)\cdot \cos(nx)$ is also odd, thus $a_n=0$ for all $n\in\mathbb{N}$. $\endgroup$ – Fakemistake Mar 2 at 20:19
  • $\begingroup$ Can you elaborate more on this? I am new to Fourier series so I don't know how this point is expounded? Isn't $cos(nx)$ is an even function? $\endgroup$ – James Warthington Mar 2 at 20:20
  • $\begingroup$ $\cos(nx)$ is even, but since $f$ is odd, $f(x)\cos(nx)$ is odd. This is because product of an odd function and an even function is an odd function. Can you see why $f(x)\cos(nx)$ being odd implies that $a_n$ is odd (look at the definition of $a_n$ as an integral)? $\endgroup$ – Minus One-Twelfth Mar 2 at 20:31
  • $\begingroup$ Why is $a_n=0$ when $f(x).\cos(nx)$ is odd? $\endgroup$ – James Warthington Mar 2 at 20:32
  • $\begingroup$ Hint: try and check the definition of $a_n$ as an integral and recall a property of integrating odd functions over symmetric intervals. $\endgroup$ – Minus One-Twelfth Mar 2 at 20:33

What next? We evaluate at those endpoints $\pi$ and $-\pi$. What is $\sin(n\pi)$ for integer $n$? What is $\cos(n\pi)$? Don't be afraid to write down a few to get a sense for the pattern.

Also, look closer at that antiderivative. Make sure of the signs.

  • $\begingroup$ The end result is$\dfrac{2}{n}(-1)^{n+1}\sin(nx)$ $\endgroup$ – James Warthington Mar 2 at 20:31
  • $\begingroup$ The $x$ is a dummy variable. If it's still there, that's not an end result. $\endgroup$ – jmerry Mar 2 at 20:35
  • $\begingroup$ Sorry, a dummy variable? $\endgroup$ – James Warthington Mar 2 at 20:38
  • $\begingroup$ Wait, oops, I was thrown off by your choice of the same name for the variable we integrate over in defining the coefficients and the variable we use for the argument of $f$. It would be clearer to use different letters there. Anyway, you had the right final answer there. The coefficient of $\sin(nx)$ is indeed $\frac2n\cdot (-1)^{n+1}$. But... it doesn't match what you wrote down for the antiderivative.... $\endgroup$ – jmerry Mar 2 at 20:45

By partial integration $$b_n=\frac{1}{\pi}\int_{-\pi}^{\pi}x\sin(nx)dx=-\left.\frac{x\cos(nx)}{n\pi}\right|_{-\pi}^{\pi}+\frac{1}{n\pi}\int_{-\pi}^{\pi}\cos(nx)dx$$ The last integral is zero! The left part is $$-\left.\frac{x\cos(nx)}{n\pi}\right|_{-\pi}^{\pi}=\frac{2}{n}\cdot (-1)^n$$

  • $\begingroup$ Can you do it in a few more steps to show that the last integral is zero? $\endgroup$ – James Warthington Mar 2 at 22:50
  • $\begingroup$ @JamesWarthington No I can't, because another answer is accepted. $\endgroup$ – Fakemistake Mar 3 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.