# Can someone explain to me why and how $a\cos x+b\sin x$ is the cosine or sine of an angle multiplied by a scalar?

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?

• 1) do you agree that - if $a^2+b^2=1$ - then we can always find $\alpha$ such that $a=\sin\alpha$ and $b=\cos\alpha$? – drhab Jul 17 '16 at 12:02
• @drhab, yes, I do – codetalker Jul 17 '16 at 12:03
• Well, if $R^2:=a^2+b^2>0$ then observe that $a'^2+b'^2=1$ if $a':=\frac{a}{R}$ and $b':=\frac{b}{R}$. Secondly $R=0$ must be treated as special case. – drhab Jul 17 '16 at 12:05
• @drhab, if you would have made that an answer, I would have upvoted and accepted it – codetalker Jul 17 '16 at 12:09
• Thanks. The pleasure to help exceeds the pleasure of gaining reputation ;-). – drhab Jul 17 '16 at 12:12

If $a=b=0$ then $f(x)\equiv0$, so making $R=0$ the equality $f(x)=R\sin(x+\alpha)$ is true for every $\alpha\in\mathbb{R}$.

If one of $a$ and $b$ is non-zero, i.e. $a^2+b^2\neq0$, let $P=(b,a)$ be a point in the plane, the circumference centered at the origin passing by $P$ has radius $R=\sqrt{a^2+b^2}$, let $\alpha$ the oriented angle formed between the positive $x$ axis and $OP$, then we have $$\cos \alpha =\frac{b}R\qquad\text{and}\qquad\sin \alpha=\frac{a}{R}$$

Do you can see why the equalities $a=R\sin \alpha$ and $b=R\cos \alpha$ are true?

Are you familiar with polar coordinates?

Given two real numbers $a,b$ not both equal to $0$, if we represent them as the ordered pair $(a,b)$ and present these on the $xy$-plane as a point, the pair can be uniquely represented by a non-negative distance, $R$, from the origin $(0,0)$ to $(a,b)$-- ($R = \sqrt{a^2 + b^2}$)-- and an angle $\alpha$ which represents the angle of the $x$ axis with the lin for $(0,0)$ to $(a,b)$.

Geometrically we can see that $a = R \sin \alpha$ and $b = R \cos \alpha$.

Also we can note that $(a/R)^2 + (b/R)^2 = (a^2 + b^2)/R^2 = 1$ so $a/R$ and $b/R$ are points of a circle and there exist $\alpha$ so that $a/R = \sin \alpha$ and $b/R = \cos \alpha$.

So that is basically your first question.

Unless $a = b = 0$. In which case just set $R = 0$ and $\alpha$ to any angle you like.

Your second question: If we use the above substitution we get:

$f(x) = a \cos x + b \sin y$

$= R(\sin \alpha \cos x + \cos \alpha \sin x)$

$= R\sin(x + \alpha)$

Use addition formula for the sine: $$R\sin(x+\alpha)=R(\sin x\cos\alpha+\cos x\sin\alpha)= (R\cos\alpha)\sin x+(R\sin\alpha)\cos x.$$

• I never asked this.... – codetalker Jul 17 '16 at 11:57
• It's a bit strange you say so, because my answer is just the same as the one you accepted. – Aretino Jul 17 '16 at 12:19
• the answer that I accepted tells me why we can always find such $\alpha$. Your answer tells me how to work out the formulae for $R$ and $\alpha$ – codetalker Jul 17 '16 at 12:21
• Look at the last formula: to make it equal to $b\sin x+a\cos x$ it suffices to set $R\cos\alpha=b$ and $R\sin\alpha=a$. – Aretino Jul 17 '16 at 12:23
• I agree, but observe my second bullet point, I asked how can we represent the function as the sine of an angle multiplied by a scalar, without any analysis? The main thrust in this question was how.. – codetalker Jul 18 '16 at 14:13

If you are familiar with Fourier series, you can imagine $R=\sqrt{a^2+b^2}$ as a generalization of the Pythagorean theorem, and $\tan \alpha = a/b$ as the phase angle, but instead of a vector space, we have a Hilbert space where the sine and cosine functions form an orthogonal basis