Free maths tool · Level: Ages 16 to 18
Sine function
Slide a and b and watch the wave respond. The tool writes the equation as you go, so the graph and the formula sit side by side.
In y = a·sin(b·x), a controls the height and b controls the width. The amplitude is |a|, so the wave reaches a above the axis and -a below it. The period is 2π/b, so a bigger b makes the wave repeat sooner. For y = 3·sin(2x) the amplitude is 3 and the period is π.
a stretches, b squeezes
Slide a on its own first. The wave reaches higher and lower, but the places where it crosses the x axis do not move at all. That is the difference between the two controls: a touches the height and nothing else.
Now slide b on its own. The peaks keep their height but move towards each other. At b = 2 two complete waves fit where one used to be, because you are fitting twice as much wave into the same width.
The period is 2π/b
Switch the period layer on and a measuring bar appears under the wave, spanning exactly one repeat. The tool writes that length as a multiple of π, because that is the form an answer key expects.
The formula follows from the plain sine, which takes 2π to come full circle. Since b speeds x up by a factor of b, the wave is done after 2π/b. At b = 4 that is π/2, and at b = 0.5 it is 4π.
From graph to equation
Given a graph and asked for the equation, there are two things to read off. Measure the height of the peak, which is a. Measure the width of one complete wave, call it T, and then b is 2π/T.
Switch the cosine layer on and the last trap shows itself. Cosine is the same wave a quarter of a period earlier: it starts at a peak instead of at a zero. If your graph starts at a peak, cos gives you a shorter equation than sin.
Still wrestling with trig graphs?
A tutor practises reading and writing them with you, until the equation jumps straight out at you.
Frequently asked questions
- What is the amplitude of a sine function?
- The distance from the middle line to the peak, so |a| in y = a·sin(bx). For y = 3·sin(x) the amplitude is 3 and the wave runs from -3 to 3. An amplitude is never negative, even when a is.
- How do you calculate the period of a sine function?
- Divide 2π by b. For y = sin(2x) the period is π, and for y = sin(0.5x) it is 4π. Working in degrees, divide 360° by b instead of 2π.
- How do you find the equation from a graph?
- Read the height of the peak for a, and the width of one full wave for the period T. Work out b as 2π/T and put both into y = a·sin(bx). If the graph starts at a peak, use cos rather than sin.
- What is the difference between the sine and cosine functions?
- Only the starting point. It is the same wave with the same amplitude and period, but cos runs a quarter of a period ahead: cos(x) is the same as sin(x + π/2).
- What happens when a is negative?
- The wave flips over the x axis. Peaks become troughs and troughs become peaks, while the amplitude and the period stay exactly as they were. So y = -2·sin(x) still has amplitude 2.