Every trig graph you meet in precalculus is one of six parent shapes, stretched, squeezed and slid around by four numbers. This tool graphs y = A·f(B(x − C)) + D for sine, cosine, tangent, cosecant, secant or cotangent, draws the midline and vertical asymptotes, and reports the amplitude, period, phase shift, vertical shift, range and y-intercept. A faint dashed copy of the parent graph shows exactly what each transformation did.
How to use the trig function graphs tool
- Choose the function f: sin, cos, tan, csc, sec or cot.
- Enter A, the vertical stretch. A negative A flips the graph over its midline.
- Enter B, which controls the period. Expressions such as
1/2orpi/2are fine. - Enter C, the phase shift in radians (
pi/4,-1). Positive C moves the graph right. - Enter D, the vertical shift, which moves the midline to y = D.
- Pick the x-axis window (two periods around the phase shift, or −2π to 2π) and choose whether to show the parent graph. The marigold dot marks (C, f(C)), where one cycle of the transformed graph begins.
Transformation formulas
| Feature | sin, cos | tan, cot | sec, csc |
|---|---|---|---|
| Amplitude | |A| | none | none |
| Period | 2π ÷ |B| | π ÷ |B| | 2π ÷ |B| |
| Phase shift | C | C | C |
| Midline | y = D | y = D | y = D |
| Range | [D − |A|, D + |A|] | all real numbers | y ≤ D − |A| or y ≥ D + |A| |
Vertical asymptotes come from setting the denominator to zero:
Worked example: y = 2 sin(2(x − π/4)) + 1
Read the parameters. A = 2, B = 2, C = π/4, D = 1.
Amplitude. |A| = 2, so the graph rises and falls 2 units from its midline.
Period. 2π ÷ 2 = π. One full wave fits in an interval of length π.
Shifts. The wave starts its cycle at x = π/4 instead of 0, and the midline moves up to y = 1.
Range and intercept. The values run from 1 − 2 = −1 to 1 + 2 = 3. At x = 0 the inside is 2(−π/4) = −π/2, so y = 2 sin(−π/2) + 1 = −1, giving the y-intercept (0, −1).
For a tangent example, y = tan(2x) has period π/2 and vertical asymptotes at x = π/4 + kπ/2, where k is any integer.
Parent graphs at a glance
| Function | Period | Range | Zeros | Vertical asymptotes |
|---|---|---|---|---|
| sin x | 2π | −1 to 1 | x = kπ | none |
| cos x | 2π | −1 to 1 | x = π/2 + kπ | none |
| tan x | π | all reals | x = kπ | x = π/2 + kπ |
| cot x | π | all reals | x = π/2 + kπ | x = kπ |
| sec x | 2π | y ≤ −1 or y ≥ 1 | none | x = π/2 + kπ |
| csc x | 2π | y ≤ −1 or y ≥ 1 | none | x = kπ |
Secant and cosecant hug the cosine and sine curves: each U-shaped branch touches the wave at its peak or trough and turns away toward an asymptote wherever the wave crosses zero.
Common mistakes
- Using Bx − c without factoring. In y = cos(3x + π), the shift is −π/3 (left π/3), not π. Factor to cos(3(x + π/3)) before reading C.
- Treating B as the period. A larger B makes the period shorter. B = 4 gives sine a period of π/2, not 4.
- Calling a reflection a shift. A negative A flips the graph over the midline; it does not move it. y = −cos x starts at a minimum instead of a maximum.
- Graphing in degrees by accident. This tool measures x in radians, the convention in algebra and calculus. A period of 2π ≈ 6.28 units corresponds to 360°.
To connect the waves to the circle they come from, see the unit circle calculator; for the graphs of the inverse functions, see inverse trig graphs.
Frequently asked questions
How do I find the period of a trig function?
Divide the parent period by |B|. Sine, cosine, secant and cosecant have a parent period of 2π; tangent and cotangent have π. So y = sin(3x) has period 2π/3 and y = tan(x/2) has period 2π.
What is the phase shift of y = sin(2x − π/2)?
Factor out B first: sin(2x − π/2) = sin(2(x − π/4)). The phase shift is π/4 to the right, not π/2. In general, for sin(Bx − c) the shift is c/B.
Do tangent, secant, cosecant and cotangent have an amplitude?
No. Amplitude is half the distance between the maximum and minimum, and those four functions grow without bound near their asymptotes. The value |A| still stretches them vertically, which the calculator reports as a stretch factor.
Why does the graph break at the asymptotes?
Near an asymptote the function heads to positive infinity on one side and negative infinity on the other, but there is no point at the asymptote itself. Joining the two sides with a line would be wrong, so each branch is drawn separately.