1
$\begingroup$

Consider the function $$ f(x):=\begin{cases}x(\pi-x), & x\in [0,\pi]\\-x(\pi +x), & x\in [-\pi,0]\end{cases} $$ and calculate its trigonometric Fourier series.

Hello! So my task is to calculate $$ \frac{a_0}{2}+\sum_{k=1}^{\infty}(a_k\cos(kx)+b_k\sin(kx)). $$

I already calculated $a_0$ and $a_k$, I hope my results are correct, it was rather much calculation: $$ a_0=\frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\, dx=\frac{\pi^2}{3} $$ and $$ a_k=\frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\cos(kx)\, dx=\frac{2\pi(\cos(k\pi)-1)}{k^2}+\frac{4\sin(k\pi)}{k^3} $$

Before calculating $b_k$ and what is needed furthermore I would like to know if my recent results are correct.

Maybe anyone can say me?

$\endgroup$
1
$\begingroup$

First of all, you should be able to reduce $a_k, b_k$ to an expression involving only $k$, not an expression in $\cos(k\pi)$, etc.

I get $a_0=\pi^2/3$ (like you) and $$a_k = \frac{\pi}{k^2}\left( (-1)^{k+1} -1 \right),$$ but my calculations may have an error of course.

You can simplify calculations a lot by noting $f$ is even. This also means that you don't have to calculate $b_k$. Every even function will have $b_k = 0$ for all $k$!

$\endgroup$
8
  • $\begingroup$ Why is $f$ even? I do not see that $f(x)=f(-x)$. $\endgroup$ – math12 Nov 27 '13 at 12:35
  • $\begingroup$ @math12 Well, one way to see it is that you can view the function $f$ as being defined by first defining it on $[0,\pi]$ and then extending it to $[-\pi, 0]$ just by defining $f(x) = f(-x)$. Just plug it in to check that. (The expression on $[-\pi,0]$ is just the same expression as on $[0,\pi]$, except plugging in $-x$ for $x$.) $\endgroup$ – Eric Auld Nov 27 '13 at 12:38
  • $\begingroup$ Ok, I see: Consider f.e. $x\in [0,\pi]$, then $f(x)=x(\pi-x)$ and $-x\in [-\pi,0]$ and therefore $f(-x)=-(-x)(\pi+(-x))=x(\pi-x)$. $\endgroup$ – math12 Nov 27 '13 at 12:44
  • 1
    $\begingroup$ @math12 I'd rather not write it out...but first split up the integral into $2\int_0^\pi$. Then integrate by parts, the boundary term is zero since $\sin$ is zero at $0,\pi$. Then integrate by parts again, the boundary term is not zero this time. The final integral you get will be zero, though, since the integral of $\lambda\cos(kx)$ over $[0,\pi]$ is zero. Remember that $\cos(k\pi) = (-1)^k$! $\endgroup$ – Eric Auld Nov 27 '13 at 12:47
  • 1
    $\begingroup$ My calculations don't agree and plotting the partial sum of the fourier series confirms that it's close but not correct. $\endgroup$ – 0912 Nov 27 '13 at 13:09
1
$\begingroup$

Your $a_0$ seems to be correct, but $a_k$ is not. As Eric Auld said because function is even $b_k$ is zero.

With this type of integral I like to substitute $\cos(kx) = \Re e^{i k x}$. You need to be careful with this type of substitution to make sure that real part can be taken outside of the integral, in this case it can be. Then $a_k$ is:

$$a_k = \frac{1}{\pi}\left(\Re \int_{-\pi}^0 (-x(\pi+x)e^{i k x}\, dx+\Re \int_{0}^\pi (x(\pi-x)e^{i k x}\, dx \right) = -\frac{2(1+(-1)^k)}{k^2}$$

Where I used $\cos(k\pi) = (-1)^k$.

$\endgroup$
4
  • $\begingroup$ I always like to see another way to do a problem. After you switched to complex, did you just integrate by parts? $\endgroup$ – Eric Auld Nov 27 '13 at 13:24
  • 1
    $\begingroup$ I just used computer, but I don't know any other way. Integral of the form $\int x^k e^{ax}$ might be the best known application for partial integration. $\endgroup$ – 0912 Nov 27 '13 at 13:31
  • $\begingroup$ The result of 0912 is correct, because Eric Auld and me forgot the factor $\frac{2}{\pi}$ that arises within the first partial differentiation. $\endgroup$ – math12 Nov 27 '13 at 13:52
  • $\begingroup$ One more question, if you allow: I have to write down the Parseval equation. I have $\frac{\pi^4}{18}\sum_{k=1}^{\infty}\frac{16}{(2k)^4}=\frac{\pi^4}{15}$. Is that right? $\endgroup$ – math12 Nov 27 '13 at 15:00

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.