(cos(3x)+cos(x))/cos(x)+cos(3x)
Answers
Using the identity $e^{i\theta}+e^{-i\theta}=2\cos(\theta)$, you can express the sum of the cosine terms as:-
$\cos(x)+\cos(3x)+\cdots+\cos((2n-1)x)=\frac{1}{2}(\sum_{k=1}^ne^{j(2k-1)x}+\sum_{k=1}^ne^{-j(2k-1)x})$
The right hand side of the above equation is the sum of two Geometric progressions for the complex exponential terms, where
$$\sum_{k=1}^ne^{j(2k-1)x}=\frac{e^{jx}(1-(e^{j2x})^n)}{1-e^{j2x}}=\frac{e^{jx}-e^{j(2n+1)x}}{1-e^{j2x}}$$
$$\sum_{k=1}^ne^{-j(2k-1)x}=\frac{e^{-jx}(1-(e^{-j2x})^n)}{1-e^{-j2x}}=\frac{e^{-jx}-e^{-j(2n+1)x}}{1-e^{-j2x}}$$
This leads (after some algebraic manipulation) to
$\large \sum_{k=1}^ne^{j(2k-1)x}+\sum_{k=1}^ne^{-j(2k-1)x}=\frac{e^{j(2n-1)x}+e^{-j(2n-1)x}-(e^{j(2n+1)x}+e^{-j(2n+1)x})}{2-(e^{j2x}+e^{-j2x})}\\\large=\frac{2\cos((2n-1)x)-2\cos((2n+1)x)}{2(1-\cos(2x))}=\frac{\cos((2n-1)x)-\cos((2n+1)x)}{1-\cos(2x)}$
Using the sum of angles identities for trigonometry (as stated below)
$\cos(a+b)=\cos(a)\cos(b)-\sin(a)\sin(b)$
$\cos(a-b)=\cos(a)\cos(b)+\sin(a)\sin(b)$
$\cos(2a)=\cos^2(a)-\sin^2(a)=1-2\sin^2(a)$
we can further simplify the sum of the two Geometric progressions to
$$ \frac{\cos(2nx)\cos(x)+\sin(2nx)\sin(x)-\cos(2nx)\cos(x)+\sin(2nx)\sin(x)}{1-1+2\sin^2(x)}\\=\frac{2\sin(2nx)\sin(x)}{2\sin^2(x)}=\frac{\sin(2nx)}{\sin(x)}$$
Thus we have
$$ \frac{1}{2}(\sum_{k=1}^ne^{j(2k-1)x}+\sum_{k=1}^ne^{-j(2k-1)x})=\frac{\sin(2nx)}{2\sin(x)}$$
so that the sum of the Cosine terms evaluates as follows:-
$$\cos(x)+\cos(3x)+\cdots+\cos((2n-1)x)=\frac{\sin(2nx)}{2\sin(x)}$$