Originally Posted by

**Failure** Just remember the addition formula for $\displaystyle \cos$, namely (adapted to your problem): $\displaystyle \cos(\omega t+\varphi)=\cos(\omega t)\cos(\varphi)-\sin(\omega t)\sin(\varphi)$.

$\displaystyle \begin{array}{lcll}

x(t)+y(t) &=& \cos(\tfrac{\pi}{2}t)+\sin(\tfrac{\pi}{2}t)\\

&=& \sqrt{2}\big[\cos(\tfrac{\pi}{2}t)\cdot\tfrac{1}{\sqrt{2}}-\sin(\tfrac{\pi}{2}t)\cdot (-\tfrac{1}{\sqrt{2}})\big]

\end{array}

$

Now, if we want this last term to be equal to

$\displaystyle \cos(\tfrac{\pi}{2}t)\cdot\cos(\varphi)-\sin(\tfrac{\pi}{2}t)\cdot\sin(\varphi)=\cos(\tfra c{\pi}{2}t+\varphi)$

we must have that $\displaystyle \cos(\varphi)=\tfrac{1}{\sqrt{2}}$ and $\displaystyle \sin(\varphi)=-\tfrac{1}{\sqrt{2}}$, which leads to $\displaystyle \varphi=-\tfrac{\pi}{4}$. Thus, it follows

$\displaystyle \begin{array}{lcll}

x(t)+y(t) &=& \cos(\tfrac{\pi}{2}t)+\sin(\tfrac{\pi}{2}t)\\

&=& \sqrt{2}\big[\cos(\tfrac{\pi}{2}t)\cdot\tfrac{1}{\sqrt{2}}-\sin(\tfrac{\pi}{2}t)\cdot (-\tfrac{1}{\sqrt{2}})\big]\\

&=& \sqrt{2}\cos(\tfrac{\pi}{2}t-\tfrac{\pi}{4})

\end{array}

$

as desired. More generally, if you want to convert $\displaystyle a\cdot\cos(\omega t)+b\cdot \sin(\omega t)$ to the form $\displaystyle c\cdot \cos(\omega t+\varphi)$, you first factor out $\displaystyle \sqrt{a^2+b^2}$ like this

$\displaystyle a\cdot\cos(\omega t)+b\cdot \sin(\omega t) = \sqrt{a^2+b^2}\cdot \Big[\cos(\omega t)\cdot\tfrac{a}{\sqrt{a^2+b^2}}-\sin(\omega t)\cdot\big(-\tfrac{b}{\sqrt{a^2+b^2}}\big)\Big]

$

and then determine $\displaystyle \varphi$ from the two conditions $\displaystyle \cos(\varphi)= \tfrac{a}{\sqrt{a^2+b^2}} \text{ and } \sin(\varphi)=-\tfrac{b}{\sqrt{a^2+b^2}}$. - In other words: from $\displaystyle \tan(\varphi)=-\tfrac{b}{a}$, which is to say $\displaystyle \varphi = \tan^{-1}(-\tfrac{b}{a})$.