# Fourier series Coefficients and wolframalpha

1) Please can my answers be checked, including my final Fourier series.

2) Is it possible to use Wolframalpha to check my answers? If so, how will I go about doing this?

Deduce the Fourier series for the following period waveform (the waveform is given for 1 period):

x(t)=\left\{ \begin{align} & 2\quad\quad\quad\quad,0<=t<=T/2 \\ & -1\quad\quad\quad, T/2<=t<=t \\ \end{align} \right.

x(t)=\left\{ \begin{align} & 2\quad\quad\quad\quad,0<=t<=1/2 \\ & -1\quad\quad\quad, 1/2<=t<=1 \\ \end{align} \right.

Calculated the 3 coefficients:

$$a_0 = 1$$ $$a_n = 0$$ $$b_n = \frac{1}{\pi.n}(2+cos\pi.n -3(-1)^2)$$

The final Fourier Series:

$$x(t)=\frac{1}{2} +\frac{1}{\pi}[(5+cos2\pi)sin(2\pi.t) + \frac{(6+cos6\pi).sin(6\pi.t)}{3} + ...] + \frac{1}{\pi}[\frac{(cos4\pi -1).sin(4\pi.t)}{2} + \frac{(cos8\pi-1).sin(8\pi.t)}{4} +...]$$

• Simplify the constant sines/cosines ! – Yves Daoust Jul 10 '16 at 8:46

Except for the constant term (indeed $\frac12$), this is a so-called square waveform, the transform of which is well-know.

For convenience, we first deduce the mean value

$$a_0=\int_0^{1/2}2\,dt-\int_{1/2}^1dt=\frac12.$$

Then the function is odd, so there will be sine terms only, and by symmetry we can integrate on a half period

$$b_n=2\int_0^{1/2}\frac32\sin(2\pi nt)\,dt=-\left.\frac 3{2\pi n}\cos(2\pi nt)\right|_0^{1/2}=-3\frac{\cos(\pi n)-1}{2\pi n}.$$

Only the terms for odd $n$ are nonzero and

$$b_{2m+1}=\frac3{\pi(2m+1)}.$$

• Hi Yves, i'm a little confused. what is the formula that I will have to use for $$a_0$$ and the other coefficients? I thought $$a_0 = 1$$ – joe Jul 10 '16 at 9:25
• @joe: depends on your exact defintion of $a_0$. – Yves Daoust Jul 10 '16 at 9:28
• thanks Sir, so in this case what I did is totally incorrect? Or I should use another formula to for for each coefficient? – joe Jul 10 '16 at 9:31