# Fourier, square sign wave, f(x)sin(kx) integration

I'm not sure whether to put this here or in Linear Algebra, if any Mod feels it should go in Linear Algebra I won't mind.

I've just been introduced to Fourier Series decompositions in my Linear Algebra text, and I understand all the core concepts so far from the Linear Algebra side of it (a function space, where orthonormal bases allow you to isolate and solve for individual coefficients in a given Fourier Series).

At the end of the decomposition ones sees (nb: $\pi$ is the length of any given base)

$$b_k = \frac{1}{\pi}\int_0^{2\pi}f(x)sin(kx)dx$$

where $f(x) =\left\{\begin{matrix}1, \ \ 0\leq x < \pi \\-1, \ \ \pi \leq x \leq 2\pi \end{matrix}\right.$

I tried a number of approaches involving integration by parts using values of integration between certain ranges of the square wave $f(x)$ taken by inspection, but these attempts have lead nowhere.

The text simply tells me that $\int_0^{2\pi}f(x)sin(kx)dx = \frac{4}{k}$ for odd k. It doesn't really explain how it came to that result, though it did earlier mention something about $$1 = \frac{4}{\pi}\left(1 - \frac{1}{3} + \frac{1}{5} - \frac{1}{7} + \frac{1}{9} - ... \right)$$ but I don't see exactly how that fits in...I can see something similar happening in there, but I'm not sure what.

Furthermore, for $f(x)sin(x)$, I can see that they are both odd functions, and that as such, over the same range, and given the definition of $f(x)$ that in fact $f(x)sin(x) = |sin(x)|$. But that doesn't give the needed $\frac{4}{k}$ and doesn't help with $f(x)sin(kx)$.(edit: my bad it does give 4/k...was this correct then? It must be...ok, but is there a general case?)

How have they arrived at $\int_0^{2\pi}f(x)sin(kx)dx = \frac{4}{k}$, and how do I approach evaluating the numerator in these equations for solving Fourier Series coefficients in general?

Last edited:

BvU
f(x)\sin(x) = |\sin(x)|## doesn't help much. Try going the way $$\int_0^{2\pi}f(x)\sin(kx)dx = 2 \int_0^{\pi}f(x)\sin(kx)dx = 2 \int_0^{\pi}\sin(kx)dx = \\ \qquad {2\over k} \int_0^{k\pi}\sin(kx)d(kx) = {2\over k} \cos(kx) \Bigg |^0_{k\pi} = \frac{4}{k}$$
• 