Prove that there exists and angle $\alpha$ and $r \in \Bbb R$ such that $a\cos x + b\sin x = r\cos\alpha$ Let's say that we have an expression $a\cos x + b\sin x$ where $a \in \Bbb R$ and $b \in \Bbb R$.
I was learning about finding the minimum and maximum values of an expression of this form for some given value of $a$ and $b$ by expressing it in terms of a single trigonometric function. My textbook did it by assuming that $a = m\sin\phi$ and $b = m\cos\phi$, where $m \in \Bbb R$ and $\phi$ is some angle.

But I couldn't wrap my head  around the fact that any two real numbers can be expressed as the product of another real number and a trigonometric function for some angle.
So, I decided to take another approach which is highly similar to this one.
It is solely based on the assumption that the expression can be expressed in the form of $r\cos\theta$, where $r \in \Bbb R$ and $\theta$ is some angle. Once this assumption is proved, here's how I will continue it :
$$a\cos x + b\sin x = r\cos\theta$$
Let's say that $\theta = \alpha + x$. So :
$$a\cos x + b\sin x = r\cos(\alpha + x) = (r\cos\alpha)\cos x + (-r\sin\alpha)\sin x$$
This gives us the values of $a$ and $b$ as $r\cos\alpha$ and $-r\sin\alpha$ respectively.

So, it would work perfectly if I can prove the assumption mentioned above.
Unfortunately, I haven't been able to prove it yet.
I was successful in proving it's converse, though i.e. for a given expression, say $p\cos\gamma$, where $p \in \Bbb R$ and $\gamma$ is some angle, it can be expressed in the form of $c\cos\delta + d\sin\delta$ where $c \in \Bbb R$, $d \in \Bbb R$ and $\delta$ is some angle.

This is highly similar to what I've stated above (what I'd do once the assumption is proved).

First, we assume that $\gamma = \beta + \delta$, where $\beta$ and $\delta$ are two angles that fit in the equation.
$$\therefore p\cos\gamma = p\cos(\beta + \delta) = p(\cos\beta\cos\delta - \sin\beta\sin\delta) = (p\cos\beta)\cos\delta + (-p\sin\beta)\sin\delta$$
Substituting $p\cos\beta$ by $c$ and $-p\sin\beta$ by $d$, we can arrive at $c\cos\delta + d\sin\delta$.
I don't know if this will be helpful in proving the initial assumption that an expression $a\cos x + b\sin x$ can be expressed as $r\cos\theta$ for some angle $\theta$ and for some real value of $r$.
I'd really appreciate help in proving this.

Thanks!

PS : I'm not familiar with Euler's formula
 A: We begin by observing that
$$a\cos x+b\sin x =\sqrt{a^2+b^2}\left\{\frac{a}{\sqrt{a^2+b^2}}\cdot\cos x +\frac{b}{\sqrt{a^2+b^2}}\cdot\sin x\right\}$$
Now, define $\phi\in[0,2\pi)$ such that
$$\cos\phi=\frac{a}{\sqrt{a^2+b^2}}\text{ and }\sin\phi=\frac{b}{\sqrt{a^2+b^2}}$$
Note that such a value of $\phi$ is unique. Therefore, we have
$$a\cos x + b\sin x =\sqrt{a^2+b^2}\left(\cos\phi \cos x + \sin\phi \sin x\right)=r\cos\alpha$$
with $r=\sqrt{a^2+b^2}$ and $\alpha = \phi-x$. This finishes the proof.
A: Following your initial ideas, let us assume that $\theta=x-\beta$ where $\beta$ is some constant to be found. We therefore have:
$$
a\cos x + b\sin x = r \cos (x-\beta)=r\cos x\cos\beta+r\sin x\sin\beta
$$
If we could find some $\beta$ and some $r$ such that
$$
a \cos x = r\cos x\cos \beta
$$
and
$$
b \sin x = r\sin x\sin \beta
$$
then we can prove your question.
Dividing by $\cos x$, we have
$$\begin{aligned}
a &= r \cos \beta\\
b &= r \sin \beta\\
\end{aligned}
$$
Squaring,
$$\begin{aligned}
a^2 &= r^2\cos^2\beta\\
b^2 &= r^2\sin^2\beta\\
\implies a^2 + b^2 &= r^2(\sin^2\beta + \cos^2\beta)
\end{aligned}
$$
However, we recall the identity:
$$
\sin^2\beta + \cos^2\beta = 1
$$
Therefore:
$$\begin{aligned}
a^2 + b^2 &= r^2
\implies r = \sqrt{a^2+b^2}
\end{aligned}
$$
Then $\beta$ is simply
$$
\arccos \frac{a}{r}
$$
or
$$
\arcsin \frac{b}{r}
$$
and we are done.
A: The function $p(t) = (\cos t, \sin t)$ maps out the unit circle on the plane.
In fact, for any point $(a,b)$ on the unit circle, there is a unique $t$ (modulo $2 \pi$) such that $p(t) = (a,b)$.
If you pick any point in the plane other than the origin, say $(x,y)$ then
with $R=\sqrt{x^2+y^2}$ the point ${1 \over R} (x,y)$ lies on the unit circle and so there is some $t$ such that ${1 \over R} (x,y) = p(t)$ and so
we can write $(x,y) = R p(t)$, or $x = R \cos t, y = R \sin t$.
So, you are given $a \cos x + b \sin x$, then there is some $\phi$ such that $a= \sqrt{a^2+b^2} \cos \phi, b= \sqrt{a^2+b^2} \sin \phi$ and we can write
$a \cos x + b \sin x= \sqrt{a^2+b^2}(\cos \phi \cos x + \sin \phi \sin x)$ and using the usual trigonometric identities we see that
$a \cos x + b \sin x= \sqrt{a^2+b^2} \cos(x-\phi)$.
