New Zealand
Level 8 - NCEA Level 3

# Graph sums of sine and cosine (rad)

Lesson

Here is a graph of the curves $y=\sin x$y=sinx and $y=\cos x$y=cosx on the same set of axes:

The two curves $y=\sin x$y=sinx and $y=\cos x$y=cosx

We have looked quite thoroughly at these functions and their graphs. For instance, we know that they are periodic, each with a period of $2\pi$2π, and have an amplitude of $1$1 centred around a height of $y=0$y=0. We are now going to look into the graphs of sums and differences of $\sin x$sinx and $\cos x$cosx, using our knowledge of certain trigonometric identities.

### $y=\sin x+\cos x$y=sinx+cosx

Let's begin by looking at the function $y=\sin x+\cos x$y=sinx+cosx. Using technology, we can obtain a graph of this function:

The curve $y=\sin x+\cos x$y=sinx+cosx

Notice that this looks much the same as a single sin or cos function, though it has a different amplitude and has been shifted horizontally. In fact we can rewrite the sum $\sin x+\cos x$sinx+cosx as a single trigonometric function. To see this we'll start with the variable $x$x and another fixed angle, which we choose to call $\alpha$α, and use the identity:

$\sin\left(x+\alpha\right)=\cos\alpha\sin x+\sin\alpha\cos x$sin(x+α)=cosαsinx+sinαcosx.

Now if $\cos\alpha$cosα and $\sin\alpha$sinα were to have the same value, we would be able to divide both sides by that value to leave the sum $\sin x+\cos x$sinx+cosx on the right hand side.

If we look back to the graph of the curves $y=\sin x$y=sinx and $y=\cos x$y=cosx at the beginning, we can see that the two graphs intersect at the angle $\frac{\pi}{4}$π4. That is,

$\sin\left(\frac{\pi}{4}\right)=\cos\left(\frac{\pi}{4}\right)=\frac{1}{\sqrt{2}}$sin(π4)=cos(π4)=12.

So replacing $\alpha$α with $\frac{\pi}{4}$π4, we have that

 $\sin\left(x+\frac{\pi}{4}\right)$sin(x+π4​) $=$= $\cos\frac{\pi}{4}\sin x+\sin\frac{\pi}{4}\cos x$cosπ4​sinx+sinπ4​cosx $=$= $\frac{1}{\sqrt{2}}\sin x+\frac{1}{\sqrt{2}}\cos x$1√2​sinx+1√2​cosx

Multiplying both sides by $\sqrt{2}$2 gives us the result:

$\sin x+\cos x=\sqrt{2}\sin\left(x+\frac{\pi}{4}\right)$sinx+cosx=2sin(x+π4)

Compared to $y=\sin x$y=sinx, the function $y=\sqrt{2}\sin\left(x+\frac{\pi}{4}\right)$y=2sin(x+π4) has an amplitude of $\sqrt{2}$2, and has a horizontal shift of $\frac{\pi}{4}$π4 units to the left. Here is a graph of $y=\sqrt{2}\sin\left(x+\frac{\pi}{4}\right)$y=2sin(x+π4):

The curve $y=\sqrt{2}\sin\left(x+\frac{\pi}{4}\right)$y=2sin(x+π4)

Comparing this to the graph of $y=\sin x+\cos x$y=sinx+cosx above, we can see that the two graphs (and therefore the two functions) are indeed the same!

### $y=a\sin x+b\cos x$y=asinx+bcosx

We can generalise this process to any linear combination of $\sin x$sinx and $\cos x$cosx. That is, we can rewrite any function of the form $y=a\sin x+b\cos x$y=asinx+bcosx in the form $y=R\sin\left(x+\alpha\right)$y=Rsin(x+α), where $a$a, $b$b, $R$R and $\alpha$α are constants.

Using the same trigonometric identity, we have that $R\sin\left(x+\alpha\right)=R\cos\alpha\sin x+R\sin\alpha\cos x$Rsin(x+α)=Rcosαsinx+Rsinαcosx. Notice that this is in the form $a\sin x+b\cos x$asinx+bcosx, where

 $a$a $=$= $R\cos\alpha$Rcosα , and $b$b $=$= $R\sin\alpha$Rsinα

We can rearrange these two equations to obtain expressions for $R$R and $\alpha$α in terms of $a$a and $b$b.

To find $R$R, we can square and add the two equations:

 $a^2+b^2$a2+b2 $=$= $R^2\cos^2\left(\alpha\right)+R^2\sin^2\left(\alpha\right)$R2cos2(α)+R2sin2(α) $=$= $R^2\left(\sin^2\left(\alpha\right)+\cos^2\left(\alpha\right)\right)$R2(sin2(α)+cos2(α)) $=$= $R^2$R2

So we have that

$R=\sqrt{a^2+b^2}$R=a2+b2.

To find $\alpha$α, we can divide the two equations:

 $\frac{b}{a}$ba​ $=$= $\frac{R\sin\alpha}{R\cos\alpha}$RsinαRcosα​ $=$= $\frac{\sin\alpha}{\cos\alpha}$sinαcosα​ $=$= $\tan\alpha$tanα

We can then find the value of $\alpha$α from this relation, though we may need to consider which quadrant the angle is in depending on the signs of $a$a and $b$b, since after all we know that $a=R\cos\alpha$a=Rcosα and $b=R\sin\alpha$b=Rsinα.

For example: if $\frac{b}{a}$ba was positive but the values of $a$a and $b$b were negative, then the value of $\alpha$α will lie in the third quadrant (since this is where $\tan$tan is positive, but sine and cosine are negative).

We can also rewrite a function of the form $y=a\sin x+b\cos x$y=asinx+bcosx in the form $y=R\cos\left(x+\alpha\right)$y=Rcos(x+α). Performing some similar rearrangements, we find in this case that $R=\sqrt{a^2+b^2}$R=a2+b2 and $\tan\alpha=\frac{-a}{b}$tanα=ab.

Summary

A function of the form $y=a\sin x+b\cos x$y=asinx+bcosx can be rewritten in the form $y=R\sin\left(x+\alpha\right)$y=Rsin(x+α), where $R>0$R>0 and $-\pi<\alpha<\pi$π<α<π. We can find the values of $R$R and $\alpha$α using the relations

• $R=\sqrt{a^2+b^2}$R=a2+b2, and
• $\tan\alpha=\frac{b}{a}$tanα=ba.

Similarly, a function of the form $y=a\sin x+b\cos x$y=asinx+bcosx can be rewritten in the form $y=R\cos\left(x+\alpha\right)$y=Rcos(x+α), where $R>0$R>0 and $-\pi<\alpha<\pi$π<α<π, by using the relations

• $R=\sqrt{a^2+b^2}$R=a2+b2, and
• $\tan\alpha=\frac{-a}{b}$tanα=ab.
Careful!

When finding the value of $\alpha$α, remember that the inverse $\tan$tan function only gives values between $-\frac{\pi}{2}$π2 and $\frac{\pi}{2}$π2. The actual value of $\alpha$α can be between $-\pi$π and $\pi$π, and the particular angle will depend on the signs of the coefficients $a$a and $b$b.

### Graphs of $y=a\sin x+b\cos x$y=asinx+bcosx

To more easily sketch the graph of a function of the form $y=a\sin x+b\cos x$y=asinx+bcosx, we can first rewrite it as a single trigonometric function, using either $\sin$sin or $\cos$cos, as we have just seen. Then we can use our knowledge of transformations of trig graphs to sketch the function.

Remember that for a function of the form $y=R\sin\left(x+\alpha\right)$y=Rsin(x+α), we can start with the graph of $y=\sin x$y=sinx. The value of $\alpha$α corresponds to a horizontal shift (left if $\alpha$α is positive, right if $\alpha$α is negative), and the value of $R$R corresponds to a vertical dilation - that is, it changes the amplitude of the function. The same is true for a function of the form $y=R\cos\left(x+\alpha\right)$y=Rcos(x+α), starting from the graph of $y=\cos x$y=cosx.

Remember

To more easily sketch the graph of $y=a\sin x+b\cos x$y=asinx+bcosx, we can first rewrite it in the form $y=R\sin\left(x+\alpha\right)$y=Rsin(x+α) or $y=R\cos\left(x+\alpha\right)$y=Rcos(x+α) using the method above.

The value of $R$R will then be the amplitude of the $\sin$sin or $\cos$cos function, and the value of $\alpha$α will be the horizontal shift of the function.

#### Practice questions

##### Question 1

Consider the equation $y=\sin x-\cos x$y=sinxcosx.

1. Rewrite the equation in the form $y=R\sin\left(x+\alpha\right)$y=Rsin(x+α), where $R>0$R>0 and $-\pi<\alpha<\pi$π<α<π.

2. Which of the following could be the graph of $y=\sin x-\cos x$y=sinxcosx?

A

B

C

D

A

B

C

D

##### Question 2

Consider the equation $y=4\sin x+5\cos x$y=4sinx+5cosx.

1. Rewrite the equation in the form $y=R\cos\left(x+\alpha\right)$y=Rcos(x+α), where $R>0$R>0 and $-\pi<\alpha<\pi$π<α<π.

Give the value of $\alpha$α correct to three decimal places.

2. Which of the following could be the graph of $y=4\sin x+5\cos x$y=4sinx+5cosx?

A

B

C

D

A

B

C

D

##### Question 3

Consider the equation $y=\sqrt{3}\sin x+\cos x$y=3sinx+cosx.

1. Rewrite the equation in the form $y=R\cos\left(x+\alpha\right)$y=Rcos(x+α), where $R>0$R>0 and $-\pi<\alpha<\pi$π<α<π.

2. Now sketch the curve $y=\sqrt{3}\sin x+\cos x$y=3sinx+cosx on the axes below: