# Fourier series coefficients for a piecewise periodic function

I have the following question:

The non-zero Fourier series coefficients of the below function will contain: The answer is: $$a_0, b_n, n=1, 3, 5, \cdot \cdot \cdot$$

So I first tried to find some symmetry like if it's even, odd, half wave symmetric but couldn't see any.

Then I tried to find $$b_n$$: $$\int_{-1}^1 (x + 1) \sin\left(\frac{n \pi x}{4}\right) dx + \int_1^3 2 \left(\frac{n \pi x}{4}\right) dx + \int_3^5 (5 - x) \sin\left(\frac{n \pi x}{4}\right) dx$$

$$= -\frac{8 \left(\pi n \cos\left(\frac{n \pi}{4}\right) - 4 \sin\left(\frac{n \pi}{4}\right)\right)}{\pi^2 n^2} + \frac{8 \left(2 \sin\left(\frac{3n \pi}{4}\right) - 2 \sin\left(\frac{5n \pi}{4}\right) + \pi n \cos\left(\frac{3n \pi}{4}\right)\right)}{\pi^2 n^2} + \frac{16 \sin\left(\frac{n \pi}{4}\right) \sin\left(\frac{n \pi}{2}\right)}{\pi n}\tag{1}$$

The actual value is $$\frac 18$$ times the above result(but that doesn't matter right now) because:

$$b_n=\frac 18 \int_T x(t) \sin(nw_0t)dt$$

Here $$w_0=\frac {2\pi}{T}$$ and $$T=8$$, $$T$$ being the fundamental time period.

But again I am stuck. How can I prove that the above expression$$(1)$$ is zero for even $$n$$? Also if someone can show a solution with less calculation and more observation then it would be really helpful.

## 1 Answer

Well, the function jumps from $$0$$ to $$2$$ on the region $$[-1,1]$$, if you subtract 1 (and you found this constant 1 when you wrote $$\int_{-1}^1(x+{\color{red}1})\sin (\dots) dx$$) you end up with an odd function. Therefore the cosine part is all 0, except for the initial one which accounts for subtracting 1.

Also, after subtracting 1, the function satisfies $$F(x+T/2) = -F(x)$$. (probably what you called half-wave symmetric). This kills all the sine integrals when the sine "hits these two parts evenly"; i.e. every even term.

Conclusion: we have $$a_0$$ and $$b_n$$ for odd $$n$$.

• You are spot on with your answer but is subtracting $1$ allowed? – paulplusx Oct 13 '18 at 19:25
• @paulplusx You formalise the process by defining $F(x) := f(x)-1$, and working with $F$ first. Then you know the fourier series for $F$ by the above, $$F = \sum a_n \cos (2\pi nx/T) + b_n \sin (2 \pi nx/T)$$ and now $$f = F+1 = 1 + \sum a_n \cos (2\pi nx/T) + b_n \sin (2\pi nx/T)$$ – Calvin Khor Oct 13 '18 at 19:28
• Wow! It's neat. Thank you so much. Learnt something new today :-) – paulplusx Oct 14 '18 at 9:18