Graphs of the Sine and Cosine Functions
By the end of this section, you will be able to:
- Graph variations of and
- 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.
Graphing Sine and Cosine Functions
Recall that the sine and cosine functions relate real number values to the - and -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. The table below lists some of the values for the sine function on a unit circle.
Plotting the points from the table and continuing along the -axis gives the shape of the sine function, shown below.
Notice how the sine values are positive between and , 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 and , which correspond to the values of the sine function in quadrants III and IV on the unit circle, as shown below.
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. The table below lists some of the values for the cosine function on a unit circle.
As with the sine function, we can plot points to create a graph of the cosine function, as below.
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 .
In both graphs, the shape of the graph repeats after , which means the functions are periodic with a period of . A periodic function is a function for which a specific horizontal shift, , results in a function equal to the original function: for all values of in the domain of . When this occurs, we call the smallest such horizontal shift with the period of the function. The figure below shows several periods of the sine and cosine functions.
Looking again at the sine and cosine functions on a domain centered at the -axis helps reveal symmetries. As we can see below, 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 . Now we can clearly see this property from the graph.
The figure below shows that the cosine function is symmetric about the -axis. Again, we determined that the cosine function is an even function. Now we can see from the graph that .
Characteristics of Sine and Cosine Functions. The sine and cosine functions have several distinct characteristics:
- They are periodic functions with a period of .
- The domain of each function is and the range is .
- The graph of is symmetric about the origin, because it is an odd function.
- The graph of is symmetric about the -axis, because it is an even function.
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
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, is related to the period by . If , then the period is less than and the function undergoes a horizontal compression, whereas if , then the period is greater than and the function undergoes a horizontal stretch. For example, , , so the period is , which we knew. If , then , so the period is and the graph is compressed. If , then , so the period is and the graph is stretched. The figure below shows how the period is indirectly related to .
Period of Sinusoidal Functions. If we let and in the general form equations of the sine and cosine functions, we obtain the forms
The period is .
Example. Determine the period of the function .
Solution. Let’s begin by comparing the equation to the general form .
In the given equation, , so the period will be
Determine the period of the function.
Compare toand compute.Determining Amplitude
Returning to the general formula for a sinusoidal function, we have analyzed how the variable relates to the period. Now let’s turn to the variable so we can analyze how it is related to the amplitude, or greatest distance from rest. represents the vertical stretch factor, and its absolute value is the amplitude. The local maxima will be a distance above the horizontal midline of the graph, which is the line ; because in this case, the midline is the -axis. The local minima will be the same distance below the midline. If , the function is stretched. For example, the amplitude of is twice the amplitude of . If , the function is compressed. The figure below compares several sine functions with different amplitudes.
Amplitude of Sinusoidal Functions. If we let and in the general form equations of the sine and cosine functions, we obtain the forms
The amplitude is , which is the vertical height from the midline. In addition, .
Example. What is the amplitude of the sinusoidal function ? Is the function stretched or compressed vertically?
Solution. Let’s begin by comparing the function to the simplified form .
In the given function, , so the amplitude is . The function is stretched.
Analysis. The negative value of results in a reflection across the -axis of the sine function, as shown below.
What is the amplitude of the sinusoidal function, entered as a decimal? Is the function stretched or compressed vertically?
The amplitude is; compareagainstto decide stretched or compressed.Is the sinusoidal functionstretched or compressed vertically, compared to?
A factor withshrinks the graph toward the midline.Analyzing Graphs of Variations of y = sin x and y = cos x
Now that we understand how and relate to the general form equation for the sine and cosine functions, we will explore the variables and . Recall the general form:
The value for a sinusoidal function is called the phase shift, or the horizontal displacement of the basic sine or cosine function. If , the graph shifts to the right. If , the graph shifts to the left. The greater the value of , the more the graph is shifted. The figure below shows that the graph of shifts to the right by units, which is more than we see in the graph of , which shifts to the right by units.
While relates to the horizontal shift, indicates the vertical shift from the midline in the general formula for a sinusoidal function, as in the figure below. The function has its midline at .
Any value of other than zero shifts the graph up or down. The figure below compares with , which is shifted units up on a graph.
Example. Determine the direction and magnitude of the phase shift for .
Solution. Let’s begin by comparing the equation to the general form .
In the given equation, notice that and . So the phase shift is
or units to the left.
Analysis. 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 . Therefore can be rewritten as . If the value of is negative, the shift is to the left.
Determine the phase shift foras a signed value (positive = right, negative = left).
Compare toand compute.Example. Determine the direction and magnitude of the vertical shift for .
Solution. Let’s begin by comparing the equation to the general form .
In the given equation, so the shift is units downward.
What is the midline of?
The midline is; readdirectly from the equation.How to: given a sinusoidal function in the form , identify the midline, amplitude, period, and phase shift.
- Determine the amplitude as .
- Determine the period as .
- Determine the phase shift as .
- Determine the midline as .
Example. Determine the midline, amplitude, period, and phase shift of the function .
Solution. Let’s begin by comparing the equation to the general form .
, so the amplitude is .
Next, , so the period is .
There is no added constant inside the parentheses, so and the phase shift is .
Finally, , so the midline is .
Analysis. Inspecting the graph, we can determine that the period is , the midline is , and the amplitude is , as shown below.
For the amplitude, period, and phase shift of (its midline is ):
What is the amplitude of, entered as a decimal?
The amplitude is.What is the period of?
Computewith.Determine the phase shift foras a signed value (positive = right, negative = left).
Computewithand.Example. Determine the formula for the cosine function in the figure below.
Solution. To determine the equation, we need to identify each value in the general form of a sinusoidal function.
The graph could represent either a sine or a cosine function that is shifted and/or reflected. When , the graph has an extreme point, . Since the cosine function has an extreme point for , 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 . This value, which is the midline, is in the equation, so .
The greatest distance above and below the midline is the amplitude. The maxima are units above the midline and the minima are units below the midline. So . Another way we could have determined the amplitude is by recognizing that the difference between the height of local maxima and minima is , so . Also, the graph is reflected about the -axis so that .
The graph is not horizontally stretched or compressed, so ; and the graph is not shifted horizontally, so .
Putting this all together,
Determine the formula for the sine function shown above.
Read the midline from the graph’s range, then the amplitude is the distance from midline to peak.Example. Determine the equation for the sinusoidal function in the figure below.
Solution. With the highest value at and the lowest value at , the midline will be halfway between at . So .
The distance from the midline to the highest or lowest value gives an amplitude of .
The period of the graph is , which can be measured from the peak at to the next peak at , or from the distance between the lowest points. Therefore, . Using the positive value for , we find that
So far, our equation is either or . 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 , is at , and given the horizontal compression factor of , we get .
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
Again, these functions are equivalent, so both yield the same graph.
Write a formula for the function graphed above.
Find the midline and amplitude from the maximum and minimum, then find the period from one full cycle to locate, and finally the horizontal shift of the first peak to locate.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
we will let and and work with a simplified form of the equations in the following examples.
How to: given the function , sketch its graph.
- Identify the amplitude, .
- Identify the period, .
- Start at the origin, with the function increasing to the right if is positive or decreasing if is negative.
- At there is a local maximum for or a minimum for , with .
- The curve returns to the -axis at .
- There is a local minimum for (maximum for ) at with .
- The curve returns again to the -axis at .
Example. Sketch a graph of .
Solution. Let’s begin by comparing the equation to the form .
Step 1. We can see from the equation that , so the amplitude is .
Step 2. The equation shows that , so the period is
Step 3. Because is negative, the graph descends as we move to the right of the origin.
Steps 4–7. The -intercepts are at the beginning of one period, , the horizontal midpoints are at and at the end of one period at .
The quarter points include the minimum at and the maximum at . A local minimum will occur units below the midline, at , and a local maximum will occur at units above the midline, at . The figure below shows the graph of the function.
For the graph of , whose midline is and phase shift is :
What is the amplitude of, entered as a decimal?
The amplitude is.What is the period of?
Computewith.How to: given a sinusoidal function with a phase shift and a vertical shift, sketch its graph.
- Express the function in the general form or .
- Identify the amplitude, .
- Identify the period, .
- Identify the phase shift, .
- Draw the graph of shifted to the right or left by and up or down by .
Example. Sketch a graph of .
Solution. Step 1. The function is already written in general form: . This graph will have the shape of a sine function, starting at the midline and increasing to the right.
Step 2. . The amplitude is .
Step 3. Since , we determine the period as follows.
The period is .
Step 4. Since , the phase shift is
The phase shift is unit.
Step 5. The figure below shows the graph of the function.
For , whose midline is :
What is the amplitude of?
The amplitude is; note the printed coefficient here is, so its absolute value is the amplitude.What is the period of?
Computewith.Determine the phase shift foras a signed value (positive = right, negative = left).
Rewriteasso, then compute.Example. Given , determine the amplitude, period, phase shift, and vertical shift. Then graph the function.
Solution. Begin by comparing the equation to the general form and use the steps outlined above.
Step 1. The function is already written in general form.
Step 2. Since , the amplitude is .
Step 3. , so the period is . The period is .
Step 4. , so we calculate the phase shift as . The phase shift is .
Step 5. , so the midline is , and the vertical shift is up .
Since is negative, the graph of the cosine function has been reflected about the -axis.
The figure below shows one cycle of the graph of the function.
Using Transformations of Sine and Cosine Functions
We can use the transformations of sine and cosine functions in numerous applications. As mentioned at the beginning of the chapter, circular motion can be modeled using either the sine or cosine function.
Example. A point rotates around a circle of radius centered at the origin. Sketch a graph of the -coordinate of the point as a function of the angle of rotation.
Solution. Recall that, for a point on a circle of radius , the -coordinate of the point is , so in this case, we get the equation . The constant causes a vertical stretch of the -values of the function by a factor of , which we can see in the graph below.
Analysis. Notice that the period of the function is still ; as we travel around the circle, we return to the point for Because the outputs of the graph will now oscillate between and , the amplitude of the sine wave is .
What is the range of? Write your answer in interval notation.
The outputs oscillate a distanceabove and below the midline.Example. A circle with radius ft is mounted with its center ft off the ground. The point closest to the ground is labeled , as shown below. Sketch a graph of the height above the ground of the point as the circle is rotated; then find a function that gives the height in terms of the angle of rotation.
Solution. Sketching the height, we note that it will start ft above the ground, then increase up to ft above the ground, and continue to oscillate ft above and below the center value of ft, as shown below.
Although we could use a transformation of either the sine or cosine function, we start by looking for characteristics that would make one function easier to use than the other. Let’s use a cosine function because it starts at the highest or lowest value, while a sine function starts at the middle value. A standard cosine starts at the highest value, and this graph starts at the lowest value, so we need to incorporate a vertical reflection.
Second, we see that the graph oscillates above and below the center, while a basic cosine has an amplitude of , so this graph has been vertically stretched by , as in the last example.
Finally, to move the center of the circle up to a height of , the graph has been vertically shifted up by . Putting these transformations together, we find that
A weight is attached to a spring that is then hung from a board, as shown below. As the spring oscillates up and down, the positionof the weight relative to the board ranges fromin. (at time) toin. (at time) below the board. Assumingis given as a sinusoidal function of, find a cosine function that gives the positionin terms of.
The midline is halfway betweenand; the amplitude is the distance from the midline to either extreme, andstarts at its highest value at.Example. The London Eye is a huge Ferris wheel with a diameter of meters ( feet). It completes one rotation every minutes. Riders board from a platform meters above the ground. Express a rider’s height above ground as a function of time in minutes.
Solution. With a diameter of m, the wheel has a radius of m. The height will oscillate with amplitude m above and below the center.
Passengers board m above ground level, so the center of the wheel must be located m above ground level. The midline of the oscillation will be at m.
The wheel takes minutes to complete revolution, so the height will oscillate with a period of minutes.
Lastly, because the rider boards at the lowest point, the height will start at the smallest value and increase, following the shape of a vertically reflected cosine curve.
- Amplitude: , so
- Midline: , so
- Period: , so
- Shape:
An equation for the rider’s height would be
where is in minutes and is measured in meters.
Key equations
| Sinusoidal functions | |
|---|---|
Key concepts
- Periodic functions repeat after a given value. The smallest such value is the period. The basic sine and cosine functions have a period of .
- The function is odd, so its graph is symmetric about the origin. The function is even, so its graph is symmetric about the -axis.
- The graph of a sinusoidal function has the same general shape as a sine or cosine function.
- In the general formula for a sinusoidal function, the period is .
- In the general formula for a sinusoidal function, represents amplitude. If , the function is stretched, whereas if , the function is compressed.
- The value in the general formula for a sinusoidal function indicates the phase shift.
- The value in the general formula for a sinusoidal function indicates the vertical shift from the midline.
- Combinations of variations of sinusoidal functions can be detected from an equation.
- The equation for a sinusoidal function can be determined from a graph.
- A function can be graphed by identifying its amplitude and period.
- A function can also be graphed by identifying its amplitude, period, phase shift, and horizontal shift.
- Sinusoidal functions can be used to solve real-world problems.
Practice
Graph variations of and
A sinusoidal curve is shown above. What is its amplitude?
The amplitude is half the distance between the maximum and minimum-values.What is the period of the same curve?
The period is the horizontal distance between two consecutive maxima.What is the midline of the same curve?
The midline sits halfway between the maximum and minimum-values.Write an equation involving the sine function for the same curve.
Use the amplitude, period, and midline you already found; the curve crosses its midline rising at.What is the range of? Write your answer in interval notation.
The outputs oscillate a distanceabove and below the midline.What is the period of?
No coefficient ofis written, soand.Which graph shows two periods of?
Two periods of a function with periodspan an interval of length; a cosine curve starts at its maximum.Use phase shifts of sine and cosine curves
Determine the phase shift foras a signed value (positive = right, negative = left).
Rewriteasso,, then compute.What is the midline of?
The midline is; readdirectly from the equation.Determine the phase shift foras a signed value (positive = right, negative = left).
Rewriteasso,, then compute.What is the midline of?
The midline is; readdirectly from the equation.This section is adapted from Precalculus 2e, Section 6.1: Graphs of the Sine and Cosine Functions by Jay Abramson and OpenStax, © OpenStax, licensed under CC BY-NC-SA 4.0. Access the original for free at openstax.org. Changes: omitted the opening rainbow-prism credit photograph (Figure 1), which carries no mathematics. Recreated every instructional graph as an accessible spec-first SVG built from its exact equation, using the new sine/cosine curve kinds: the plotted and parent curves with their table points; the compound unit-circle/sine-curve correspondence figure, redrawn as radius segments and dashed guide lines within one shared coordinate system rather than the source’s two-panel raster image; the period comparison of and with a bracketed “1 period” span; the odd- and even-symmetry sine and cosine graphs; the period-compression comparison; the four-curve amplitude comparison ; the reflected ; the three-curve phase-shift comparison; the generic midline diagram; the vertical-shift comparison vs. ; the annotated (amplitude/midline/period marked); the two “determine the equation from the graph” figures (the reflected-cosine and the shifted-cosine); the annotated grid-plotted ; the annotated ; the annotated (amplitude/midline/period marked); the circular-motion curve; and the Ferris-wheel-style height curve. The circle-mounted-on-a-stand illustration (radius ft, center ft up, point ) and the weight-on-a-spring illustration were recreated as simplified kind="figure" schematics (a labeled circle over a ground line; a labeled board, measurement segment, and weight) rather than literal photographic-style renderings, since the engine has no spring-coil primitive and none of the illustration’s geometry is graded. The Practice block’s “determine the amplitude, period, midline, and an equation” graph-reading exercise, and both “determine the formula” in-page figures, kept their own bare, unlabeled curves (no amplitude/midline arrows and no printed equation, since those are exactly what each item asks the learner to find); every such figure’s accessible description states only the same raw coordinates and axis marks a sighted reader would read off the image, never the derived amplitude/period/midline/equation vocabulary that would answer the accompanying question. Converted every “Try It” into interactive components with instant feedback. Two amplitude Try Its whose printed coefficient (, ) is literally the requested value were restated to avoid a pure retype: the first asks for the amplitude as a decimal (, distinct from the printed span) alongside a separate stretched-or-compressed multiple choice, and the second asks for the range instead of the amplitude directly. Every phase-shift answer is requested “as a signed value (positive = right, negative = left),” combining the source’s separate direction-and-magnitude answer into one graded quantity, and every midline answer is requested as the equation . Two Try Its that ask for all four of the midline, amplitude, period, and phase shift (Try It 5, Try It 9) keep only the three non-trivial values interactive, since each has a midline of ; Try It 8 keeps only its amplitude and period interactive, since its midline and phase shift are both — each dropped value is stated in the surrounding prose instead, to keep the in-page practice set at the 2–3 question cap. “Sketch a graph” instructions are not graded as drawn curves in this chapter (their key points fall on multiples of , off the graphplot snap lattice); each retained sketch Try It instead asks for the derived numeric or symbolic features shown in its worked How-To, per the corpus’s established response-mode adaptation for trigonometric graphing. Added one graph-mode recognition multiple choice (which graph shows two periods of ?), the section’s one graphing-recognition item per corpus convention, with distractors varying the period, the sine/cosine phase, and the reflection. Adapted seven selected end-of-section exercises — one two-full-periods period/range item (the printed amplitude is asked for as a range instead, the same retype-avoidance adaptation used on Try It 10), one graph-reading amplitude/period/midline/equation item, one graph-recognition source item, and two phase-shift/vertical-translation items — into eleven interactive components across a closing Practice block, one group per objective.