\(\displaystyle{\sin{{A}}}+{\sin{{B}}}={2}{\sin{{\left(\frac{{{A}+{B}}}{{2}}\right)}}}{\cos{{\left(\frac{{{A}-{B}}}{{2}}\right)}}},\)

\(\displaystyle{\cos{{A}}}+{\cos{{B}}}={2}{\cos{{\left(\frac{{{A}+{B}}}{{2}}\right)}}}{\cos{{\left(\frac{{{A}-{B}}}{{2}}\right)}}}.\)

If A=3x and B=x, \(\displaystyle{\sin{{3}}}{x}+{\sin{{x}}}={2}{\sin{{2}}}{x}{\cos{{x}}},{\cos{{3}}}{x}+{\cos{{x}}}={2}{\cos{{2}}}{x}{\cos{{x}}}.\)

Therefore \(\displaystyle\frac{{{\sin{{3}}}{x}+{\sin{{x}}}}}{{{\cos{{x}}}+{\cos{{3}}}{x}}}={2}{\sin{{2}}}{x}\frac{{\cos{{x}}}}{{2}}{\cos{{2}}}{x}{\cos{{x}}}={\tan{{2}}}{x}\)

\(\displaystyle{\cos{{A}}}+{\cos{{B}}}={2}{\cos{{\left(\frac{{{A}+{B}}}{{2}}\right)}}}{\cos{{\left(\frac{{{A}-{B}}}{{2}}\right)}}}.\)

If A=3x and B=x, \(\displaystyle{\sin{{3}}}{x}+{\sin{{x}}}={2}{\sin{{2}}}{x}{\cos{{x}}},{\cos{{3}}}{x}+{\cos{{x}}}={2}{\cos{{2}}}{x}{\cos{{x}}}.\)

Therefore \(\displaystyle\frac{{{\sin{{3}}}{x}+{\sin{{x}}}}}{{{\cos{{x}}}+{\cos{{3}}}{x}}}={2}{\sin{{2}}}{x}\frac{{\cos{{x}}}}{{2}}{\cos{{2}}}{x}{\cos{{x}}}={\tan{{2}}}{x}\)