# Fourier series Coefficients and Wolfram Alpha

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

2) Is it possible to use Wolfram Alpha 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):

\begin{align} x(t) = \begin{cases} 2 & 0 \leq t \leq \frac{T}{2} \\ -1 & \frac{T}{2} < t \leq T \end{cases} \end{align}

My Answers: \begin{align} x(t) = \begin{cases} 2 & 0 \leq t \leq \frac{1}{2} \\ -1 & \frac{1}{2} < t \leq 1 \end{cases} \end{align}

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} + \cdots] + \frac{1}{\pi}[\frac{(\cos4\pi -1) \, \sin(4\pi \, t)}{2} + \frac{(\cos8\pi - 1) \, \sin(8\pi \, t)}{4} + \cdots]$$

• Simplify the constant sines/cosines !
– user65203
Commented Jul 10, 2016 at 8:46

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
Commented Jul 10, 2016 at 9:25
• @joe: depends on your exact defintion of $a_0$.
– user65203
Commented Jul 10, 2016 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
Commented Jul 10, 2016 at 9:31

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