Guides · 9 min read

Graphing Sine and Cosine: Amplitude, Period, Phase Shift and Vertical Shift

Sine and cosine only have one shape between them. Everything a graphing question can throw at you is that shape stretched, squashed, flipped, slid sideways or lifted - four independent transformations, each controlled by exactly one number in the equation.

Once you can read those four numbers off the equation, sketching is mechanical: mark the midline, mark the amplitude, divide one period into quarters, and join five points. The one genuine difficulty is that horizontal transformations behave backwards from what the equation looks like, and that is where nearly all the errors come from.

This guide sets out the standard form, works four graphs including reading an equation back off a picture, and explains why the phase shift is not the number you first see.

The standard form and what each letter controls

Write every sine or cosine function in this shape before doing anything else. The factored form - with B outside the bracket and the shift inside it - is the one that lets you read all four transformations directly.

Amplitude is |A|, the distance from the midline to a peak, so the total vertical span is 2|A|. A negative A does not change the amplitude; it reflects the curve in its midline, so peaks become troughs.

The period is 2π/|B|. B is a frequency: large B means more cycles per unit, which is a horizontal compression. This is the first place the counterintuitive behaviour shows up - multiplying x by 2 halves the period rather than doubling it.

C is the phase shift, positive meaning a shift to the right, and D is the vertical shift, which moves the midline to y = D. The range of the whole function is therefore [D − |A|, D + |A|].

y=Asin(B(xC))+Damplitude A,period 2πB,phase shift C,midline y=Dy = A\sin\big(B(x - C)\big) + D \qquad\text{amplitude } |A|,\quad \text{period } \dfrac{2\pi}{|B|},\quad \text{phase shift } C,\quad \text{midline } y = D

Cosine behaves identically. The only difference is the starting point: sine begins on the midline going up, cosine begins at a maximum.

  • A > 0 starts a sine curve upward from the midline; A < 0 reflects it and starts downward.
  • |B| > 1 compresses horizontally (shorter period); 0 < |B| < 1 stretches it (longer period).
  • C > 0 shifts right; C < 0 shifts left. The minus sign in the bracket is part of the template, not part of C.
  • D moves the whole curve up or down without changing its shape.
  • In degrees the period is 360°/|B| instead of 2π/|B|. Nothing else changes.

The phase-shift trap

Equations are rarely handed to you already factored. You will meet y = 4 sin(3x − π) + 2, and the tempting reading is that the graph shifts π to the right. It does not - it shifts π/3.

The reason is that the shift happens to x, but the bracket contains 3x. Factor the B out before reading anything: 3x − π = 3(x − π/3). Now the form matches the template and the shift is visibly π/3.

The general rule is that y = A sin(Bx − C) + D has phase shift C/B, not C. But rather than memorising a second formula, factor every time. It is one line of algebra and it removes the possibility of the error.

y=Asin(BxC)+D=Asin ⁣(B(xCB))+Dphase shift=CBy = A\sin(Bx - C) + D = A\sin\!\left(B\left(x - \dfrac{C}{B}\right)\right) + D \qquad\Longrightarrow\qquad \text{phase shift} = \dfrac{C}{B}

Always factor B out of the bracket before reading the horizontal shift.

Sketching from five key points

You do not need a table of values. One period of a sine or cosine curve is fully determined by five points: the start, the three quarter-marks, and the end. Plot those, join them with a smooth curve, and repeat left and right as far as the question needs.

The recipe is always the same. Find the period P, divide it by four to get the spacing, and start at x = C, the shifted origin of the cycle. Then step across in quarter-periods.

For a sine curve with A > 0 the pattern of heights is midline, maximum, midline, minimum, midline. For a cosine curve it is maximum, midline, minimum, midline, maximum. If A is negative, swap every maximum with its minimum and leave the midline points alone.

Example 1 - y = 3 sin(2x)

Identify the transformations and sketch one period of y = 3 sin 2x.

  1. Read the constants: A = 3, B = 2, C = 0, D = 0.
    amplitude=3=3,period=2π2=π\text{amplitude} = |3| = 3, \qquad \text{period} = \dfrac{2\pi}{2} = \pi
  2. The midline is y = 0 and there is no horizontal shift, so the cycle starts at x = 0.
    quarter period=π4\text{quarter period} = \dfrac{\pi}{4}
  3. Step across in quarter-periods, applying the sine pattern midline-max-midline-min-midline.
    (0,0),(π4,3),(π2,0),(3π4,3),(π,0)(0,\,0),\quad \left(\tfrac{\pi}{4},\,3\right),\quad \left(\tfrac{\pi}{2},\,0\right),\quad \left(\tfrac{3\pi}{4},\,-3\right),\quad (\pi,\,0)
  4. Join with a smooth curve. The range is [−3, 3] and the pattern repeats every π.

Answer. Amplitude 3, period π, no phase or vertical shift. Two complete cycles fit in the interval [0, 2π].

Example 2 - a reflection, a stretch and a lift

Describe and sketch y = −2 cos(x/2) + 1.

  1. Read the constants: A = −2, B = 1/2, C = 0, D = 1.
    amplitude=2=2,period=2π1/2=4π\text{amplitude} = |-2| = 2, \qquad \text{period} = \dfrac{2\pi}{1/2} = 4\pi
  2. The midline is y = 1, so the range runs from 1 − 2 to 1 + 2.
    range=[1, 3]\text{range} = [-1,\ 3]
  3. A is negative, so the cosine pattern inverts: the cycle starts at a minimum rather than a maximum.
    y(0)=2cos0+1=2+1=1y(0) = -2\cos 0 + 1 = -2 + 1 = -1

    Substituting x = 0 is the quickest way to confirm which way up the curve starts. It takes five seconds and catches sign errors.

  4. Quarter period is π, so step across from x = 0 with the inverted cosine pattern min-midline-max-midline-min.
    (0,1),(π,1),(2π,3),(3π,1),(4π,1)(0,\,-1),\quad (\pi,\,1),\quad (2\pi,\,3),\quad (3\pi,\,1),\quad (4\pi,\,-1)

Answer. Amplitude 2, period 4π, reflected in the midline y = 1, range [−1, 3].

Example 3 - all four transformations at once

Describe y = 4 sin(3x − π) + 2 and give the five key points of one cycle.

  1. Factor B out of the bracket before reading anything. This is the step that fixes the phase shift.
    4sin(3xπ)+2=4sin ⁣(3(xπ3))+24\sin(3x - \pi) + 2 = 4\sin\!\left(3\left(x - \dfrac{\pi}{3}\right)\right) + 2
  2. Now read all four constants: A = 4, B = 3, C = π/3, D = 2.
    amplitude 4,period 2π3,shift π3 right,midline y=2\text{amplitude } 4, \quad \text{period } \dfrac{2\pi}{3}, \quad \text{shift } \dfrac{\pi}{3} \text{ right}, \quad \text{midline } y = 2
  3. The range follows from the midline and amplitude.
    range=[24, 2+4]=[2, 6]\text{range} = [2 - 4,\ 2 + 4] = [-2,\ 6]
  4. The cycle starts at x = π/3 and the quarter period is (2π/3) ÷ 4 = π/6.
    x=π3, π2, 2π3, 5π6, πx = \dfrac{\pi}{3},\ \dfrac{\pi}{2},\ \dfrac{2\pi}{3},\ \dfrac{5\pi}{6},\ \pi
  5. Apply the sine pattern midline-max-midline-min-midline at those x-values.
    (π3,2), (π2,6), (2π3,2), (5π6,2), (π,2)\left(\tfrac{\pi}{3},2\right),\ \left(\tfrac{\pi}{2},6\right),\ \left(\tfrac{2\pi}{3},2\right),\ \left(\tfrac{5\pi}{6},-2\right),\ \left(\pi,2\right)
  6. Check the maximum by substitution: at x = π/2, the bracket is 3(π/2) − π = π/2, and sin(π/2) = 1, so y = 4 + 2 = 6. Correct.

Answer. Amplitude 4, period 2π/3, shifted π/3 right, midline y = 2, range [−2, 6].

Example 4 - reading the equation off a graph

A cosine-shaped curve has a maximum value of 7 and a minimum of −1. It reaches a maximum at x = 2 and the next maximum at x = 10. Find an equation.

  1. Amplitude is half the vertical span between maximum and minimum.
    A=7(1)2=82=4|A| = \dfrac{7 - (-1)}{2} = \dfrac{8}{2} = 4
  2. The midline sits halfway between them.
    D=7+(1)2=3D = \dfrac{7 + (-1)}{2} = 3
  3. Consecutive maxima are one period apart, so the period is 10 − 2 = 8. Convert that to B.
    P=2πB=8B=2π8=π4P = \dfrac{2\pi}{B} = 8 \quad\Longrightarrow\quad B = \dfrac{2\pi}{8} = \dfrac{\pi}{4}
  4. Cosine starts at a maximum, and the first given maximum is at x = 2, so the phase shift is 2.
    y=4cos ⁣(π4(x2))+3y = 4\cos\!\left(\dfrac{\pi}{4}(x - 2)\right) + 3
  5. Verify at both stated points. At x = 2 the bracket is 0 and cos 0 = 1, giving 4 + 3 = 7. At x = 6, the bracket is π, and cos π = −1, giving −4 + 3 = −1, the stated minimum.

    Answers to this kind of question are not unique - a sine model shifted by a quarter period describes the same curve.

Answer. y = 4 cos((π/4)(x − 2)) + 3, with amplitude 4, period 8 and midline y = 3.

Why horizontal transformations run backwards

Vertical transformations apply after the function has done its work: in A sin(x) + D you compute the sine, then multiply, then add, so the effects are exactly what they look like. Horizontal transformations apply to the input, before the function runs, and that reverses them.

Concretely, in sin(x − C) the graph at position x shows the value the original curve had at x − C. Displaying an earlier part of the curve at a later x means the curve moved right - so subtracting shifts right. The same logic explains the period: sin(2x) reaches at x = π what plain sine reaches at 2π.

Internalise this as one principle rather than two rules: anything inside the function argument has the inverse of its apparent effect, and anything outside behaves normally.

Tangent is a different animal

The same template applies to y = A tan(B(x − C)) + D, but two things change. Tangent has period π rather than 2π, so the period is π/|B|. And tangent has no maximum or minimum, so A is a vertical stretch, not an amplitude.

What tangent has instead is vertical asymptotes, wherever cos x = 0. For y = tan x those sit at x = π/2 + πn, and under a transformation they move with the graph: solve B(x − C) = π/2 + πn to locate them.

So sketch tangent by drawing the asymptotes first, marking the x-intercept midway between each consecutive pair, and drawing the increasing branch between them.

Mistakes worth pre-empting

These five account for most of the marks lost on graphing questions, and every one of them is caught by a single substitution check at the end.

  • Reading the phase shift as C when the equation is written as Bx − C. Factor first, every time.
  • Treating a negative A as a negative amplitude. Amplitude is |A| and is never negative; the sign is a reflection.
  • Multiplying instead of dividing when converting B to a period. Period is 2π/|B|, so y = sin(4x) has period π/2, not 8π.
  • Forgetting that the vertical shift moves the axis of the curve, so the range is D ± |A| rather than ±|A|.
  • Mixing units: in degrees the period is 360°/|B| and the key points are spaced in degrees.

Frequently asked questions

What is the difference between period and frequency here?

The period is how far along the x-axis one complete cycle takes, 2π/|B|. The frequency is how many cycles fit into one unit, which is |B|/2π - the reciprocal. B itself is sometimes loosely called the angular frequency, and it is what appears directly in the equation.

Can I always convert a sine model into a cosine model?

Yes. The two curves are the same shape a quarter period apart, which is the cofunction relationship: cos θ = sin(θ + π/2). So any curve describable by a shifted sine is also describable by a shifted cosine, and questions asking for "an" equation accept either.

Does the order of transformations matter?

For reading them off the standard form, no - the form already encodes the correct order. If you are applying them by hand to a sketch, do the horizontal stretch before the horizontal shift, otherwise the shift gets stretched too. That ordering is exactly what factoring B out of the bracket enforces.

How do I find the equation when the graph shows a minimum rather than a maximum?

Two options. Either use a negative amplitude and align the reflected maximum with the given minimum, or shift by half a period so a genuine maximum lands where you need it. Both give correct equations for the same curve; pick whichever produces the tidier numbers.

What does a phase shift mean physically?

In any oscillation - a wave, an alternating current, a pendulum - the phase shift is a delay or advance in time relative to a reference oscillation. Two signals with the same amplitude and period but different phase are the same motion started at different moments, which is why phase difference is the quantity engineers actually care about.

Keep going

Practise it

Reading a method is not the same as running it under time pressure. The workspace drills this material in the quiz, and the triangle solver shows a worked solution for any triangle you type in.