Trigonometry

Graphing Sine and Cosine Functions Step by Step

To graph y=asin⁡(b(x−c))+dy=a\sin\big(b(x-c)\big)+d (or the same form with cosine), draw the midline y=dy=d, mark peaks and troughs ∣a∣|a| above and below it, set the period to 2π∣b∣\frac{2\pi}{|b|}, and plot five points a quarter period apart starting at x=cx=c. Sine begins on the midline and rises. Cosine begins at a peak.

y=asin⁡(b(x−c))+dy = a\sin\big(b(x - c)\big) + d

Four numbers and five points describe every wave you will be asked to draw. The sections below show why those numbers work, how to avoid the one mistake that sinks most graphs, and how to confirm an answer in seconds.

Why do sine and cosine graphs look like waves?

Picture a point moving counterclockwise around the unit circle. At angle θ\theta it sits at (cos⁡θ,sin⁡θ)(\cos\theta,\sin\theta), so sine is its height and cosine is its horizontal position. Graphing sine means recording that height as the angle grows. The SOH CAH TOA ratios only describe angles inside a right triangle, below 90°. The circle lets the input run on forever and the output repeat.

A full turn is 2π2\pi radians, or 360° (the radians to degrees page covers the conversion), after which the point is back where it began. That is why both graphs have period 2π2\pi. Quarter turns give the five anchor points of every cycle:

xx 00 π2\frac{\pi}{2} π\pi 3π2\frac{3\pi}{2} 2π2\pi
sin⁡x\sin x 00 11 00 −1-1 00
cos⁡x\cos x 11 00 −1-1 00 11

The shape follows from the motion. At the top of the circle the point is moving sideways, so its height barely changes, which makes the peak rounded and flat. Crossing the horizontal axis, the point is moving straight up or down, so the curve is steepest there. Draw rounded tops and steep crossings, never pointed zigzags.

Because the point stays on the circle, sin⁡2θ+cos⁡2θ=1\sin^2\theta+\cos^2\theta=1, one of the Pythagorean identities. Read it off the graphs: wherever sine hits ±1\pm1, cosine must be 00, and the reverse.

Graphing sine and cosine: amplitude, period and phase shift

Graph of sin(2x − π) showing the cycle starting at π/2, not π, after factoring out 2
Rewriting sin(2x − π) as sin(2(x − π/2)) shows the cycle starts at π/2, so one cycle runs from π/2 to 3π/2.

Every transformed wave fits one template:

y=asin⁡(b(x−c))+dy=a\sin\big(b(x-c)\big)+d

The amplitude is ∣a∣|a|, the distance from the midline to a peak (not the full height, which is twice that). A negative aa reflects the wave over its midline. The number dd lifts the whole wave, and the midline is y=dy=d, much like the intercept in slope-intercept form sets where a line sits on the yy-axis.

The period comes from one clean idea. The input bxbx must travel from 00 to 2π2\pi to finish a cycle, so xx must travel 2π∣b∣\frac{2\pi}{|b|}. A bigger bb squeezes the wave and a smaller bb stretches it. The frequency, the number of cycles per unit, is the reciprocal: ∣b∣2π\frac{|b|}{2\pi}.

Factor before you shift

In sin⁡(2x−π)\sin(2x-\pi) the shift is not π\pi. Factor out the 2 to get sin⁡(2(x−π2))\sin\big(2(x-\frac{\pi}{2})\big), so the shift is π2\frac{\pi}{2} to the right.

Textbooks often write y=asin⁡(bx−h)+dy=a\sin(bx-h)+d, where the shift is hb\frac{h}{b}. Both forms agree, but only the factored form shows the shift at a glance. Another way to find it: solve bx−h=0bx-h=0, which gives the xx-value where the cycle starts. In degrees, replace 2π2\pi with 360∘360^\circ, so the period is 360∘∣b∣\frac{360^\circ}{|b|}.

Quick check

A sine wave repeats every 1010 units. What is bb in y=sin⁡(bx)y=\sin(bx)?

How to graph sine and cosine step by step

The same five moves work for every sine or cosine graph:

  1. Draw the midline y=dy=d, then dashed lines at y=d+∣a∣y=d+|a| and y=d−∣a∣y=d-|a|.
  2. Compute the period 2π∣b∣\frac{2\pi}{|b|} and divide by 4 to get the quarter-period step.
  3. Find the starting xx-value, which is the shift cc.
  4. Plot five points one step apart. Sine with a>0a>0 runs midline, max, midline, min, midline. Cosine runs max, midline, min, midline, max. A negative aa swaps highs and lows.
  5. Join them with a smooth curve and repeat the cycle left and right.

Example 1. Graph y=2cos⁡(π3x)+1y=2\cos\left(\frac{\pi}{3}x\right)+1. The amplitude is 22 and the midline is y=1y=1, so the wave stays between −1-1 and 33. The period is

2ππ/3=6,\frac{2\pi}{\pi/3}=6,

so the quarter step is 1.51.5. With no shift, cosine starts at its maximum at x=0x=0. The five points are

(0,3), (1.5,1), (3,−1), (4.5,1), (6,3).(0,3),\ (1.5,1),\ (3,-1),\ (4.5,1),\ (6,3).

Example 2. Graph y=−3sin⁡(2x−π2)+1y=-3\sin\left(2x-\frac{\pi}{2}\right)+1. Factor first:

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

The midline is y=1y=1 and the amplitude is 33, so the range is −2-2 to 44. The period is 2π2=π\frac{2\pi}{2}=\pi, the quarter step is π4\frac{\pi}{4}, and the cycle starts at x=π4x=\frac{\pi}{4}. Because aa is negative, the sine wave falls first:

(π4,1), (π2,−2), (3π4,1), (π,4), (5π4,1).\left(\frac{\pi}{4},1\right),\ \left(\frac{\pi}{2},-2\right),\ \left(\frac{3\pi}{4},1\right),\ \left(\pi,4\right),\ \left(\frac{5\pi}{4},1\right).

Sine vs cosine: which graph should you use?

Cosine is sine shifted left by π2\frac{\pi}{2}, which is the identity cos⁡x=sin⁡(x+π2)\cos x=\sin\left(x+\frac{\pi}{2}\right) from the list of trigonometric identities. So every cosine wave is also a sine wave, and the equation for a given graph is never unique. Choose cosine when you know where a peak or trough sits, and sine when you know where the wave crosses the midline going up.

Here is how to read an equation off a graph. Suppose the highest point is 77 at x=2x=2 and the next trough is −1-1 at x=5x=5. The midline is the average, 7+(−1)2=3\frac{7+(-1)}{2}=3, and the amplitude is 7−(−1)2=4\frac{7-(-1)}{2}=4. Peak to trough is half a period, so the period is 66 and b=2π6=π3b=\frac{2\pi}{6}=\frac{\pi}{3}. Anchoring at the peak gives

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

Half-period shortcut

The horizontal distance from a peak to the next trough is half a period, so b=πthat distanceb=\frac{\pi}{\text{that distance}}. Here, π3\frac{\pi}{3}.

The sine version anchors at a rising midline crossing, one quarter period (here 1.51.5) before the peak, so x=0.5x=0.5. That gives y=4sin⁡(π3(x−0.5))+3y=4\sin\left(\frac{\pi}{3}(x-0.5)\right)+3. Test it at x=2x=2: 4sin⁡(π2)+3=74\sin\left(\frac{\pi}{2}\right)+3=7. Both equations draw the same curve, so a teacher’s answer key may differ from yours and still agree with it.

Graphing sine and cosine with negatives and fractions

A negative aa reflects the wave over the midline, which is the xx-axis only when d=0d=0. The amplitude stays positive. A negative bb is handled with symmetry: sin⁡(−θ)=−sin⁡θ\sin(-\theta)=-\sin\theta and cos⁡(−θ)=cos⁡θ\cos(-\theta)=\cos\theta. So y=3sin⁡(−2x)y=3\sin(-2x) becomes y=−3sin⁡(2x)y=-3\sin(2x), while cos⁡(−2x)\cos(-2x) is simply cos⁡(2x)\cos(2x). Do this rewrite before finding the shift, or the sign of the shift will be wrong.

Fractional bb stretches the wave. For y=−4cos⁡(x3)y=-4\cos\left(\frac{x}{3}\right), b=13b=\frac13, so the period is 2π1/3=6π\frac{2\pi}{1/3}=6\pi and the quarter step is 3π2\frac{3\pi}{2}. Cosine with a negative aa starts at its minimum:

(0,−4), (3π2,0), (3π,4), (9π2,0), (6π,−4).(0,-4),\ \left(\tfrac{3\pi}{2},0\right),\ (3\pi,4),\ \left(\tfrac{9\pi}{2},0\right),\ (6\pi,-4).

When bb contains π\pi, the π\pi cancels: sin⁡(πx)\sin(\pi x) has period 22, not 2π2\pi. Label your xx-axis in quarter-period steps and the plotting becomes simple addition.

Three related ideas help here. Angles that differ by 2π2\pi are coterminal angles and share the same sine and cosine, which is exactly why the graph repeats. Reference angles let you read values between anchor points, because the wave is symmetric about each peak: sin⁡150∘=sin⁡30∘=0.5\sin 150^\circ=\sin 30^\circ=0.5. And if a problem is in degrees, either keep the period as 360∘∣b∣\frac{360^\circ}{|b|} or convert using degrees to radians, but never mix the two on one axis.

Quick check

Rewrite y=4sin⁡(−3x)y=4\sin(-3x) so that bb is positive.

How do you check a sine or cosine graph?

Four quick tests catch nearly every error:

  • Every point lies between d−∣a∣d-|a| and d+∣a∣d+|a|, and the curve touches both lines.
  • Exactly one full cycle fits between the start and the start plus the period.
  • Substituting x=0x=0 into the original equation matches the curve’s yy-intercept.
  • Sine with a>0a>0 rises from its start point, and a negative aa makes it fall. Cosine starts at an extreme.

The yy-intercept test is the strongest, because it ignores your drawing entirely. In Example 2, x=0x=0 gives −3sin⁡(−π2)+1=3+1=4-3\sin\left(-\frac{\pi}{2}\right)+1=3+1=4. The graph agrees: one period is π\pi, and the plotted point at x=πx=\pi is (π,4)(\pi,4), so (0,4)(0,4) must be there too.

The method has limits. It only works for a single wave. Add two waves with different periods, such as y=sin⁡x+sin⁡2xy=\sin x+\sin 2x, and the result is not a clean sinusoid, so the five-point recipe fails. Graphs like y=xsin⁡xy=x\sin x or y=sin⁡(x2)y=\sin(x^2) break it as well, since the amplitude or period keeps changing.

Try this: Add the heights of sin⁡x\sin x and cos⁡x\cos x at x=0,π2,π,3π2x=0,\frac{\pi}{2},\pi,\frac{3\pi}{2}, plot the sums, and notice that y=sin⁡x+cos⁡xy=\sin x+\cos x is still a wave. Its peak, 2\sqrt{2}, sits at x=π4x=\frac{\pi}{4}.

Where do sine and cosine graphs show up in real life?

Anything that repeats smoothly is modeled by a sinusoid: tides, daylight hours across the year, sound waves, and alternating current. A US wall outlet cycles 60 times per second, so b=2π⋅60=120πb=2\pi\cdot60=120\pi and the voltage is about V(t)=170sin⁡(120πt)V(t)=170\sin(120\pi t), where 170≈1202170\approx120\sqrt2 is the peak. The sine graph also explains why the area formula in area of a triangle using sine is largest at a right angle: sin⁡C\sin C peaks at C=π2C=\frac{\pi}{2}.

Example 3. A Ferris wheel has radius 2020 m, its lowest point is 22 m above the ground, and it turns once every 88 minutes. A rider boards at the bottom at t=0t=0. Write the height h(t)h(t) and find when the rider first reaches 3232 m.

The center is 2+20=222+20=22 m high, so the midline is 2222 and the amplitude is 2020. The period is 88, so b=2π8=π4b=\frac{2\pi}{8}=\frac{\pi}{4}. The ride starts at a minimum, which is a reflected cosine:

h(t)=−20cos⁡(π4t)+22.h(t)=-20\cos\left(\frac{\pi}{4}t\right)+22.

Set h(t)=32h(t)=32:

−20cos⁡(π4t)=10 ⇒ cos⁡(π4t)=−12.-20\cos\left(\frac{\pi}{4}t\right)=10\ \Rightarrow\ \cos\left(\frac{\pi}{4}t\right)=-\frac12.

The first angle with that cosine is arccos⁡(−12)=2π3\arccos\left(-\frac12\right)=\frac{2\pi}{3} (see inverse trigonometric functions for why this is the first solution), so π4t=2π3\frac{\pi}{4}t=\frac{2\pi}{3} and t=83≈2.67t=\frac{8}{3}\approx2.67 minutes.

Quick check

A Ferris wheel rider's height is h(t)=−20cos⁡(π4t)+22h(t)=-20\cos\left(\frac{\pi}{4}t\right)+22 metres. How high is the rider at t=2t=2 minutes?

Practice problems

0 of 5 solved

  1. State the amplitude and period of y=−5sin⁡(4x)y=-5\sin(4x).

  2. Find the midline, maximum and minimum of y=3cos⁡x−2y=3\cos x-2.

  3. Find the phase shift of y=sin⁡(3x−π)y=\sin(3x-\pi).

  4. List the five points of one cycle of y=2sin⁡(π2x)+1y=2\sin\left(\frac{\pi}{2}x\right)+1, starting at x=0x=0.

  5. Write a cosine equation with a maximum of 99 at x=1x=1 and the next minimum of 11 at x=3x=3.

Common questions

How do you find the amplitude and period of a sine or cosine graph?

The amplitude is half the distance from the highest point to the lowest point, and it is always positive. The period is the horizontal length of one full cycle, which equals 2π∣b∣\frac{2\pi}{|b|} when the equation is written with sin⁡(bx)\sin(bx) or cos⁡(bx)\cos(bx).

What is the difference between the sine and cosine graphs?

They have the same shape, but cosine is sine shifted left by π2\frac{\pi}{2}. Cosine starts at its maximum value of 11 at x=0x=0, while sine starts at 00 and rises.

How do you find the phase shift of a sine or cosine function?

Factor the coefficient of xx out of the bracket so the function reads sin⁡(b(x−c))\sin\big(b(x-c)\big). The shift is cc: right if cc is positive, left if negative. Skipping the factoring step is the most common error.

Why is the period of sine and cosine 2π2\pi?

A point moving around the unit circle returns to its starting position after one full turn, which is 2π2\pi radians. Sine and cosine are the point's coordinates, so their values repeat every 2π2\pi.

Can the amplitude of a sine or cosine function be negative?

No. Amplitude is a distance, so it equals ∣a∣|a|. A negative aa reflects the graph over its midline, so a sine wave starts by falling and a cosine wave starts at a minimum.

How many points should you plot for one cycle of a sine or cosine graph?

Five points are enough: the start, the three quarter-period marks, and the end of the cycle. They are the midline crossings, the peak and the trough (or peak, trough and the crossings between them for cosine).

Up next