You may be interested to know that there is a general formula for condensing the
sum of a sine and a cosine wave into a single sine or cosine wave. I'll show you how to condense such a sum into a single sine wave, but the derivation for a single cosine wave is exactly the same.
Goal: Find C and D, in terms of A and B, so that Asin(x)+Bcos(x)=Csin(x+D)
Well, we might make some progress if we expand the right-hand side using the sum formula for sine. This becomes
Now we should just compare the coefficients of sin(x) and cos(x) on each side of the equation. The coefficient of sin(x) on the left-hand side is A and the coefficient of sin(x) on the right-hand side is Ccos(D), so we want A=Ccos(D). Similarly, comparing coefficients for cos(x) on both sides of the equation shows we want B=Csin(D). If we divide this second equation by the first, we get tan(D)=B/A.
That means D should be arctan(B/A). So we've figured out what D should be. What about C? Well, notice that
by the Pythagorean identity. So C should just be sqrt(A2+B2). This tells us what numbers C and D to choose if we want to write
any sum Asin(x)+Bcos(x) as a single sine wave. This fact is very important in analyzing simple harmonic motion
and the differential equation that governs it.
Now we can see where Robert's hint comes from. He told you that
But where does this fact come from? It just comes from the fact we just proved. In this case, A=1 and B=1, so C should be sqrt(12+12)=sqrt(2). And D should be arctan(B/A)=arctan(1/1)=arctan(1)=pi/4. That's where he gets those numbers.
Hope this deeper explanation helps!