In my text book I have found this two line in an example: $$ y(t)=\frac{2}{1+j}e^{jt}+\frac{2}{1-j}e^{-jt}-\frac{1}{1+j2}e^{j2t}-\frac{1}{1-j2}e^{-j2t}$$ $$=2\sqrt{2}cos(t-45^\circ)-\frac{2}{\sqrt{5}}cos(2t-63^\circ)$$
How this mathematical calculation done directly? What procedure it is? What is it called ?
FYI: I tried to find something about it by googling but only get complex exponential to sine/cosine conversion.
Let us look at the first term $$A=\frac{2}{1+i}e^{it}+\frac{2}{1-i}e^{-it}$$ First of all $$\frac{1}{1+i}=\frac{1}{1+i}\frac{1-i}{1-i}=\frac{1-i}{1-i^2}=\frac{1-i}{2}$$ Similarly,$$\frac{1}{1-i}=\frac{1}{1-i}\frac{1+i}{1+i}=\frac{1+i}{1-i^2}=\frac{1+i}{2}$$ Now, remember Euler formula $$e^{it}=\cos(t)+i\sin(t)$$ $$e^{-it}=\cos(t)-i\sin(t)$$ Replacing, we then have $$A=2 \frac{1-i}{2}\big(\cos(t)+i\sin(t)\big)+2 \frac{1+i}{2}\big(\cos(t)-i\sin(t)\big)$$ Now expand and simplify to get $$A=2 \big(\sin (t)+ \cos (t)\big)$$ Now remember what are $\sin(x+\frac \pi 4)$ and $\cos(x+\frac \pi 4)$