Determining the Fourier series of a given function (Verification)

87 Views Asked by At

Determine the Fourier series for the function $$f(x)=\begin{cases} &0 \quad -\pi \leq x \leq 0\\ &e^{x} \quad 0 \leq x\leq\pi \end{cases}$$

Here is what I have come up with; I first calculated (using integration by parts) $$a_{n}=\frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\cos{nx}dx \\=\frac{1}{\pi}\int_{0}^{\pi}e^{x}\cos{nx}dx \\=\frac{e^{\pi}n\sin{\pi n}+e^{\pi}\cos{\pi n}-1}{\pi(n^{2}+1)}\\=\frac{e^{\pi}(-1)^{n}-1}{\pi(n^{2}+1)}$$

When $n=0$ we have $a_{0}=\frac{e^{\pi}-1}{\pi}$. Then I calculated $b_{n}$ $$b_{n}=\frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\sin{nx}dx \\ =\frac{1}{\pi}\int_{0}^{\pi}e^{x}\sin{nx}dx \\ =\frac{n+e^{\pi}\sin{\pi n}-e^{\pi}n\cos{\pi n}}{\pi(n^{2}+1)} \\ = \frac{n(1+e^{\pi}(-1)^{n})}{\pi(n^{2}+1)}$$

Thus, I am incline to answer that the Fourier serie for the given function is $$f \sim \frac{e^{\pi}-1}{2\pi}+\sum_{n=1}^{\infty}\left[\frac{e^{\pi}(-1)^{n}-1}{\pi(n^{2}+1)}\cos{nx}+\frac{n(1+e^{\pi}(-1)^{n})}{\pi(n^{2}+1)}\sin{nx}\right]$$

Now, since I don't have any previous experience of dealing with these kind of problems I'm unsure as to whether or not this is right. Would anyone be so kind as to tell me whether it is right or not. Thanks!

1

There are 1 best solutions below

1
On BEST ANSWER

I think that this is mostly correct. However in your $b_n$ calculation you have a minus sign mixed up. Note:

$\frac{n+e^{\pi}\sin(n\pi) - e^\pi n \cos(n\pi)}{\pi(n^2+1)} = \frac{n(1-e^\pi (-1)^n)}{\pi (n^2+1)}=\frac{n(1+e^{\pi}(-1)^{n+1})}{\pi (n^2+1)}$.

Other than that I think it is right good job!

For the future one good way to test these Fourier series is to plot a few modes with your favorite software. You will have some Gibbs Phenomenon stuff where there is a discontinuity, but other than that it should match up well.