I am working through and reviewing some of the examples presented on Fourier analysis from a Modern Digital and Analog Communication Systems book. In one of the examples, the author goes through the Fourier series of the exponential function $e^\frac{-t}{2}$ from $0$ to $\pi$.
My result of $a_0$ matches its result of $a_0=0.504$; however, my result for $a_n$ was $a_n=0.792\left(\frac2{1+16n^2}\right)$ and the book is $a_n=0.504\left(\frac2{1+16n^2}\right)$. I am trying to figure out, what am I doing wrong?
So doing integration by parts twice to find $a_n$, I get to the point in which I have:
$a_n=\frac2\pi\int_0^\pi$$e^\frac{-t}{2}\cos(2nt)dt=-\frac{1}{4\pi n^2}e^\frac{-t}{2}\cos(2nt)\vert_0^\pi-\frac{1}{8\pi n^2}\int_0^\pi$$e^\frac{-t}{2}\cos(2nt)dt$ , and then, I have:
$\left(\frac2\pi +\frac{1}{8\pi n^2}\right)\int_0^\pi$$e^\frac{-t}{2}\cos(2nt)dt=-\frac{1}{4\pi n^2}e^\frac{-t}{2}\cos(2nt)\vert_0^\pi$.
Doing some additional calculations I get:
$\left(\frac{16\pi n^2 + \pi}{8\pi^2 n^2}\right)\int_0^\pi$$e^\frac{-t}{2}\cos(2nt)dt=-\frac{1}{4\pi n^2}[e^\frac{-\pi}{2}\cos(2n\pi)-e^\frac{0}{2}\cos(0)]=-\frac{1}{4\pi n^2}[e^\frac{-\pi}{2}-e^0]$.
And finally:
$a_n=\frac2\pi\int_0^\pi$$e^\frac{-t}{2}\cos(2nt)dt=\frac{0.792}{4\pi n^2}\left[\frac{8\pi^2 n^2}{\pi(1+ 16n^2)}\right]=\frac{0.792}{4\pi}\left[\frac{8\pi}{(1+ 16n^2)}\right]=0.792\left(\frac{2}{1+ 16n^2}\right)$
Any help would be greatly appreciated!
integrator program from wolfram side shows me following result
please check what is mistake
we may put following substitution
$y=-x/2$
that means that $dy=-dx/2$
also $x=-2*y$
so we have following form
$\int(-2*((e^y*cos(-2*n*2*y)))dy$
now you can easily integrate by part