Blog

An unexpected trig identity

I was trying a graphing application on my son's iPad last night when I came across a trig identity that I hadn't seen before. Here's how this happened.

To test the graphing program on the iPad, the first few graphs that I made were of elliptic and hyperelliptic curves like this:

Then, for no apparent reason, I thought to graph

y = sin x + cos x

Here's what the graph looked like:

I found that a bit surprising. That sure looks like either a sine or cosine of some sort, so it looked like there was some sort of trig identity like

sin x + cos x = α sin(+ β)

that I hadn't seen before. When I tried to understand what's going on here, I thought that it would probably be just easy to find a slightly more general identity, something like

a sin xb cos x = c sin(x + d)

Such an identity is actually fairly easy to find.

We can write

c sin(x + d) = c sin x cos d + c cos d sin x

so that we have that

a sin xb cos x = c sin x cos d + c cos x sin d

Comparing that parts of the LHS and RHS that involve sin x and cos x, we find that we want

a sin xc sin x cos d

and

b cos x = c cos x sin d

or that

cos d = a / c

and

sin d = b /c

Substuting those into

cos2d + sin2d = 1

we get that

(a / c)2 + (b / c)2 = 1

or that

a2 + b2 = c2

so that we have that

c = √(a2 + b2)

Now that we have c, we can now find d as

d = sin-1(b / c)

So in the case that I first came across I had a = b = 1, so that c = √2 and d = π / 4 giving

sin x + cos x =  √2 sin(x + π / 4)

which is exactly what we see in the graph.

I was a bit surprised that I hadn't seen that particular identity before. It doesn't appear in my CRC math tables book. Maybe it's one of the more obscure ones.