Skip to main content
Mathematics LibreTexts

6.1: Graphs of the Sine and Cosine Functions

  • Page ID
    117147
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    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 \(\PageIndex{1}\) lists some of the values for the sine function on a unit circle.

    Table \(\PageIndex{1}\)
    \(x\) \(0\) \(\frac{\pi}{6}\) \(\frac{\pi}{4}\) \(\frac{\pi}{3}\) \(\frac{\pi}{2}\) \(\dfrac{2\pi}{3}\) \(\dfrac{3\pi}{4}\) \(\dfrac{5\pi}{6}\) \(\pi\)
    \(\sin(x)\) \(0\) \(\frac{1}{2}\) \(\frac{\sqrt{2}}{2}\) \(\frac{\sqrt{3}}{2}\) \(1\) \(\dfrac{\sqrt{3}}{2}\) \(\dfrac{\sqrt{2}}{2}\) \(\dfrac{1}{2}\) \(0\)

    Plotting the points from the table and continuing along the x-axis gives the shape of the sine function. See Figure \(\PageIndex{2}\).

    A graph of sin(x). Local maximum at (pi/2, 1). Local minimum at (3pi/2, -1). Period of 2pi.
    Figure \(\PageIndex{2}\): The sine function

    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 \(\PageIndex{3}\).

    A side-by-side graph of a unit circle and a graph of sin(x). The two graphs show the equivalence of the coordinates.
    Figure \(\PageIndex{3}\): Plotting values of the sine function

    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 \(\PageIndex{2}\) lists some of the values for the cosine function on a unit circle.

    Table \(\PageIndex{2}\)
    \(x\) \(0\) \(\frac{\pi}{6}\) \(\frac{\pi}{4}\) \(\frac{\pi}{3}\) \(\frac{\pi}{2}\) \(\frac{2\pi}{3}\) \(\dfrac{3\pi}{4}\) \(\dfrac{5\pi}{6}\) \(\pi\)
    \(\cos(x)\) \(1\) \(\frac{\sqrt{3}}{2}\) \(\frac{\sqrt{2}}{2}\) \(\dfrac{1}{2}\) \(0\) \(-\dfrac{1}{2}\) \(-\dfrac{\sqrt{2}}{2}\) \(-\dfrac{\sqrt{3}}{2}\) \(-1\)

    As with the sine function, we can plots points to create a graph of the cosine function as in Figure \(\PageIndex{4}\).

    A graph of cos(x). Local maxima at (0,1) and (2pi, 1). Local minimum at (pi, -1). Period of 2pi.
    Figure \(\PageIndex{4}\): The cosine function

    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 \([ −1,1 ]\).

    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(x+P)=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 \(\PageIndex{5}\) shows several periods of the sine and cosine functions.

    Side-by-side graphs of sin(x) and cos(x). Graphs show period lengths for both functions, which is 2pi.
    Figure \(\PageIndex{5}\)

    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 \(\PageIndex{6}\), 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\space x\). Now we can clearly see this property from the graph.

    A graph of sin(x) that shows that sin(x) is an odd function due to the odd symmetry of the graph.
    Figure \(\PageIndex{6}\): Odd symmetry of the sine function

    Figure \(\PageIndex{7}\) 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\space x\).

    A graph of cos(x) that shows that cos(x) is an even function due to the even symmetry of the graph.
    Figure \(\PageIndex{7}\): Even symmetry of the cosine function
    CHARACTERISTICS OF SINE AND COSINE FUNCTIONS

    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 \((−\infty,\infty)\) and the range is \([ −1,1 ]\).
    • The graph of \(y=\sin\space x\) is symmetric about the origin, because it is an odd function.
    • The graph of \(y=\cos\space x\) is symmetric about they- \(y\)-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

    \[y=A\sin(Bx−C)+D\]

    and

    \[y=A\cos(Bx−C)+D\]

    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=\dfrac{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(x)\), \(B=1\), so the period is \(2\pi\),which we knew. If \(f(x)=\sin(2x)\), then \(B=2\), so the period is \(\pi\) and the graph is compressed. If \(f(x)=\sin\left(\dfrac{x}{2}\right)\), then \(B=\dfrac{1}{2}\), so the period is \(4\pi\) and the graph is stretched. Notice in Figure \(\PageIndex{8}\) how the period is indirectly related to \(|B|\).

    A graph with three items. The x-axis ranges from 0 to 2pi. The y-axis ranges from -1 to 1. The first item is the graph of sin(x) for one full period. The second is the graph of sin(2x) over two periods. The third is the graph of sin(x/2) for one half of a period.
    Figure \(\PageIndex{8}\)
    PERIOD OF SINUSOIDAL FUNCTIONS

    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(Bx)\)
    • \(y=A\cos(Bx)\)

    The period is \(\dfrac{2\pi}{|B|}\).

    Example \(\PageIndex{1}\): Identifying the Period of a Sine or Cosine Function

    Determine the period of the function \(f(x)=\sin\left(\dfrac{\pi}{6}x\right)\).

    Solution

    Let’s begin by comparing the equation to the general form \(y=A\sin(Bx)\).

    In the given equation, \(B=\dfrac{\pi}{6}\), so the period will be

    \[ \begin{align*} P&=\dfrac{2\pi}{|B|} \\[4pt] &=\dfrac{2\pi}{\dfrac{\pi}{6}} \\ &=2\pi ⋅ \dfrac{6}{\pi} \\[4pt] &=12 \end{align*}\]

    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 vertical midline of the graph, which is the line \(x=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 \(\PageIndex{9}\) compares several sine functions with different amplitudes.

    A graph with four items. The x-axis ranges from -6pi to 6pi. The y-axis ranges from -4 to 4. The first item is the graph of sin(x), which has an amplitude of 1. The second is a graph of 2sin(x), which has amplitude of 2. The third is a graph of 3sin(x), which has an amplitude of 3. The fourth is a graph of 4 sin(x) with an amplitude of 4.
    Figure \(\PageIndex{9}\)
    AMPLITUDE OF SINUSOIDAL FUNCTIONS

    If we let \(C=0\) and \(D=0\) in the general form equations of the sine and cosine functions, we obtain the forms

    \[\begin{align} y=A\sin(Bx)\text { and } y=A\cos(Bx) \end{align}\]

    The amplitude is \(A\), and the vertical height from the midline is \(|A|\). In addition, notice in the example that

    \[|A| = amplitude = \dfrac{1}{2}∣maximum − minimum|\]

    Example \(\PageIndex{2}\): Identifying the Amplitude of a Sine or Cosine Function

    What is the amplitude of the sinusoidal function \(f(x)=−4\sin(x)\)? Is the function stretched or compressed vertically?

    Solution

    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.

    Analysis

    The negative value of \(A\) results in a reflection across the \(x\)-axis of the sine function, as shown in Figure \(\PageIndex{10}\).

    A graph of -4sin(x). The function has an amplitude of 4. Local minima at (-3pi/2, -4) and (pi/2, -4). Local maxima at (-pi/2, 4) and (3pi/2, 4). Period of 2pi.
    Figure \(\PageIndex{10}\)

    Analyzing Graphs of Variations of \(y = \sin\space x\) and \(y = \cos\space 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:

    \[y=A\sin(Bx-C)+D\qquad \text{ and } \qquad y=A\cos(Bx-C)+D\]

    or

    \[y=A\sin\left (B\left (x-\dfrac{C}{B} \right ) \right )+D \qquad \text{ and } \qquad y=A\cos\left (B\left (x-\dfrac{C}{B} \right ) \right )+D\]

    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 \(\PageIndex{11}\) shows that the graph of \(f(x)=\sin(x−\pi)\) 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.

    A graph with three items. The first item is a graph of sin(x). The second item is a graph of sin(x-pi/4), which is the same as sin(x) except shifted to the right by pi/4. The third item is a graph of sin(x-pi), which is the same as sin(x) except shifted to the right by pi.
    Figure \(\PageIndex{11}\)

    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 \(\PageIndex{12}\). The function \(y=\cos(x)+D\) has its midline at \(y=D\).

    A graph of y=Asin(x)+D. Graph shows the midline of the function at y=D.
    Figure \(\PageIndex{12}\)

    Any value of \(D\) other than zero shifts the graph up or down. Figure \(\PageIndex{13}\) compares \(f(x)=\sin x\) with \(f(x)=\sin x+2\), which is shifted \(2\) units up on a graph.

    A graph with two items. The first item is a graph of sin(x). The second item is a graph of sin(x)+2, which is the same as sin(x) except shifted up by 2.
    Figure \(\PageIndex{13}\)
    VARIATIONS OF SINE AND COSINE FUNCTIONS

    Given an equation in the form \(f(x)=A \sin (Bx−C)+D\) or \(f(x)=A \cos (Bx−C)+D\), \(\frac{C}{D}\) is the phase shift and \(D\) is the vertical shift.

    Example \(\PageIndex{3}\): Identifying the Phase Shift of a Function

    Determine the direction and magnitude of the phase shift for \(f(x)=\sin\left(x+\frac{\pi}{6}\right)−2\).

    Solution

    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{align*} \dfrac{C}{B}&= -\frac{\frac{\pi}{6}}{1}\\ &= -\frac{\pi}{6} \end{align*}\]

    or \(\frac{\pi}{6}\) 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 \(C\). Therefore \(f(x)=\sin(x+\frac{\pi}{6})−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.

    Exercise \(\PageIndex{3}\)

    Determine the direction and magnitude of the phase shift for \(f(x)=3\cos\left(x−\frac{\pi}{2}\right)\).

    Answer

    \(\frac{\pi}{2}\); right

    How to: Given a sinusoidal function in the form \(f(x)=A\sin(Bx−C)+D\),identify the midline, amplitude, period, and phase shift
    1. Determine the amplitude as \(| A |\).
    2. Determine the period as \(P=\frac{2\pi}{| B |}\).
    3. Determine the phase shift as \(\frac{C}{B}\).
    4. Determine the midline as \(y=D\).
    Example \(\PageIndex{7}\): Identifying the Equation for a Sinusoidal Function from a Graph

    Determine the equation for the sinusoidal function in Figure \(\PageIndex{17}\).

    A graph of 3cos(pi/3x-pi/3)-2. Graph has amplitude of 3, period of 6, range of [-5,1].
    Figure \(\PageIndex{17}\)

    Solution

    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=\dfrac{2\pi}{| B |}=6\). Using the positive value for \(B\),we find that

    \[\begin{align*} B&=\dfrac{2\pi}{P}\\ &=\dfrac{2\pi}{6}\\ &=\dfrac{\pi}{3} \end{align*}\]

    So far, our equation is either \(y=3\sin\left(\dfrac{\pi}{3}x−C\right)−2\) or \(y=3\cos\left(\dfrac{\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

    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

    \[\begin{align*} y&=3\cos \left (\frac{\pi}{3}x-\dfrac{\pi}{3} \right )-2 \qquad \text{or} \\ y&=-3\cos \left (\dfrac{\pi}{3}x+\dfrac{2\pi}{3} \right )-2 \end{align*}\]

    Again, these functions are equivalent, so both yield the same graph.

    Graphing Variations of \(y = \sin\space x\) and \(y = \cos\space 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(Bx-C)+D \text{ and } y=A\cos(Bx-C)+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(Bx)\), sketch its graph.
    1. Identify the amplitude, \(| A |\).
    2. Identify the period, \(P=\dfrac{2\pi}{| B |}\).
    3. Start at the origin, with the function increasing to the right if \(A\) is positive or decreasing if \(A\) is negative.
    4. At \(x=\dfrac{\pi}{2| B |}\) there is a local maximum for \(A>0\) or a minimum for \(A<0\), with \(y=A\).
    5. The curve returns to the x-axis at \(x=\dfrac{\pi}{| B |}\).
    6. There is a local minimum for \(A>0\) (maximum for \(A<0\)) at \(x=\dfrac{3\pi}{2| B |}\) with \(y=–A\).
    7. The curve returns again to the x-axis at \(x=\dfrac{\pi}{2| B |}\).
    Example \(\PageIndex{8}\): Graphing a Function and Identifying the Amplitude and Period

    Sketch a graph of \(f(x)=−2\sin\left(\dfrac{\pi x}{2}\right)\).

    Solution

    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=\dfrac{\pi}{2}\), so the period is

      \[\begin{align*} P&=\dfrac{2\pi}{\dfrac{\pi}{2}}\\ &=2\pi \cdot \dfrac{2}{\pi}\\ &=4 \end{align*}\]

    • Step 3. Because \(A\) is negative, the graph descends as we move to the right of the origin.
    • Step 4. 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 \(\PageIndex{19}\) shows the graph of the function.

    A graph of -2sin((pi/2)x). Graph has range of [-2,2], period of 4, and amplitude of 2.
    Figure \(\PageIndex{19}\)
    How to: Given a sinusoidal function with a phase shift and a vertical shift, sketch its graph
    1. Express the function in the general form \(y=A\sin(Bx−C)+D\) or \(y=A\cos(Bx−C)+D\).
    2. Identify the amplitude, \(| A |\).
    3. Identify the period, \(P=\dfrac{2\pi}{| B |}\).
    4. Identify the phase shift, \(\dfrac{C}{B}\).
    5. Draw the graph of \(f(x)=A\sin(Bx)\) shifted to the right or left by \(\dfrac{C}{B}\) and up or down by \(D\).

    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 \(\PageIndex{11}\): Finding the Vertical Component of Circular Motion

    A point rotates around a circle of radius \(3\) centered at the origin. Sketch a graph of the \(y\)-coordinate of the point as a function of the angle of rotation.

    Solution

    Recall that, for a point on a circle of radius \(r\), the \(y\)-coordinate of the point is \(y=r \sin(x)\), so in this case, we get the equation \(y(x)=3 \sin(x)\). The constant \(3\) causes a vertical stretch of the \(y\)-values of the function by a factor of \(3\), which we can see in the graph in Figure \(\PageIndex{24}\).

    A graph of 3sin(x). Graph has period of 2pi, amplitude of 3, and range of [-3,3].
    Figure \(\PageIndex{24}\)

    Analysis

    Notice that the period of the function is still \(2\pi\); as we travel around the circle, we return to the point \((3,0)\) for \(x=2\pi,4\pi,6\pi,\)....Because the outputs of the graph will now oscillate between \(–3\) and \(3\), the amplitude of the sine wave is \(3\).

    Exercise \(\PageIndex{10}\)

    What is the amplitude of the function \(f(x)=7\cos(x)\)? Sketch a graph of this function.

    Answer
    A graph of 7cos(x). Graph has amplitude of 7, period of 2pi, and range of [-7,7].
    Figure \(\PageIndex{25}\)
    Example \(\PageIndex{12}\): Finding the Vertical Component of Circular Motion

    A circle with radius \(3\) ft is mounted with its center \(4\) ft off the ground. The point closest to the ground is labeled \(P\), as shown in Figure \(\PageIndex{26}\). Sketch a graph of the height above the ground of the point \(P\) as the circle is rotated; then find a function that gives the height in terms of the angle of rotation.

    An illustration of a circle lifted 4 feet off the ground. Circle has radius of 3 ft. There is a point P labeled on the circle's circumference.
    Figure \(\PageIndex{26}\)

    Solution

    Sketching the height, we note that it will start \(1\) ft above the ground, then increase up to \(7\) ft above the ground, and continue to oscillate \(3\) ft above and below the center value of \(4\) ft, as shown in Figure \(\PageIndex{27}\).

    A graph of -3cox(x)+4. Graph has midline at y=4, amplitude of 3, and period of 2pi.
    Figure \(\PageIndex{27}\)

    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 \(3\) above and below the center, while a basic cosine has an amplitude of \(1\), so this graph has been vertically stretched by \(3\), as in the last example.

    Finally, to move the center of the circle up to a height of \(4\), the graph has been vertically shifted up by \(4\). Putting these transformations together, we find that

    \(y=−3\cos(x)+4\)


    This page titled 6.1: Graphs of the Sine and Cosine Functions is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by OpenStax via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.