Math Core

Lesson 4.2 · Trigonometric Functions

Graphs of trigonometric functions

Unrolling the unit circle onto an xyxy-plane turns each trig function into a graph you can read at a glance. Once you know the two basic waves and the four transformations that act on them, you can graph any sinusoid, read its equation off a picture, and see where tangent and the reciprocal functions blow up.

Sine and cosine as waves

Walk around the unit circle and record the height of the point as a function of the angle xx. That height is sin⁡x\sin x: it starts at 00, climbs to 11 at π2\dfrac{\pi}{2}, returns to 00 at π\pi, drops to −1-1 at 3π2\dfrac{3\pi}{2} and comes back to 00 at 2π2\pi. Recording the horizontal coordinate instead gives cos⁡x\cos x, which starts at its maximum.

y = sin x passes through the origin; y = cos x starts at its maximum (0, 1).Open in grapher →

Everything from the previous lesson is visible here. Both graphs have domain all reals, range [−1,1][-1, 1] and period 2π2\pi. Cosine is symmetric about the yy-axis (even); sine is symmetric about the origin (odd). And the cosine graph is the sine graph shifted left by π2\dfrac{\pi}{2}:

cos⁡x=sin⁡(x+π2).\cos x = \sin\left(x + \frac{\pi}{2}\right).

So there is really one wave shape, called a sinusoid, and either function can describe it.

Each period splits into four equal quarters, and at the quarter marks the wave hits five key points: for sine the heights are 0,1,0,−1,00, 1, 0, -1, 0 (midline, max, midline, min, midline) and for cosine 1,0,−1,0,11, 0, -1, 0, 1.

The four transformations

The general sinusoid

y=Asin⁡(B(x−C))+Dory=Acos⁡(B(x−C))+D,B>0.y = A\sin\big(B(x - C)\big) + D \qquad \text{or} \qquad y = A\cos\big(B(x - C)\big) + D, \qquad B > 0.
  • Amplitude ∣A∣|A|: half the distance from max to min. If A<0A < 0 the wave is also reflected over its midline.
  • Period 2πB\dfrac{2\pi}{B}: the length of one cycle. The frequency B2π\dfrac{B}{2\pi} is the number of cycles per unit of xx.
  • Phase shift CC: the horizontal shift (right if C>0C > 0).
  • Midline y=Dy = D. The range is [D−∣A∣, D+∣A∣][D - |A|,\ D + |A|].

Why 2πB\dfrac{2\pi}{B}? One cycle of the basic wave happens as its input runs from 00 to 2π2\pi. Here the input is B(x−C)B(x - C), which runs from 00 to 2π2\pi as xx runs from CC to C+2πBC + \dfrac{2\pi}{B}. That same calculation tells you exactly where a cycle starts and ends, which is all you need for graphing.

Common mistake

Factor BB out before reading the phase shift. In y=cos⁡(3x−π)y = \cos(3x - \pi) the shift is not π\pi: rewrite 3x−π=3(x−π3)3x - \pi = 3\left(x - \dfrac{\pi}{3}\right), so the shift is π3\dfrac{\pi}{3} to the right. Equivalently, solve 3x−π=03x - \pi = 0 to find where the cycle starts.

Worked example: Graphing from the key points

Graph one cycle of y=−3sin⁡(2x−π2)+1y = -3\sin\left(2x - \dfrac{\pi}{2}\right) + 1.

Solution. Factor: 2x−π2=2(x−π4)2x - \dfrac{\pi}{2} = 2\left(x - \dfrac{\pi}{4}\right). So A=−3A = -3, B=2B = 2, C=π4C = \dfrac{\pi}{4}, D=1D = 1. The period is 2π2=π\dfrac{2\pi}{2} = \pi, so the cycle runs from π4\dfrac{\pi}{4} to 5π4\dfrac{5\pi}{4} in quarter steps of π4\dfrac{\pi}{4}.

xxπ4\frac{\pi}{4}π2\frac{\pi}{2}3π4\frac{3\pi}{4}π\pi5π4\frac{5\pi}{4}
basic sine001100−1-100
×(−3)\times(-3), then +1+111−2-2114411

Because AA is negative, the wave goes down first: from the midline at (π4,1)\left(\dfrac{\pi}{4}, 1\right) to a minimum of −2-2, back to the midline, up to a maximum of 44, and back.

y = -3sin(2x - π/2) + 1 with its midline y = 1 dashed. Range [-2, 4], period π.Open in grapher →

Writing the equation from a graph

Going backward is just reading the four numbers off the picture.

  1. D=max⁡+min⁡2D = \dfrac{\max + \min}{2} and ∣A∣=max⁡−min⁡2|A| = \dfrac{\max - \min}{2}.
  2. Measure the period (peak to peak, or twice the distance from a peak to the next valley) and set B=2πperiodB = \dfrac{2\pi}{\text{period}}.
  3. Pick a convenient starting point. A peak is the start of a cosine cycle (use A>0A > 0); a valley starts a cosine cycle with A<0A < 0; a midline crossing going up starts a sine cycle.

Because the wave repeats, there are infinitely many correct equations; any one that matches the graph is fine.

Worked example: From features to an equation

A sinusoid has a maximum at (1,9)(1, 9) and the next minimum at (4,3)(4, 3). Write an equation for it.

Solution. D=9+32=6D = \dfrac{9 + 3}{2} = 6 and A=9−32=3A = \dfrac{9 - 3}{2} = 3. From a max to the next min is half a period, so the period is 2(4−1)=62(4 - 1) = 6 and B=2π6=π3B = \dfrac{2\pi}{6} = \dfrac{\pi}{3}. A maximum at x=1x = 1 starts a cosine cycle, so C=1C = 1:

y=3cos⁡(π3(x−1))+6.y = 3\cos\left(\frac{\pi}{3}(x - 1)\right) + 6.

Check: at x=4x = 4, the input is π3⋅3=π\dfrac{\pi}{3} \cdot 3 = \pi, and 3cos⁡π+6=33\cos\pi + 6 = 3. The minimum matches.

Tangent and cotangent

Tangent is sin⁡xcos⁡x\dfrac{\sin x}{\cos x}, so it is undefined wherever cos⁡x=0\cos x = 0: at x=π2+kπx = \dfrac{\pi}{2} + k\pi for every integer kk. Near those values the denominator is tiny and the graph shoots off to ±∞\pm\infty, giving vertical asymptotes. Between asymptotes, tangent rises from −∞-\infty to ∞\infty, passing through 00 at multiples of π\pi. Its period is π\pi, and it has no amplitude because it is unbounded.

y = tan x, period π, with asymptotes (dashed) at odd multiples of π/2.Open in grapher →

For y=Atan⁡(B(x−C))+Dy = A\tan\big(B(x - C)\big) + D the period is πB\dfrac{\pi}{B} (not 2πB\dfrac{2\pi}{B}). To find the asymptotes, set the inside equal to ±π2\pm\dfrac{\pi}{2} and repeat every period.

Cotangent, cos⁡xsin⁡x\dfrac{\cos x}{\sin x}, also has period π\pi. Its asymptotes are where sin⁡x=0\sin x = 0 (at multiples of π\pi), and each branch decreases.

Secant and cosecant

Secant and cosecant are reciprocals of cosine and sine, so they are easiest to graph by first sketching the wave as a guide. Wherever the guide wave crosses 00, the reciprocal has an asymptote. Wherever the wave reaches ±1\pm 1, the reciprocal touches it at the same point. Between, the reciprocal opens away from the axis in U-shapes. The range of sec⁡x\sec x and csc⁡x\csc x is (−∞,−1]∪[1,∞)(-\infty, -1] \cup [1, \infty), and both have period 2π2\pi.

y = sec x over its guide y = cos x (dashed). Each U-shape touches the cosine wave at a peak or valley.Open in grapher →

Worked example: Asymptotes of a transformed tangent

Find the period of y=2tan⁡(x3)y = 2\tan\left(\dfrac{x}{3}\right) and its asymptotes in (−6π,6π)(-6\pi, 6\pi).

Solution. B=13B = \dfrac{1}{3}, so the period is π1/3=3π\dfrac{\pi}{1/3} = 3\pi. The central branch runs while −π2<x3<π2-\dfrac{\pi}{2} < \dfrac{x}{3} < \dfrac{\pi}{2}, that is −3π2<x<3π2-\dfrac{3\pi}{2} < x < \dfrac{3\pi}{2}. The asymptotes are at x=±3π2x = \pm\dfrac{3\pi}{2} plus multiples of 3π3\pi: in the given interval, x=−9π2,−3π2,3π2,9π2x = -\dfrac{9\pi}{2}, -\dfrac{3\pi}{2}, \dfrac{3\pi}{2}, \dfrac{9\pi}{2}.

Tip

Quick check for any sinusoid equation with A>0A > 0: plug in the xx-value of a peak. The inside of the cosine should be a multiple of 2π2\pi (or the inside of the sine should be π2\dfrac{\pi}{2} plus a multiple of 2π2\pi), and the output should be D+∣A∣D + |A|.

Practice

Practice 1

What is the amplitude of y=−4cos⁡(3x)+1y = -4\cos(3x) + 1?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

What is the period of y=5sin⁡(πx3)−2y = 5\sin\left(\dfrac{\pi x}{3}\right) - 2?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

What is the phase shift of y=sin⁡(4x+π)y = \sin\left(4x + \pi\right)?

Practice 4

Give the minimum and maximum values of y=4sin⁡(2x−1)−1y = 4\sin(2x - 1) - 1.

Separate answers with commas, e.g. 2, -5

Practice 5

Which equation matches the graph?

Maximum 1 at x = 0, minimum -3 at x = 2 and x = -2.Open in grapher →
Practice 6

A sinusoid y=Acos⁡(B(x−C))+Dy = A\cos\big(B(x - C)\big) + D with B>0B > 0 has a maximum at x=2x = 2 and the next minimum at x=7x = 7. Find BB.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

Find the vertical asymptotes of y=tan⁡(2x)y = \tan(2x) in the interval (0,π)(0, \pi).

Separate answers with commas, e.g. 2, -5

Practice 8

A Ferris wheel rider's height in meters after tt minutes is h(t)=−20cos⁡(πt5)+25h(t) = -20\cos\left(\dfrac{\pi t}{5}\right) + 25. What is the rider's height at t=103t = \dfrac{10}{3} minutes?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.