# Why does Fourier Series have $\sin$ and $\cos$ Components

While we look at Fourier Series there are both $\sin$ and $\cos$ components.But I think $\sin$ component is ony needed to describe wave.why there is also an $\cos$ component in Fourier Series?

$S_n(x)$=$A_0 + \sum_{n = 1}^{\infty} (A_n\cos(nx) + B_n\sin(nx))$

• Hai Justin I'm Kevin I have joined stackexchange. I hope it has something to do with phase difference but keep on looking for other comments – user11629 Nov 7 '14 at 7:04

Note that the value of the series

$$\sum_{n=1}^{\infty}B_n\sin(nx)\tag{1}$$

for $x=0$ is always zero, regardless of the coefficients $B_n$ (assuming convergence). Furthermore, since the functions $\sin(nx)$ are odd, (1) can only represent odd functions. So you cannot represent general functions with the series (1). This is why you also need the cosine terms. As an alternative, you could as well use a representation with phases in the argument of the sine:

$$f(x)=A_0+\sum_{n=1}^{\infty}C_n\sin(nx+\phi_n)\tag{2}$$

In this case you don't need any cosine terms because of the phases $\phi_n$. The representation in (2) is equivalent to the series in your question using sine and cosine terms. You can see this by using the identity $\sin(\alpha+\beta)=\cos\alpha\sin\beta+\sin\alpha\cos\beta$:

$$\sum_{n=1}^{\infty}C_n\sin(nx+\phi_n)=\sum_{n=1}^{\infty}\left[C_n\sin\phi_n\cos(nx)+C_n\cos\phi_n\sin(nx)\right]$$

So the coefficients $A_n$ and $B_n$ in your question are

$$A_n=C_n\sin\phi_n\\ B_n=C_n\cos\phi_n$$

And the other way around you have

$$C_n=\sqrt{A_n^2+B_n^2}\\ \phi_n=\arctan\left(\frac{A_n}{B_n}\right)\quad(\pm\pi)$$

• whether there would be a case in which we have to use both the $\cos$ and $\sin$ components in fourier series? – justin Nov 7 '14 at 9:21
• @justin: As I said in my answer, if you have a function that is not odd (and also not even), then you need both terms, or only one term with phases, as in Eq. (2) of my answer. – Matt L. Nov 7 '14 at 9:22
• could you cite a function that wouldn't neither be odd nor even. – justin Nov 7 '14 at 9:24
• @justin: $f(x)=\sin(x+\pi/4)$ – Matt L. Nov 7 '14 at 9:25
• :could you say why it is neither even nor odd. – justin Nov 7 '14 at 9:29