Precalculus · F.TF.B.5 · F.IF.C.7E

Midline and vertical shift

A fishing bobber rides a pond’s swell, rising and falling around a level that is not zero. How do you read that resting level, and the highest and lowest points, straight from the formula, and how do you rebuild the formula from them?

Where you are 4 in Amplitude, period and phase shift

When you reach for it

The graphs of y = \sin x and y = \cos x (Graphing sine and cosine) balance on the x-axis: they rise 1 above it and fall 1 below it. Most waves in the world balance somewhere else. Nodira marks a dock post and measures the height of her fishing bobber above the mark as the pond’s swell lifts and drops it. The bobber bobs around 7 inches, never around 0.

A wave like that is written y = a\sin x + k or y = a\cos x + k. The number a sets how far the wave swings; its size |a| is the amplitude (Amplitude and reflection), and this lesson uses that one fact without reteaching it. The number k sets where the wave balances. You reach for this lesson when you need the balance line, the highest value or the lowest value of such a wave from its formula, or when you know the highest and lowest values and need a and k.

Throughout, the input is x itself: no squeeze (Finding the period from the equation) and no sideways slide (Phase shift). One cycle is 2\pi wide.

The procedure

Adding k lifts the whole wave. In y = \sin x + 3, the output at every x is 3 more than \sin x at the same x. Each point of the sine graph moves straight up 3 units, which is the vertical shift of any graph by a number added to the output. Nothing moves sideways, so the wave keeps its shape and its cycle; it simply balances on the line y = 3 now.

y = \sin x + 3
\text{midline } y = 3
y = \sin x
\displaystyle \frac{\pi}{2}
\pi
\displaystyle \frac{3\pi}{2}
2\pi
-1
1
2
3
4
x
y
Figure 1Adding 3 to every output lifts every point 3 units. The wave now rises and falls around the line y = 3 instead of the x-axis.

The midline. For y = a\sin x + k or y = a\cos x + k with a \ne 0, the midline is the horizontal line y = k. The graph is on the midline exactly when the sine (or cosine) is 0, because then the output is a \cdot 0 + k = k. For a sine wave that is at x = n\pi, for a cosine wave at \displaystyle x = \frac{\pi}{2} + n\pi, with n any integer.

The highest and lowest values. For every x,

-1 \le \sin x \le 1

Multiplying by a gives -a \le a\sin x \le a when a > 0, and flips the inequalities to a \le a\sin x \le -a when a < 0. Either way a\sin x runs between -|a| and |a|, and both ends are reached, at the angles where \sin x is 1 or -1. Adding k to all three parts keeps the order:

k - |a| \le a\sin x + k \le k + |a|

The same holds with cosine in place of sine. So:

  • the highest value is k + |a| and the lowest value is k - |a|;
  • the range is [k - |a|, k + |a|];
  • the wave rises |a| above the midline and falls |a| below it, so the midline sits exactly halfway between the highest and lowest values;
  • when a > 0 the highest points come where \sin x = 1 (or \cos x = 1); when a < 0 they come where \sin x = -1 (or \cos x = -1), since a negative a turns the wave upside down.

Reading k and a back. Call the highest value M and the lowest m. Then M = k + |a| and m = k - |a|. Adding the two equations gives M + m = 2k; subtracting gives M - m = 2|a|:

\begin{aligned} k &= \frac{M + m}{2} \\ |a| &= \frac{M - m}{2} \end{aligned}

The midline is the average of the extremes, and the amplitude is half their gap. The sign of a is not in M and m; it comes from where the high points are, as above.

Halfway, point by point. A half turn carries a terminal point to the opposite point of the unit circle (Unit circle symmetry and even-odd identities), so \sin(x + \pi) = -\sin x. For f(x) = a\sin x + k,

\begin{aligned} f(x) + f(x + \pi) &= (a\sin x + k) + (-a\sin x + k) \\ &= 2k \end{aligned}

Any two points of the wave half a cycle apart average to the midline, not only the highest and lowest ones.

Worked examples

Example 1

The bobber’s balance line

Nodira’s bobber is y = 2\cos x + 7 inches above the mark on the dock post, where x is the number of seconds since she started watching. Find the midline, the highest and lowest values and the range, and list the five key points of the first cycle.

Solution

Here a = 2 and k = 7. The midline is y = 7: the bobber balances 7 inches above the mark. The amplitude is |a| = 2, so the highest value is 7 + 2 = 9 and the lowest is 7 - 2 = 5. The range is [5, 9], so the bobber stays between 5 and 9 inches above the mark.

Since a > 0, the high points come where \cos x = 1, at x = 2\pi n, and the low points where \cos x = -1, at x = \pi + 2\pi n. Each key point of y = \cos x, at the quarter turns, has its height doubled and then raised by 7:

x0\displaystyle \frac{\pi}{2}\pi\displaystyle \frac{3\pi}{2}2\pi
\cos x10-101
2\cos x + 797579

The key points are (0, 9), \displaystyle \left(\frac{\pi}{2}, 7\right), (\pi, 5), \displaystyle \left(\frac{3\pi}{2}, 7\right) and (2\pi, 9). One cycle takes 2\pi \approx 6.28 seconds.

\text{midline } y = 7
y = 2\cos x + 7
\displaystyle \frac{\pi}{2}
\pi
\displaystyle \frac{3\pi}{2}
2\pi
1
3
5
7
9
x
y
Figure 2The graph of y = 2\cos x + 7 in Example 1. It rises 2 above the midline y = 7 and falls 2 below it.
Example 2

A wave below the axis

Find the midline, the highest and lowest values and where they occur for y = 3\sin x - 4. Does the graph ever reach the x-axis?

Solution

Write the rule as y = 3\sin x + (-4): a = 3 and k = -4. The midline is y = -4. With |a| = 3, the highest value is -4 + 3 = -1 and the lowest is -4 - 3 = -7, so the range is [-7, -1].

Since a > 0, the highest value comes where \sin x = 1, at \displaystyle x = \frac{\pi}{2} + 2\pi n, and the lowest where \sin x = -1, at \displaystyle x = \frac{3\pi}{2} + 2\pi n. The graph meets its midline where \sin x = 0, at x = n\pi.

Every output is at most -1, so the graph never reaches the x-axis. The whole wave lies below it, balancing on y = -4.

Example 3

A negative coefficient

For y = -5\cos x + 2, find the midline, the highest and lowest values and where they occur. Then find how many times on [0, 2\pi) the graph meets the x-axis, and where.

Solution

Here a = -5 and k = 2. The midline is y = 2 and |a| = 5, so the highest value is 2 + 5 = 7 and the lowest is 2 - 5 = -3.

Because a is negative, the high points are where \cos x is smallest: \cos x = -1 gives y = -5(-1) + 2 = 7, at x = \pi + 2\pi n. The low points are where \cos x = 1, at x = 2\pi n, with y = -5 + 2 = -3.

The value 0 lies strictly between -3 and 7. In one cycle the wave climbs from -3 to 7 and comes back down, so it passes through 0 twice. To find where, solve -5\cos x + 2 = 0, that is \displaystyle \cos x = \frac{2}{5}. The positive cosine puts x in Quadrant I or IV, so \displaystyle x = \cos^{-1}\frac{2}{5} \approx 1.16 or x = 2\pi - 1.16 \approx 5.12.

Example 4

Reading a graph

The figure shows the graph of y = a\cos x + k for some numbers a and k. Find them.

\displaystyle \frac{\pi}{2}
\pi
\displaystyle \frac{3\pi}{2}
2\pi
1
2
3
4
5
6
x
y
Figure 3The graph for Example 4. Its highest value is 6 and its lowest is 1.
Solution

The highest value is M = 6 and the lowest is m = 1. The midline is halfway between:

k = \frac{6 + 1}{2} = \frac{7}{2}

The amplitude is half the gap, \displaystyle |a| = \frac{6 - 1}{2} = \frac{5}{2}. The graph is at its highest at x = 0, where \cos x = 1, so a is positive: \displaystyle a = \frac{5}{2}. The equation is

y = \frac{5}{2}\cos x + \frac{7}{2}

Check: at \displaystyle x = \frac{\pi}{2} the formula gives the midline height \displaystyle \frac{7}{2}, and the graph does cross \displaystyle y = \frac{7}{2} there, halfway between its high and low points.

Example 5

From the top and bottom of the swell

Gulnoza’s bobber is 13 inches above the mark at its highest and 4 inches at its lowest. It is at the top when t = 0 and follows h = a\cos t + k with a > 0, where t is in seconds. Find the formula. When, in the first cycle, is the bobber at its balance level, and how high is it at t = 1?

Solution

The balance level is the midline, the average of the extremes: \displaystyle k = \frac{13 + 4}{2} = \frac{17}{2}, that is 8.5 inches. The amplitude is \displaystyle |a| = \frac{13 - 4}{2} = \frac{9}{2}, and a > 0 is given (it matches the top at t = 0, where \cos 0 = 1). So

h = \frac{9}{2}\cos t + \frac{17}{2}

The bobber is at the midline when \cos t = 0. In the first cycle, 0 \le t \le 2\pi, that is \displaystyle t = \frac{\pi}{2} \approx 1.57 seconds on the way down and \displaystyle t = \frac{3\pi}{2} \approx 4.71 seconds on the way up.

At t = 1, \displaystyle h = \frac{9}{2}\cos 1 + \frac{17}{2} \approx 4.5(0.5403) + 8.5 \approx 10.93 inches. That is between 8.5 and 13, as it should be one second after the top.

Example 6

Two readings fix the wave

A wave y = a\cos x + k passes through (0, 11) and \displaystyle \left(\frac{2\pi}{3}, 2\right). Find a and k, then the highest and lowest values.

Solution

Substitute each point. At x = 0, \cos 0 = 1, so a + k = 11. At \displaystyle x = \frac{2\pi}{3}, \displaystyle \cos\frac{2\pi}{3} = -\frac{1}{2}, so \displaystyle -\frac{1}{2}a + k = 2. Subtracting the second equation from the first removes k:

\frac{3}{2}a = 9, \qquad a = 6

Then k = 11 - 6 = 5, and the wave is y = 6\cos x + 5. The midline is y = 5, the highest value is 5 + 6 = 11 and the lowest is 5 - 6 = -1.

Check: \displaystyle 6 \cdot \left(-\frac{1}{2}\right) + 5 = 2. Neither reading was known in advance to be an extreme, so two equations were needed rather than the average of the extremes.

Boundaries

  • a must not be 0. With a = 0 the “wave” is the flat line y = k; every value is both highest and lowest, and there is no swing to balance.
  • k must be added to the whole output. In y = \sin(x + 3) the 3 is inside, and it slides the graph sideways (Phase shift); the midline is still y = 0. In y = 3(\sin x + 2) the 2 is multiplied too: expanded, the rule is 3\sin x + 6, so the midline is y = 6, not y = 2.
  • a and k must be constants. In \displaystyle y = \sin x + \frac{x}{2} the added amount changes with x, so the graph wobbles around a slanted line and has no horizontal midline, highest value or lowest value at all.
  • The extremes must be read over a whole cycle. The formulas \displaystyle k = \frac{M + m}{2} and \displaystyle |a| = \frac{M - m}{2} need the true highest and lowest values of the wave. A window narrower than 2\pi can show less than the full swing (Exercise 24).

Where this goes next

A squeeze or a sideways slide of the input changes neither the midline nor the extremes, because the sine of any input still runs over exactly [-1, 1]: for instance y = 3\sin(2x - 1) + 5 still balances on y = 5 and runs from 2 to 8. That is why reading a graph starts here. In Writing an equation from a wave the midline and amplitude come first, from the highest and lowest values exactly as in Example 4, and then the period and the shift are read and all four numbers are put together.

Exercises

Midline, highest and lowest values

  1. For y = 3\sin x + 8, give the midline, the highest and lowest values, and the range.
  2. For y = 6\cos x - 1, give the midline, the highest and lowest values, and the range.
  3. For \displaystyle y = \frac{1}{2}\cos x + \frac{3}{2}, give the midline and the highest and lowest values.
  4. For y = -4\sin x + 10, give the midline, the highest and lowest values, and where on [0, 2\pi] each occurs.
  5. For \displaystyle y = -\frac{5}{2}\cos x - 2, give the midline, the highest and lowest values, and where on [0, 2\pi] each occurs.
  6. For y = 2(\cos x - 3), give the midline and the highest and lowest values.

Key points and values

  1. List the five key points of y = 4\cos x - 3 on [0, 2\pi].
  2. List the five key points of y = -2\sin x + 6 on [0, 2\pi].
  3. Where on [-2\pi, 2\pi] does y = 5\sin x + 1 meet its midline?
  4. For y = 3\cos x + 1 on [0, 2\pi), say how many times each of the values 4, \displaystyle \frac{5}{2}, -2 and -3 is reached, and where.
  5. Solve 2\sin x + 5 = 6 on [0, 2\pi].

Reading a and k

  1. A wave y = a\sin x + k with a > 0 has highest value 9 and lowest value 1. Find its equation.
  2. A wave y = a\cos x + k with a > 0 has highest value -2 and lowest value -12. Find its equation.
  3. A wave y = a\cos x + k with a > 0 has highest value 3 and lowest value -4. Find its equation.
\displaystyle \frac{\pi}{2}
\pi
\displaystyle \frac{3\pi}{2}
2\pi
-1
1
2
3
4
5
x
y
Figure 4The graph for Exercise 15. It is low at x = 0 and high at x = \pi.
  1. The figure shows the graph of y = a\cos x + k. Find a and k.
  2. A wave y = a\sin x + k passes through (0, 4) and \displaystyle \left(\frac{\pi}{6}, 6\right). Find a and k, and the highest and lowest values.

The bobber

  1. Nodira’s bobber is 15 inches above the mark at its highest and 9 inches at its lowest, and follows h = a\sin t + k with a > 0, t in seconds. Find the formula and the height at t = 2 seconds, to two decimal places.
  2. Sardor’s bobber follows \displaystyle h = \frac{5}{2}\cos t + 11 inches. Give its midline and its highest and lowest heights. During 0 \le t \le 2\pi, when is it at least \displaystyle \frac{49}{4} inches above the mark, and for how long in total?
  3. Gulnoza’s bobber balances at 10 inches above the mark and its lowest height is 7.5 inches. Find its highest height, and its formula in the form h = a\sin t + k with a > 0.

Reasoning

  1. Explain, using the highest and lowest values, why the midline of y = a\sin x + k is the average of the two.
  2. Show that f(x) = a\cos x + k satisfies f(x) + f(x + \pi) = 2k for every x, and say what this means on the graph.
  3. Sardor says y = 2\sin x + 7 and y = -2\sin x + 7 have the same midline, highest value and lowest value. Is he right? Where do the two graphs differ?
  4. For which a \ne 0 and k does the graph of y = a\sin x + k lie entirely above the x-axis? Explain.
  5. On the window \displaystyle \left[0, \frac{\pi}{2}\right], the graph of y = 4\sin x + 1 runs from 1 up to 5. Averaging those gives 3. Find the true midline and explain what went wrong.
Answers
  1. Midline y = 8; highest 11, lowest 5; range [5, 11]. Here |a| = 3 and k = 8.
  2. Midline y = -1; highest 5, lowest -7; range [-7, 5]. Here |a| = 6 and k = -1.
  3. Midline \displaystyle y = \frac{3}{2}; highest \displaystyle \frac{3}{2} + \frac{1}{2} = 2, lowest \displaystyle \frac{3}{2} - \frac{1}{2} = 1.
  4. Midline y = 10; highest 14 at \displaystyle x = \frac{3\pi}{2}, lowest 6 at \displaystyle x = \frac{\pi}{2}. Since a = -4 < 0, the top comes where \sin x = -1 and the bottom where \sin x = 1.
  5. Midline y = -2; highest \displaystyle -2 + \frac{5}{2} = \frac{1}{2} at x = \pi, lowest \displaystyle -2 - \frac{5}{2} = -\frac{9}{2} at x = 0 and x = 2\pi. The negative a puts the top where \cos x = -1.
  6. Expand first: y = 2\cos x - 6. Midline y = -6; highest -4, lowest -8.
  7. (0, 1), \displaystyle \left(\frac{\pi}{2}, -3\right), (\pi, -7), \displaystyle \left(\frac{3\pi}{2}, -3\right), (2\pi, 1): each cosine key value times 4, minus 3.
  8. (0, 6), \displaystyle \left(\frac{\pi}{2}, 4\right), (\pi, 6), \displaystyle \left(\frac{3\pi}{2}, 8\right), (2\pi, 6): each sine key value times -2, plus 6.
  9. The midline is y = 1, met where \sin x = 0: x = -2\pi, -\pi, 0, \pi, 2\pi.
  10. The range is [-2, 4]. The value 4 is reached once, at x = 0 (\cos x = 1). The value \displaystyle \frac{5}{2} needs \displaystyle \cos x = \frac{1}{2}: twice, at \displaystyle x = \frac{\pi}{3} and \displaystyle \frac{5\pi}{3}. The value -2 is reached once, at x = \pi. The value -3 is never reached, being below the lowest value.
  11. \displaystyle \sin x = \frac{1}{2}, so \displaystyle x = \frac{\pi}{6} or \displaystyle x = \frac{5\pi}{6}.
  12. \displaystyle k = \frac{9 + 1}{2} = 5, \displaystyle a = \frac{9 - 1}{2} = 4: y = 4\sin x + 5.
  13. \displaystyle k = \frac{-2 + (-12)}{2} = -7, \displaystyle a = \frac{-2 - (-12)}{2} = 5: y = 5\cos x - 7.
  14. \displaystyle k = \frac{3 + (-4)}{2} = -\frac{1}{2}, \displaystyle a = \frac{3 - (-4)}{2} = \frac{7}{2}: \displaystyle y = \frac{7}{2}\cos x - \frac{1}{2}.
  15. a = -3, k = 2, so y = -3\cos x + 2. Highest 5 and lowest -1 give \displaystyle k = \frac{5 + (-1)}{2} = 2 and |a| = 3; the graph is lowest at x = 0, where \cos x = 1, so a is negative.
  16. At x = 0: k = 4. At \displaystyle x = \frac{\pi}{6}: \displaystyle \frac{1}{2}a + 4 = 6, so a = 4. The wave is y = 4\sin x + 4, with highest value 8 and lowest value 0.
  17. \displaystyle k = \frac{15 + 9}{2} = 12, \displaystyle a = \frac{15 - 9}{2} = 3: h = 3\sin t + 12. At t = 2, h = 3\sin 2 + 12 \approx 14.73 inches.
  18. Midline h = 11; highest 13.5 inches, lowest 8.5 inches. Being at least \displaystyle \frac{49}{4} means \displaystyle \frac{5}{2}\cos t \ge \frac{5}{4}, so \displaystyle \cos t \ge \frac{1}{2}: \displaystyle \left[0, \frac{\pi}{3}\right] and \displaystyle \left[\frac{5\pi}{3}, 2\pi\right], a total of \displaystyle \frac{2\pi}{3} \approx 2.09 seconds.
  19. The lowest height is k - |a|, so |a| = 10 - 7.5 = 2.5 and the highest height is 10 + 2.5 = 12.5 inches. The formula is \displaystyle h = \frac{5}{2}\sin t + 10.
  20. The highest value is M = k + |a| and the lowest is m = k - |a|, because a\sin x runs over exactly [-|a|, |a|]. Their sum is 2k, so their average is k: the line y = k is the same distance |a| from the top and the bottom.
  21. \cos(x + \pi) = -\cos x, because a half turn sends a terminal point to the opposite point of the unit circle. So f(x + \pi) = -a\cos x + k, and adding f(x) = a\cos x + k gives 2k. On the graph, any two points half a cycle apart are equally far above and below the midline: their average height is k.
  22. He is right: both have k = 7 and |a| = 2, so midline y = 7, highest 9, lowest 5. They differ in where the extremes are. The first is highest at \displaystyle x = \frac{\pi}{2} + 2\pi n; the second is lowest there and highest at \displaystyle x = \frac{3\pi}{2} + 2\pi n. Each is the other turned upside down about the midline.
  23. Exactly when k > |a|. The lowest value is k - |a|, and every output is at least that value, which is itself reached; so all outputs are positive exactly when k - |a| > 0.
  24. The true midline is y = 1: k = 1, and over a full cycle the values run from -3 to 5. The window \displaystyle \left[0, \frac{\pi}{2}\right] is a quarter of a cycle; there the graph only climbs from the midline to the top, so its lowest value there, 1, is not the lowest value of the wave.
kg1128 · updated 2026-10-20 · CC-BY-SA-4.0