I would like to ask a pair of questions regarding this function.
First question: How is this expression derived?
Let's consider that $f(x)=a\cos x+b\sin x$. Now, I tried hard to derive the expression myself, but it was just a waste of time. I have read two derivations of this, which I doubt are correct:
1) The first one starts by considering $a=R\sin\alpha$ and $b=R\cos\alpha$. How can this statement be true? There are two real numbers $a$ and $b$. How can we make this assertion that both of them can be expressed as the trigonometric functions of the same angle $\alpha$, multiplied by some scalar $R$?
2) The second one starts by considering this: Let $f(x)=a\cos x+b\sin x=R\sin(x+\alpha)$. Again, the problem here is how can we just say that this function is indeed a sine function, multiplied by a scalar, without doing any analysis or graphing it? How is it true? If this were true, can't we do this just with any function, represent it any way we want?
From these two starting points, the rest of the formulae are derived, which are not difficult to derive. So, what is the possible way to prove it?
Second question: Is this formula theoretical or is it derived after rigorously analysing the function?
When I wasn't able to prove it, I felt that thinking something like this would have taken a lot of effort. Because there was no way a normal person can think about facts like "this expression is a special sine or a cosine" without spending days on it. So, is it possible to derive this relationship without analysing the function, for example without graphing it, without trying certain pairs of values for it or something like that?