Skip to content
Tutorials Center
My learning

Topics

Lesson 17 of 38 ยท Graphs of Trigonometric Functions

Phase Shift and Vertical Shift

Move a sine or cosine wave left, right, up or down. Learn the general form y = A sin(B(x - C)) + D, find the midline, and model tides and daylight hours.

You can now stretch a wave in height and width. Two more adjustments slide it around the plane: a phase shift moves it left or right, and a vertical shift moves it up or down. With all four numbers you can model almost any smooth repeating pattern, from ocean tides to daylight hours.

The general form

y = A sin(B(x โˆ’ C)) + D

Letter Effect Reading
A Vertical stretch Amplitude is the absolute value of A
B Horizontal squeeze Period is 2ฯ€ divided by the absolute value of B
C Horizontal shift Phase shift: C units to the right (negative C means left)
D Vertical shift Midline y = D

The same form works for cosine. The maximum of the wave is D + |A| and the minimum is D โˆ’ |A|.

Phase shift

Replacing x with x โˆ’ C slides the graph right by C. So y = sin(x โˆ’ ฯ€/3) is the sine wave moved ฯ€/3 to the right, and y = sin(x + ฯ€/4) is moved ฯ€/4 to the left.

A common trap: when the equation is written as y = sin(Bx โˆ’ E), factor out B first. For y = sin(2x โˆ’ ฯ€/2), write it as sin(2(x โˆ’ ฯ€/4)). The shift is ฯ€/4, not ฯ€/2. Remember the phase shift is E / B.

Vertical shift

Adding D lifts the whole graph. y = sin x + 2 oscillates between 1 and 3, around the midline y = 2.

Python Shifts in action

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Reading a full equation

Example. y = 3 sin(2(x โˆ’ ฯ€/4)) + 1.

  • Amplitude 3.
  • Period 2ฯ€/2 = ฯ€.
  • Phase shift ฯ€/4 to the right.
  • Midline y = 1; maximum 4, minimum โˆ’2.

Example with a hidden factor. y = โˆ’2 cos(3x + ฯ€) โˆ’ 4. Write 3x + ฯ€ = 3(x + ฯ€/3), so the phase shift is ฯ€/3 to the left. Amplitude 2, period 2ฯ€/3, midline y = โˆ’4, reflected because of the minus sign. Maximum โˆ’2, minimum โˆ’6.

Python Wave analyzer

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Modeling a real situation

Suppose the depth of water in a harbor follows a cosine pattern. At high tide the depth is 9 m and at low tide it is 3 m. One full cycle takes 12 hours, and high tide happens at t = 2 hours.

  • Midline: (9 + 3) / 2 = 6.
  • Amplitude: (9 โˆ’ 3) / 2 = 3.
  • Period 12, so B = 2ฯ€/12 = ฯ€/6.
  • Cosine starts at its maximum, so shift it right by 2: C = 2.

d(t) = 3 cos(ฯ€/6 ร— (t โˆ’ 2)) + 6

This is a model: real tides are messier and combine several waves, so the formula is only an approximation.

Python A simple tide model

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

To turn data into a model: midline = (max + min)/2, amplitude = (max โˆ’ min)/2, then find B from the period and C from where a maximum (for cosine) or a midline crossing going up (for sine) occurs.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. y = sin(x - ฯ€/2) is the graph of sin x shifted...

    Replacing x with x - C shifts the graph C units to the right.
  2. 2. What is the midline of y = 2 cos x - 3?

    The vertical shift D = -3 gives the midline.
  3. 3. What are the maximum and minimum of y = 4 sin x + 1?

    Max = D + |A| = 5 and min = D - |A| = -3.
  4. 4. For y = sin(2x - ฯ€), what is the phase shift?

    Factor: sin(2(x - ฯ€/2)), so the shift is ฯ€/2 to the right.

Summary

  • General form: y = A sin(B(x โˆ’ C)) + D; cosine uses the same four numbers.
  • |A| is the amplitude, 2ฯ€/|B| the period, C the horizontal shift, D the midline.
  • Always factor B out of the bracket before reading the phase shift.
  • Max D + |A|, min D โˆ’ |A|.

Next: The Graph of Tangent