How is $\cos(x) + \sin(x) = a\cos(x + b)$? I was reading Fourier Analysis - An Introduction
And it says at some point

One can easily verify that there exists $A > 0$ and $\varphi \in \mathbb{R}$ such that
$$a \cos ct + b \sin ct = A \cos (ct - \varphi)$$

I was confused that $\cos x + \sin x$ can be expressed by another $\cos$ because if it’s true then it looks so trivial that it should be taught in elementary trigonometry but I don’t remember it from anywhere.
I even tried plotting $\cos x + \sin x$ graph and it looked awfully identical to $\cos x$ just slightly shifted and scaled.
Is it true that $\cos x + \sin x$ is just another $\cos$?
 A: This really is just an elementary trig result. For any $A$ and $\phi$ we have by the addition formula
\begin{align}
A\cos(ct-\phi)&= A[\cos(ct)\cos(\phi)+\sin(ct)\sin(\phi)]\\
&=[A\cos \phi]\cos(ct)+ [A\sin \phi]\sin(ct).
\end{align}
If we want this to equal $a\cos(ct)+b\sin(ct)$, it is enough to show that there exist $A,\phi$ such that
\begin{align}
a=A\cos\phi \quad \text{and}\quad b=A\sin \phi
\end{align}
If you think geometrically for a moment, the mapping $(A,\phi)\mapsto (A\cos\phi,A\sin\phi)$ from $\Bbb{R}^2\to\Bbb{R}^2$ is surjective (if you fix $A\geq 0$ and let $\phi$ vary then the image is a circle of radius $A$ centered at the origin. So letting $A\geq 0$ vary, you get the entire plane). This surjectivity proves the existence of the desired $A,\phi$.
Typically one writes that the solution is just $A=\sqrt{a^2+b^2}$ and $\phi=\arctan\left(\frac{b}{a}\right)$, but this formula only works in specific cases (such as $a>0,b>0$). If you really want to, you have to treat a few cases separately to get the correct value for $\phi$.

It's the same thing with $\sin$. There exist $B,\phi\in\Bbb{R}$ such that
\begin{align}
a\cos(ct)+b\sin(ct)&=B\sin(ct-\phi).
\end{align}
A: Lets take it general.
$$a \cos x+ b \sin x$$
Multiply and divide it by $\sqrt {a^2+b^2}$
giving
$$ \sqrt{a^2+b^2}\cdot\left[\frac{a\cos x}{\sqrt{a^2+b^2}}+\frac{b\sin x}{\sqrt{a^2+b^2}}\right].$$
Now let's write
$\frac{a}{\sqrt{a^2+b^2}}=\cos y$
and
$\frac{b}{\sqrt{a^2+b^2}}=\sin y$, giving
$$ \sqrt{a^2+b^2}*( \cos x\cdot\cos y+\sin x\cdot\sin y)$$
$$ = \sqrt{a^2+b^2}*\cos(x-y) $$
As you were saying, why its not in elementary classes I don't know your but I am in 11th grade and I have done this topic.
