Approximating a function to six terms

58 Views Asked by At

Considering the following period function $f(x)$ with period $2\pi$ ( i.e $f(x+2\pi)=f(x))$ $$f(x) = e^x, - \pi \leq x \leq \pi.$$ I have determined the Fourier series of this given function to be, which I believe I have done correctly, $$e^x = \frac{\sinh \pi}{\pi} + \sum_{n=1}^{\infty} (-1)^n\frac{2\sinh \pi}{\pi (n^2+1)} \cos nx - (-1)^n \frac{2n \sinh \pi}{\pi(n^2+1)}\sin nx$$ $$e^x = \frac{\sinh \pi}{\pi} \big[1+2\sum_{n=1}^{\infty}\frac{(-1)^n}{n^2+1} \big](\cos nx - n\sin x)$$ I now need to approximate the function $f(x)$ with a finite Fourier series to six terms. My problem with this is I dont understand what will happen with the $x's$ in the Fourier series I have completed. So say for the first term, $n=1$ we would get, $$ \frac{\sinh \pi}{\pi} \big[1+2\frac{(-1)}{1^2+1} \big](\cos x - \sin x)$$ $$3.67608\big[ 0\big](cosx-sinx)$$ $$ = 0 $$ Then for the second term, $n=2$, $$ \frac{\sinh \pi}{\pi} \big[1+2\frac{(-1)^2}{2^2+1} \big](\cos x - \sin x)$$ $$3.67608\big[ 1.4\big](cosx-sinx)$$ So then how do I solve for the second term. Then finally once I have calculated all the terms up to $n = 6$ do I then add all of them up to approximate the function? or do I just use the value for $n = 6 $

1

There are 1 best solutions below

2
On

Approximating a function means finding a new form of the function that is almost equivalent, but we do it to make it easier.

When doing this, the property of being a function of $x$ does not dissappear. You replaced a complicated function by a sum of six terms, and that's nice and sometimes useful.

However, the roiginal function depends on $x$. It's logical that the series depends of $x$ too. For a given $x$, you will get different values both for the original $e^x$ and the series one.

You may want to do this for certain values, or you may want to leave it like this, anallytically. The point of this approximation is converting a complicated function into an "easy" sum (which usually turns out to be hard), but a sum, after all. A sum of functions, which depend on $x$ as well, but now the functions are meant to be easier.