Vertical Shift

Learn how the constant D in y = A sin(x) + D moves a sine or cosine wave up or down, sets its midline and decides its maximum, minimum and range.

Advanced25 minLesson

Definition

Adding a constant DD to a sine or cosine function moves the whole wave up or down. This is called a vertical shift:
y=Asin⁡(x)+Dy=Acos⁡(x)+Dy = A\sin(x) + D \qquad y = A\cos(x) + D
  • If D>0D > 0, the graph moves up by DD units.
  • If D<0D < 0, the graph moves down by ∣D∣|D| units.
  • The shape, the amplitude and the period do not change.

The midline

The midline is the horizontal line the wave oscillates around. For y=sin⁡(x)y = \sin(x) it is the x-axis (y=0y = 0). After the shift it is
midline: y=D\text{midline: } y = D

Maximum, minimum and range

The wave reaches ∣A∣|A| units above and below the midline:
FeatureFormula
Midliney=Dy = D
Maximum value$D +A
Minimum value$D -A
Range$[D -A,\ D +A]$

Going backwards: A and D from data

If you know the highest and lowest values, the midline lies exactly halfway between them and the amplitude is half the distance:
D=max+min2∣A∣=max−min2D = \frac{\text{max} + \text{min}}{2} \qquad |A| = \frac{\text{max} - \text{min}}{2}
In the general form y=Asin⁡(B(x−C))+Dy = A\sin(B(x - C)) + D, the vertical shift is always the last letter, DD. In this lesson B=1B = 1 and C=0C = 0 unless a real situation needs a different period.

Try it now

What is the midline of y=4sin⁡(x)−3y = 4\sin(x) - 3?

Worked Examples

For y=3sin⁡(x)+2y = 3\sin(x) + 2, find the midline, the maximum, the minimum and the range.
1

Identify A and D

Compare with y=Asin⁡(x)+Dy = A\sin(x) + D → A=3A = 3, D=2D = 2
2

Write the midline

The midline is y=Dy = D → y=2y = 2
3

Find the maximum and minimum

D+∣A∣=2+3D + |A| = 2 + 3 and D−∣A∣=2−3D - |A| = 2 - 3 → Maximum 55, minimum −1-1
4

Write the range

All y-values from the minimum to the maximum → [−1,5][-1, 5]

Common Mistakes

Writing the maximum of y=−3sin⁡(x)+1y = -3\sin(x) + 1 as 1+(−3)=−21 + (-3) = -2

Why it's wrong: The wave reaches the amplitude above and below the midline, and the amplitude is always positive. The sign of AA only flips the wave.

Correct: Maximum =D+∣A∣=1+3=4= D + |A| = 1 + 3 = 4, minimum =D−∣A∣=1−3=−2= D - |A| = 1 - 3 = -2.

Reading y=sin⁡(x)−2y = \sin(x) - 2 as a shift up by 2

Why it's wrong: In y=Asin⁡(x)+Dy = A\sin(x) + D the shift is DD with its sign. Here D=−2D = -2.

Correct: y=sin⁡(x)−2y = \sin(x) - 2 moves the wave down 2 units, the midline is y=−2y = -2.

Calling the maximum the amplitude: in y=2sin⁡(x)+5y = 2\sin(x) + 5 the amplitude is 7

Why it's wrong: The amplitude is measured from the midline, not from the x-axis. The shift adds height but does not make the wave taller.

Correct: The amplitude is ∣A∣=2|A| = 2. The maximum is 5+2=75 + 2 = 7.

Forgetting to divide by 2: amplitude =max−min= \text{max} - \text{min}

Why it's wrong: max−min\text{max} - \text{min} is the full height from the lowest to the highest point, which is two amplitudes.

Correct: ∣A∣=max−min2|A| = \frac{\text{max} - \text{min}}{2} and D=max+min2D = \frac{\text{max} + \text{min}}{2}. For max 9 and min 3: ∣A∣=3|A| = 3, D=6D = 6.

Interactive Visual

Function graph

y = sin(x)

Challenge 1 of 5

Shift up by 2

Move the sliders until your curve lies exactly on the dashed target curve.

How close

0 of 5 solved

  • A: right
  • D: bigger
-2π-π0π2π-6-4-20246xy

Tap or hover over the graph to read off values.

y = A·sin(x) + DShift up by 2

Function graph

-2π-π0π2π-505xy(-3.14, -1)(0, 3)(3.14, -1)Midline y = D

Tap or hover over the graph to read off values.

  • Midline y = 1
  • Maximum = 3
  • Minimum = -1
y = A·cos(x) + DMidline y = D
  • Minimum: (-3.14, -1)
  • Maximum: (0, 3)
  • Minimum: (3.14, -1)

Interactive Sandbox

Interactive Grapher

-3π-2π-π0π2π3π-4-2024xy

Tap or hover over the graph to read off values.

Try these examples:

sin(x) + 2

Expression Calculator

Try these:

History

No calculations yet

Practice Problems

18 problems
Problem 1 of 18
Easy
What is the midline of y=4sin⁡(x)−3y = 4\sin(x) - 3?

Why It Matters

Most real waves do not swing around zero. They swing around some typical level, and that level is the vertical shift:
  • Tides: the water in a harbor rises and falls around an average depth, for example between 1 m and 5 m around a midline of 3 m.
  • Ferris wheels: a seat goes up and down around the height of the wheel's center, never below the boarding platform.
  • Daily temperature: the temperature swings around the day's average, for example between 12°C and 24°C around 18°C.
  • Blood pressure and heartbeats: pressure pulses between about 80 and 120 around a midline of 100.
  • Daylight hours: day length varies over the year around about 12 hours.
With the midline formula D=max+min2D = \frac{\text{max} + \text{min}}{2} you can turn two measurements into a working model, and with the range you can check at a glance whether a model makes sense.

Real World Applications

Ferris Wheels

The height of a seat on a Ferris wheel goes up and down like a cosine wave. The midline is the height of the wheel's center.

Example:

A wheel with diameter 40 m whose lowest seat is 2 m above the ground can be modeled by h(t)=−20cos⁡(π10t)+22h(t) = -20\cos\left(\frac{\pi}{10}t\right) + 22 (t in minutes): amplitude 20, midline 22, range [2,42][2, 42].

1Try It Yourself

A Ferris wheel has a diameter of 40 m. Its lowest point is 2 m above the ground.

At what height is the midline of the height function (the center of the wheel), in meters?

Step 1: Write the mathematical expression

Average the highest and lowest heights:

Tides

Harbor masters and sailors model the water level with a sine or cosine wave whose midline is the mean water level.

Example:

If high tide is 5.2 m and low tide is 0.8 m, the mean water level is 5.2+0.82=3\frac{5.2 + 0.8}{2} = 3 m, so the model has D=3D = 3.

2Try It Yourself

At a port, high tide is 5.2 m and low tide is 0.8 m.

What is the amplitude of the tide model, in meters?

Step 1: Write the mathematical expression

Take half the difference between high and low tide:

Temperature over a Day

Weather scientists model the temperature over 24 hours with a cosine wave around the day's average temperature.

Example:

The model T(t)=−6cos⁡(π12t)+18T(t) = -6\cos\left(\frac{\pi}{12}t\right) + 18, with t in hours after 3:00, is coldest at 3:00 and warmest 12 hours later.

3Try It Yourself

The temperature in a city is modeled by T(t)=−6cos⁡(π12t)+18T(t) = -6\cos\left(\frac{\pi}{12}t\right) + 18 in °C.

What is the highest temperature of the day, in °C?

Step 1: Write the mathematical expression

Add the amplitude to the midline:

Key Takeaways

  • 1In y=Asin⁡(x)+Dy = A\sin(x) + D and y=Acos⁡(x)+Dy = A\cos(x) + D, the constant DD moves the wave up (D>0D > 0) or down (D<0D < 0)
  • 2The midline is the horizontal line y=Dy = D, halfway between the maximum and the minimum
  • 3Maximum =D+∣A∣= D + |A| and minimum =D−∣A∣= D - |A|, always with the absolute value of AA
  • 4The range is [D−∣A∣, D+∣A∣][D - |A|,\ D + |A|]
  • 5From data: D=max+min2D = \frac{\text{max} + \text{min}}{2} and ∣A∣=max−min2|A| = \frac{\text{max} - \text{min}}{2}
  • 6A vertical shift changes neither the amplitude nor the period, only the height of the whole wave

Frequently Asked Questions

No. DD moves every point of the graph up or down by the same amount, so the wave keeps its height and its width. Only the midline, the maximum, the minimum and the range change.
No. DD moves every point of the graph up or down by the same amount, so the wave keeps its height and its width. Only the midline, the maximum, the minimum and the range change.
They come from the same number. The vertical shift is the movement (for example 3 units up), and the midline is the line where the middle of the wave ends up (y=3y = 3).
A number added outside the function changes the output, so the graph moves vertically. A number added inside, to xx, changes the input, so the graph moves sideways. That sideways move is the phase shift, covered in the lesson Phase Shift.
Yes, when D>∣A∣D > |A|. Then the minimum D−∣A∣D - |A| is positive. For example y=2sin⁡(x)+5y = 2\sin(x) + 5 never goes below 33. Ferris wheel heights and tide depths behave like this.

Glossary

Vertical shift
Moving a whole graph up or down by adding a constant DD to the function
Midline
The horizontal line y=Dy = D halfway between the maximum and minimum values of a wave
Maximum value
The highest y-value of the wave, D+∣A∣D + |A|
Minimum value
The lowest y-value of the wave, D−∣A∣D - |A|
Range
All y-values the function takes: [D−∣A∣, D+∣A∣][D - |A|,\ D + |A|] for a shifted sine or cosine
Sinusoidal model
A sine or cosine function used to describe a repeating real situation, such as tides or temperature

Formula Card

Shifted sine and cosine

y=Asin⁡(x)+Dy = A\sin(x) + D, y=Acos⁡(x)+Dy = A\cos(x) + D

D moves the wave up (D > 0) or down (D < 0)

Midline

y=Dy = D

The line the wave oscillates around

Maximum and minimum

D+∣A∣D + |A| and D−∣A∣D - |A|

Highest and lowest values of the wave

Range

[D−∣A∣, D+∣A∣][D - |A|,\ D + |A|]

All output values

From data

D=max+min2D = \frac{\text{max} + \text{min}}{2}, ∣A∣=max−min2|A| = \frac{\text{max} - \text{min}}{2}

Midline and amplitude from the highest and lowest values

Today's challengeOne problem, three tries

More in This Topic