In this section, you will:
- Graph variations of y=sin(x) and y=cos(x) .
- Use phase shifts of sine and cosine curves.
White light, such as the light from the sun, is not actually white at all. Instead, it is a composition of all the colors of the rainbow in the form of waves. The individual colors can be seen only when white light passes through an optical prism that separates the waves according to their wavelengths to form a rainbow.
Light waves can be represented graphically by the sine function. In the chapter on Trigonometric Functions, we examined trigonometric functions such as the sine function. In this section, we will interpret and create graphs of sine and cosine functions.
5.1.1 Graphing Sine and Cosine Functions
Recall that the sine and cosine functions relate real number values to the \(x\)- and \(y\)-coordinates of a point on the unit circle. So what do they look like on a graph on a coordinate plane? Let’s start with the sine function. We can create a table of values and use them to sketch a graph. Table 5.1.2 lists some of the values for the sine function on a unit circle.
| \(x\) |
\(0\) |
\(\frac{\pi}{6}\) |
\(\frac{\pi}{4}\) |
\(\frac{\pi}{3}\) |
\(\frac{\pi}{2}\) |
\(\frac{2\pi}{3}\) |
\(\frac{3\pi}{4}\) |
\(\frac{5\pi}{6}\) |
\(\pi\) |
| \(\sin(x)\) |
\(0\) |
\(\frac{1}{2}\) |
\(\frac{\sqrt{2}}{2}\) |
\(\frac{\sqrt{3}}{2}\) |
\(1\) |
\(\frac{\sqrt{3}}{2}\) |
\(\frac{\sqrt{2}}{2}\) |
\(\frac{1}{2}\) |
\(0\) |
Table 5.1.2:
Plotting the points from the table and continuing along the \(x\)-axis gives the shape of the sine function. See Figure 5.1.3.
Notice how the sine values are positive between 0 and \(\pi,\) which correspond to the values of the sine function in quadrants I and II on the unit circle, and the sine values are negative between \(\pi\) and \(2\pi,\) which correspond to the values of the sine function in quadrants III and IV on the unit circle. See Figure 5.1.4.
Now let’s take a similar look at the cosine function. Again, we can create a table of values and use them to sketch a graph. Table 5.1.5 lists some of the values for the cosine function on a unit circle.
| \(\mathbf{x}\) |
\(0\) |
\(\frac{\pi}{6}\) |
\(\frac{\pi}{4}\) |
\(\frac{\pi}{3}\) |
\(\frac{\pi}{2}\) |
\(\frac{2\pi}{3}\) |
\(\frac{3\pi}{4}\) |
\(\frac{5\pi}{6}\) |
\(\pi\) |
| \(\mathbf{\cos}\left( \mathbf{x} \right)\) |
\(1\) |
\(\frac{\sqrt{3}}{2}\) |
\(\frac{\sqrt{2}}{2}\) |
\(\frac{1}{2}\) |
\(0\) |
\(- \frac{1}{2}\) |
\(- \frac{\sqrt{2}}{2}\) |
\(- \frac{\sqrt{3}}{2}\) |
\(- 1\) |
Table 5.1.5:
As with the sine function, we can plots points to create a graph of the cosine function as in Figure 5.1.6.
Because we can evaluate the sine and cosine of any real number, both of these functions are defined for all real numbers. By thinking of the sine and cosine values as coordinates of points on a unit circle, it becomes clear that the range of both functions must be the interval \(\left\lbrack {- 1,1} \right\rbrack.\)
In both graphs, the shape of the graph repeats after \(2\pi,\) which means the functions are periodic with a period of \(2\pi.\) A periodic function is a function for which a specific horizontal shift, \(P\), results in a function equal to the original function: \(f\left( {x + P} \right) = f(x)\) for all values of \(x\) in the domain of \(f.\) When this occurs, we call the smallest such horizontal shift with \(P > 0\) the period of the function. Figure 5.1.7 shows several periods of the sine and cosine functions.
Looking again at the sine and cosine functions on a domain centered at the \(y\)-axis helps reveal symmetries. As we can see in Figure 5.1.8, the sine function is symmetric about the origin. Recall from The Other Trigonometric Functions that we determined from the unit circle that the sine function is an odd function because \(\sin(-x) = -\sin\; x.\) Now we can clearly see this property from the graph.
Figure 5.1.9 shows that the cosine function is symmetric about the \(y\)-axis. Again, we determined that the cosine function is an even function. Now we can see from the graph that \(\cos(-x) = \cos\; x.\)
The sine and cosine functions have several distinct characteristics:
- They are periodic functions with a period of \(2\pi.\)
- The domain of each function is \(\left( {- \infty,\infty} \right)\) and the range is \(\left\lbrack {- 1,1} \right\rbrack.\)
- The graph of \(y = \sin\; x\) is symmetric about the origin, because it is an odd function.
- The graph of \(y = \cos\; x\) is symmetric about the \(y\)-axis, because it is an even function.
5.1.2 Investigating Sinusoidal Functions
As we can see, sine and cosine functions have a regular period and range. If we watch ocean waves or ripples on a pond, we will see that they resemble the sine or cosine functions. However, they are not necessarily identical. Some are taller or longer than others. A function that has the same general shape as a sine or cosine function is known as a sinusoidal function. The general forms of sinusoidal functions are
\[\begin{array}{l} {y = A\sin\left( {Bx - C} \right) + D} \\ \text{and} \\ {y = A\cos\left( {Bx - C} \right) + D} \end{array}\]
Determining the Period of Sinusoidal Functions
Looking at the forms of sinusoidal functions, we can see that they are transformations of the sine and cosine functions. We can use what we know about transformations to determine the period.
In the general formula, \(B\) is related to the period by \(P = \frac{2\pi}{|B|}.\) If \(|B| > 1,\) then the period is less than \(2\pi\) and the function undergoes a horizontal compression, whereas if \(|B| < 1,\) then the period is greater than \(2\pi\) and the function undergoes a horizontal stretch. For example, \(f(x) = \sin\left( x\operatorname{),} \right.\) \(B = 1,\) so the period is \(2\pi,\) which we knew. If \(f(x) = \sin\left( {2x} \right),\) then \(B = 2,\) so the period is \(\pi\) and the graph is compressed. If \(f(x) = \sin\left( \frac{x}{2} \right),\) then \(B = \frac{1}{2},\) so the period is \(4\pi\) and the graph is stretched. Notice in Figure 5.1.11 how the period is indirectly related to \(|B|.\)
If we let \(C = 0\) and \(D = 0\) in the general form equations of the sine and cosine functions, we obtain the forms
\[y = A\sin\left( {Bx} \right)\]
\[y = A\cos\left( {Bx} \right)\]
The period is \(\frac{2\pi}{|B|}.\)
Determine the period of the function \(f(x) = \sin\left( {\frac{\pi}{6}x} \right).\)
Solution (click to reveal)
Let’s begin by comparing the equation to the general form \(y = A\sin(Bx).\)
In the given equation, \(B = \frac{\pi}{6},\) so the period will be
\[\begin{array}{l} \begin{array}{l} \\ {P = \frac{2\pi}{|B|}} \end{array} \\ {= \frac{2\pi}{\frac{\pi}{6}}} \\ {= 2\pi \cdot \frac{6}{\pi}} \\ {= 12} \end{array}\]
Determine the period of the function \(g(x) = \cos\left( \frac{x}{3} \right).\)
Solution (click to reveal)
\(6\pi\)
Determining Amplitude
Returning to the general formula for a sinusoidal function, we have analyzed how the variable \(B\) relates to the period. Now let’s turn to the variable \(A\) so we can analyze how it is related to the amplitude, or greatest distance from rest. \(A\) represents the vertical stretch factor, and its absolute value \(|A|\) is the amplitude. The local maxima will be a distance \(|A|\) above the horizontal midline of the graph, which is the line \(y = D;\) because \(D = 0\) in this case, the midline is the \(x\)-axis. The local minima will be the same distance below the midline. If \(|A| > 1,\) the function is stretched. For example, the amplitude of \(f(x) = 4\;\sin\; x\) is twice the amplitude of \(f(x) = 2\;\sin\; x.\) If \(|A| < 1,\) the function is compressed. Figure 5.1.15 compares several sine functions with different amplitudes.

If we let \(C = 0\) and \(D = 0\) in the general form equations of the sine and cosine functions, we obtain the forms
\[y = A\sin\left( {Bx} \right)\text{~and~}y = A\cos\left( {Bx} \right)\]
The amplitude is \(\left| A\text{|}, \right.\) which is the vertical height from the midline \(.\) In addition, notice in the example that
\[|A|\text{~=~amplitude~=~}\frac{1}{2}\left| {\text{maximum~} - \text{~minimum}} \right|\]
What is the amplitude of the sinusoidal function \(f(x) = -4\sin(x)?\) Is the function stretched or compressed vertically?
Solution (click to reveal)
Let’s begin by comparing the function to the simplified form \(y = A\sin(Bx).\)
In the given function, \(A = -4,\) so the amplitude is \(|A| = |-4| = 4.\) The function is stretched.
The negative value of \(A\) results in a reflection across the \(x\)-axis of the sine function, as shown in Figure 5.1.18.
What is the amplitude of the sinusoidal function \(f(x) = \frac{1}{2}\sin(x)?\) Is the function stretched or compressed vertically?
Solution (click to reveal)
\(\frac{1}{2}\) compressed
5.1.3 Analyzing Graphs of Variations of \(y\) = sinx and \(y\) = cos \(x\)
Now that we understand how \(A\) and \(B\) relate to the general form equation for the sine and cosine functions, we will explore the variables \(C\) and \(D.\) Recall the general form:
\[\begin{matrix} {y = A\sin\left( {Bx - C} \right) + D\text{~and~}y = A\cos\left( {Bx - C} \right) + D} \\ {or} \\ {y = A\sin\left( {B\left( {x - \frac{C}{B}} \right)} \right) + D\text{~and~}y = A\cos\left( {B\left( {x - \frac{C}{B}} \right)} \right) + D} \end{matrix}\]
The value \(\frac{C}{B}\) for a sinusoidal function is called the phase shift, or the horizontal displacement of the basic sine or cosine function. If \(C > 0,\) the graph shifts to the right. If \(C < 0,\) the graph shifts to the left. The greater the value of \(|C|,\) the more the graph is shifted. Figure 5.1.20 shows that the graph of \(f(x) = \sin\left( {x - \pi} \right)\) shifts to the right by \(\pi\) units, which is more than we see in the graph of \(f(x) = \sin\left( {x - \frac{\pi}{4}} \right),\) which shifts to the right by \(\frac{\pi}{4}\) units.
While \(C\) relates to the horizontal shift, \(D\) indicates the vertical shift from the midline in the general formula for a sinusoidal function. See Figure 5.1.21. The function \(y = \cos(x) + D\) has its midline at \(y = D.\)
Any value of \(D\) other than zero shifts the graph up or down. Figure 5.1.22 compares \(f(x) = \sin\;(x)\) with \(f(x) = \sin\;(x) + 2,\) which is shifted 2 units up on a graph.
Given an equation in the form \(f(x) = A\sin\left( {Bx - C} \right) + D\) or \(f(x) = A\cos\left( {Bx - C} \right) + D,\) \(\frac{C}{B}\) is the phase shift and \(D\) is the vertical shift.
Determine the direction and magnitude of the phase shift for \(f(x) = \sin\left( {x + \frac{\pi}{6}} \right) - 2.\)
Solution (click to reveal)
Let’s begin by comparing the equation to the general form \(y = A\sin(Bx - C) + D.\)
In the given equation, notice that \(B = 1\) and \(C = - \frac{\pi}{6}.\) So the phase shift is
\[\begin{array}{r} \\ {\frac{C}{B} = - \frac{\frac{\pi}{6}}{1}} \\ {= - \frac{\pi}{6}} \end{array}\]
or \(\frac{\pi}{6}\) units to the left.
We must pay attention to the sign in the equation for the general form of a sinusoidal function. The equation shows a minus sign before \(C.\) Therefore \(f(x) = \sin\left( {x + \frac{\pi}{6}} \right) - 2\) can be rewritten as \(f(x) = \sin\left( {x - \left( {- \frac{\pi}{6}} \right)} \right) - 2.\) If the value of \(C\) is negative, the shift is to the left.
Determine the direction and magnitude of the phase shift for \(f(x) = 3\cos\left( {x - \frac{\pi}{2}} \right).\)
Solution (click to reveal)
\(\frac{\pi}{2};\) right
Determine the direction and magnitude of the vertical shift for \(f(x) = \cos(x) - 3.\)
Solution (click to reveal)
Let’s begin by comparing the equation to the general form \(y = A\cos(Bx - C) + D.\)
In the given equation, \(D = -3\) so the shift is 3 units downward.
Determine the direction and magnitude of the vertical shift for \(f(x) = 3\sin(x) + 2.\)
Solution (click to reveal)
2 units up
Given a sinusoidal function in the form \(f(x) = A\sin\left( {Bx - C} \right) + D,\) identify the midline, amplitude, period, and phase shift.
- Determine the amplitude as \(|A|.\)
- Determine the period as \(P = \frac{2\pi}{|B|}.\)
- Determine the phase shift as \(\frac{C}{B}.\)
- Determine the midline as \(y = D.\)
Determine the midline, amplitude, period, and phase shift of the function \(y = 3\sin(2x) + 1.\)
Solution (click to reveal)
Let’s begin by comparing the equation to the general form \(y = A\sin(Bx - C) + D.\)
\(A = 3,\) so the amplitude is \(|A| = 3.\)
Next, \(B = 2,\) so the period is \(P = \frac{2\pi}{|B|} = \frac{2\pi}{2} = \pi.\)
There is no added constant inside the parentheses, so \(C = 0\) and the phase shift is \(\frac{C}{B} = \frac{0}{2} = 0.\)
Finally, \(D = 1,\) so the midline is \(y = 1.\)
Inspecting the graph, we can determine that the period is \(\pi,\) the midline is \(y = 1,\) and the amplitude is 3. See Figure 5.1.29.
Determine the midline, amplitude, period, and phase shift of the function \(y = \frac{1}{2}\cos\left( {\frac{x}{3} - \frac{\pi}{3}} \right).\)
Solution (click to reveal)
midline: \(y = 0;\) amplitude: \(|A| = \frac{1}{2};\) period: \(P = \frac{2\pi}{|B|} = 6\pi;\) phase shift: \(\frac{C}{B} = \pi\)
Determine the formula for the cosine function in Figure 5.1.32.
![A graph of -0.5cos(x)+0.5. The graph has an amplitude of 0.5. The graph has a period of 2pi. The graph has a range of [0, 1]. The graph is also reflected about the x-axis from the parent function cos(x).](../images/CNX_Precalc_Figure_06_01_015.jpg)
Solution (click to reveal)
To determine the equation, we need to identify each value in the general form of a sinusoidal function.
\[\begin{array}{l} {y = A\sin(Bx - C) + D} \\ {y = A\cos(Bx - C) + D} \end{array}\]
The graph could represent either a sine or a cosine function that is shifted and/or reflected. When \(x = 0,\) the graph has an extreme point, \(\left( {0,0} \right).\) Since the cosine function has an extreme point for \(x = 0,\) let us write our equation in terms of a cosine function.
Let’s start with the midline. We can see that the graph rises and falls an equal distance above and below \(y = 0.5.\) This value, which is the midline, is \(D\) in the equation, so \(D = 0.5.\)
The greatest distance above and below the midline is the amplitude. The maxima are 0.5 units above the midline and the minima are 0.5 units below the midline. So \(|A| = 0.5.\) Another way we could have determined the amplitude is by recognizing that the difference between the height of local maxima and minima is 1, so \(|A| = \frac{1}{2} = 0.5.\) Also, the graph is reflected about the \(x\)-axis so that \(A = - 0.5.\)
The graph is not horizontally stretched or compressed, so \(B = 1;\) and the graph is not shifted horizontally, so \(C = 0.\)
Putting this all together,
\[g(x) = - 0.5\cos(x) + 0.5\]
Determine the formula for the sine function in Figure 5.1.34.
Solution (click to reveal)
\(f(x) = \sin(x) + 2\)
Determine the equation for the sinusoidal function in Figure 5.1.36.
![A graph of 3cos(pi/3x-pi/3)-2. Graph has amplitude of 3, period of 6, range of [-5,1].](../images/CNX_Precalc_Figure_06_01_017.jpg)
Solution (click to reveal)
With the highest value at 1 and the lowest value at \(-5,\) the midline will be halfway between at \(-2.\) So \(D = -2.\)
The distance from the midline to the highest or lowest value gives an amplitude of \(|A| = 3.\)
The period of the graph is 6, which can be measured from the peak at \(x = 1\) to the next peak at \(x = 7,\) or from the distance between the lowest points. Therefore, \(P = \frac{2\pi}{|B|} = 6.\) Using the positive value for \(B,\) we find that
\[B = \frac{2\pi}{P} = \frac{2\pi}{6} = \frac{\pi}{3}\]
So far, our equation is either \(y = 3\sin\left( {\frac{\pi}{3}x - C} \right) - 2\) or \(y = 3\cos\left( {\frac{\pi}{3}x - C} \right) - 2.\) For the shape and shift, we have more than one option. We could write this as any one of the following:
- a cosine shifted to the right
- a negative cosine shifted to the left
- a sine shifted to the left
- a negative sine shifted to the right
Choosing to use the cosine function, we observe that the peak, which would normally be at \(x = 0\), is at \(x = 1\), and given the horizontal compression factor of \(\frac{\pi}{3}\), we get \(C = 1 \cdot \frac{\pi}{3} = \frac{\pi}{3}\).
While any of these would be correct, the cosine shifts are easier to work with than the sine shifts in this case because they involve integer values. So our function becomes
\[y = 3\cos\left( {\frac{\pi}{3}x - \frac{\pi}{3}} \right) - 2\text{~or~}y = - 3\cos\left( {\frac{\pi}{3}x + \frac{2\pi}{3}} \right) - 2\]
Again, these functions are equivalent, so both yield the same graph.
Write a formula for the function graphed in Figure 5.1.38.
Solution (click to reveal)
two possibilities: \(y = 4\sin\left( {\frac{\pi}{5}x - \frac{\pi}{5}} \right) + 4\) or \(y = - 4\sin\left( {\frac{\pi}{5}x + \frac{4\pi}{5}} \right) + 4\)
5.1.4 Graphing Variations of \(y\) = sin \(x\) and \(y\) = cos \(x\)
Throughout this section, we have learned about types of variations of sine and cosine functions and used that information to write equations from graphs. Now we can use the same information to create graphs from equations.
Instead of focusing on the general form equations
\[y = A\sin\left( {Bx - C} \right) + D\text{~and~}y = A\cos\left( {Bx - C} \right) + D,\]
we will let \(C = 0\) and \(D = 0\) and work with a simplified form of the equations in the following examples.
Given the function \(y = A\sin\left( {Bx} \right),\) sketch its graph.
- Identify the amplitude, \(|A|.\)
- Identify the period, \(P = \frac{2\pi}{|B|}.\)
- Start at the origin, with the function increasing to the right if \(A\) is positive or decreasing if \(A\) is negative.
- At \(x = \frac{\pi}{2|B|}\) there is a local maximum for \(A > 0\) or a minimum for \(A < 0,\) with \(y = A.\)
- The curve returns to the \(x\)-axis at \(x = \frac{\pi}{|B|}.\)
- There is a local minimum for \(A > 0\) (maximum for \(A < 0\) ) at \(x = \frac{3\pi}{2|B|}\) with \(y = –A.\)
- The curve returns again to the \(x\)-axis at \(x = \frac{2\pi}{|B|}.\)
Sketch a graph of \(f(x) = - 2\sin\left( \frac{\pi x}{2} \right).\)
Solution (click to reveal)
Let’s begin by comparing the equation to the form \(y = A\sin(Bx).\)
- Step 1. We can see from the equation that \(A = - 2,\) so the amplitude is 2.
\[|A| = 2\]
- Step 2. The equation shows that \(B = \frac{\pi}{2},\) so the period is
\[\begin{array}{l} {P = \frac{2\pi}{\frac{\pi}{2}}} \\ {= 2\pi \cdot \frac{2}{\pi}} \\ {= 4} \end{array}\]
Step 3. Because \(A\) is negative, the graph descends as we move to the right of the origin.
Step 4–7. The \(x\)-intercepts are at the beginning of one period, \(x = 0,\) the horizontal midpoints are at \(x = 2\) and at the end of one period at \(x = 4.\)
The quarter points include the minimum at \(x = 1\) and the maximum at \(x = 3.\) A local minimum will occur 2 units below the midline, at \(x = 1,\) and a local maximum will occur at 2 units above the midline, at \(x = 3.\) Figure 19 shows the graph of the function.
Sketch a graph of \(g(x) = - 0.8\cos\left( {2x} \right).\) Determine the midline, amplitude, period, and phase shift.
Solution (click to reveal)
midline: \(y = 0;\) amplitude: \(|A| = 0.8;\) period: \(P = \frac{2\pi}{|B|} = \pi;\) phase shift: \(\frac{C}{B} = 0\) or none
Given a sinusoidal function with a phase shift and a vertical shift, sketch its graph.
- Express the function in the general form \(y = A\sin(Bx - C) + D\text{~or~}y = A\cos(Bx - C) + D.\)
- Identify the amplitude, \(|A|.\)
- Identify the period, \(P = \frac{2\pi}{|B|}.\)
- Identify the phase shift, \(\frac{C}{B}.\)
- Draw the graph of \(f(x) = A\sin\left( {Bx} \right)\) shifted to the right or left by \(\frac{C}{B}\) and up or down by \(D.\)
Sketch a graph of \(f(x) = 3\sin\left( {\frac{\pi}{4}x - \frac{\pi}{4}} \right).\)
Solution (click to reveal)
Step 1. The function is already written in general form: \(f(x) = 3\sin\left( {\frac{\pi}{4}x - \frac{\pi}{4}} \right).\) This graph will have the shape of a sine function, starting at the midline and increasing to the right.
Step 2. \(|A| = |3| = 3.\) The amplitude is 3.
Step 3. Since \(|B| = \left| \frac{\pi}{4} \right| = \frac{\pi}{4},\) we determine the period as follows.
\[P = \frac{2\pi}{|B|} = \frac{2\pi}{\frac{\pi}{4}} = 2\pi \cdot \frac{4}{\pi} = 8\]
The period is 8.
- Step 4. Since \(C = \frac{\pi}{4},\) the phase shift is
\[\frac{C}{B} = \frac{\frac{\pi}{4}}{\frac{\pi}{4}} = 1.\]
The phase shift is 1 unit.
- Step 5. Figure 20 shows the graph of the function.

Figure 20 A horizontally compressed, vertically stretched, and horizontally shifted sinusoid
Draw a graph of \(g(x) = - 2\cos\left( {\frac{\pi}{3}x + \frac{\pi}{6}} \right).\) Determine the midline, amplitude, period, and phase shift.
Solution (click to reveal)
midline: \(y = 0;\) amplitude: \(|A| = 2;\) period: \(P = \frac{2\pi}{|B|} = 6;\) phase shift: \(\frac{C}{B} = - \frac{1}{2}\)
Given \(y = - 2\cos\left( {\frac{\pi}{2}x + \pi} \right) + 3,\) determine the amplitude, period, phase shift, and vertical shift. Then graph the function.
Solution (click to reveal)
Begin by comparing the equation to the general form and use the steps outlined in Example 9.
\[y = A\cos\left( {Bx - C} \right) + D\]
- Step 1. The function is already written in general form.
- Step 2. Since \(A = - 2,\) the amplitude is \(|A| = 2.\)
- Step 3. \(|B| = \frac{\pi}{2},\) so the period is \(P = \frac{2\pi}{|B|} = \frac{2\pi}{\frac{\pi}{2}} = 2\pi \cdot \frac{2}{\pi} = 4.\) The period is 4.
- Step 4. \(C = - \pi,\) so we calculate the phase shift as \(\frac{C}{B} = \frac{- \pi,}{\frac{\pi}{2}} = - \pi \cdot \frac{2}{\pi} = - 2.\) The phase shift is \(- 2.\)
- Step 5. \(D = 3,\) so the midline is \(y = 3\operatorname{,\,}\) and the vertical shift is up 3.
Since \(A\) is negative, the graph of the cosine function has been reflected about the \(x\)-axis.
Figure 5.1.47 shows one cycle of the graph of the function.