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

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.
