Math
Sine and cosine graphs, explained
5 min read · Updated October 21, 2026
Sine and cosine graphs look tricky, but every one of them is the same wave, stretched and slid around. Four numbers in the equation tell you exactly how. Once you can read those four numbers, you can go from an equation to a graph and from a graph back to an equation.
The two parent graphs
Start with y = sin(x) and y = cos(x). Both waves go up to 1 and down to −1, and both repeat every 2π. The only difference is where they start. At x = 0, sine is on the middle line going up, while cosine is at its highest point.
| x | 0 | π/2 | π | 3π/2 | 2π |
|---|---|---|---|---|---|
| sin(x) | 0 | 1 | 0 | −1 | 0 |
| cos(x) | 1 | 0 | −1 | 0 | 1 |
The general form
Most sine graphs in class are written as y = A sin(B(x − C)) + D, and cosine graphs the same way with cos. Each letter changes the parent graph in one way. In this guide B is positive, which is how most classes write it.
| Part | What it is | How to find it |
|---|---|---|
| Amplitude | How far the wave goes above and below its middle | |A| |
| Period | How long one full cycle takes | 2π/B |
| Phase shift | How far the wave slides left or right | C (positive means right) |
| Midline | The middle line of the wave | y = D |
Amplitude and midline
The midline is the horizontal line halfway between the highest and lowest points. In the equation it is y = D. The amplitude is the distance from the midline up to the top, which is |A|. Amplitude is a distance, so it is never negative.
If A is negative, the wave is flipped upside down. Sine then starts on the midline going down, and cosine starts at its lowest point. The amplitude is still |A|.
Once you know both, the highest value is D + |A| and the lowest value is D − |A|.
Finding the period
The number B squeezes or stretches the wave sideways. The bigger B is, the faster the wave repeats. The period is 2π/B. If your class works in degrees instead of radians, the period is 360° ÷ B.
Periods for a few values of B
y = sin(2x): period = 2π ÷ 2 = π
y = cos(4x): period = 2π ÷ 4 = π/2
y = sin(x/2): B = 1/2, so period = 2π ÷ (1/2) = 4π
Phase shift
The phase shift C slides the whole wave left or right. Watch the sign: in y = sin(x − π/3) the shift is π/3 to the right, and in y = sin(x + π/3) it is π/3 to the left, because x + π/3 is the same as x − (−π/3).
If B is not 1, the inside is often written without the bracket, like sin(2x − π/2). Factor out B first, or you will read the wrong shift.
Factoring out B to find the shift
y = 3 sin(2x − π/2) + 1
2x − π/2 = 2(x − π/4)
y = 3 sin(2(x − π/4)) + 1
Phase shift = π/4 to the right, not π/2
Reading the features from an equation
y = 3 sin(2(x − π/4)) + 1
A = 3, B = 2, C = π/4, D = 1
Amplitude = |A| = 3
Period = 2π ÷ 2 = π
Phase shift = π/4 to the right
Midline: y = 1
Highest value = 1 + 3 = 4, lowest value = 1 − 3 = −2
Plotting one period with five key points
Five points are enough to sketch one full cycle: the start, a quarter of the way, halfway, three quarters of the way, and the end. They are always evenly spaced, one quarter of a period apart, and they always land on the midline, the top or the bottom.
- Draw the midline y = D, then light lines at the highest value D + |A| and the lowest value D − |A|.
- Start the cycle at x = C.
- Divide the period by 4 to get the step between key points.
- Add the step four times to get the five x values.
- Use the pattern for the y values. Sine with A positive: midline, top, midline, bottom, midline. Cosine with A positive: top, midline, bottom, midline, top. If A is negative, swap top and bottom.
- Connect the points with a smooth wave, not straight lines.
Key points of y = 3 sin(2(x − π/4)) + 1
Start at x = π/4. Step = period ÷ 4 = π ÷ 4 = π/4
x values: π/4, π/2, 3π/4, π, 5π/4
Pattern for sine: midline, top, midline, bottom, midline
Points: (π/4, 1), (π/2, 4), (3π/4, 1), (π, −2), (5π/4, 1)
Writing an equation from a graph
Going backwards uses the same four parts. Find the highest and lowest values, then the length of one cycle, then decide where the wave starts.
- Midline: D = (max + min) ÷ 2.
- Amplitude: (max − min) ÷ 2.
- Period: the distance from one peak to the next. Then B = 2π ÷ period.
- Pick sine or cosine. If the graph is at a peak at a nice x value, cosine starting there is easiest. If it crosses the midline going up at a nice x value, use sine starting there. That x value is C.
- Put the parts into y = A sin(B(x − C)) + D or the cosine version, and check one point.
A graph with max 5, min −1, peaks at x = 0 and x = π
D = (5 + (−1)) ÷ 2 = 2
Amplitude = (5 − (−1)) ÷ 2 = 3
Period = π − 0 = π, so B = 2π ÷ π = 2
A peak at x = 0 means cosine with no shift
y = 3 cos(2x) + 2
Check x = 0: 3 cos(0) + 2 = 3 + 2 = 5
More than one right answer
Because the wave repeats forever, one graph can be written many ways. The graph in the last example is also y = 3 sin(2(x + π/4)) + 2, a sine wave shifted π/4 to the left. Shifting by a full period gives yet another correct equation. If your answer draws the same graph, it is right, but check whether your teacher wants a certain form.