Trigonometric Graph Plotter
Pick a basic function, then drag the sliders or type the coefficients a, b, c, d. The graph and the property table update instantly. Coefficient c accepts forms such as pi/3 or -pi/4.
Hover or tap along the graph to read coordinates. When the canvas has focus, the left and right arrow keys move in steps of π/12.
The tool above plots the four basic trigonometric functions and the extended form y = a·sin(bx + c) + d (replace sin with cos, tan or cot). Drag the sliders to watch the graph stretch and shift on screen. The table under the graph follows the selected function: domain, range, period, parity, monotonicity, maximum and minimum or vertical asymptotes. Move the mouse along the curve to read the coordinates of each point in radians and decimals. The article ends with an 8-question quiz to apply the theory.
Definitions of the four trigonometric functions
In the grade 11 curriculum, each trigonometric function is a rule that assigns to every real number x (the radian measure of a trigonometric angle) exactly one real number:
- Sine function: y = sin x, defined for every real x.
- Cosine function: y = cos x, defined for every real x.
- Tangent function: y = tan x = sin x / cos x, defined only when cos x ≠ 0, that is x ≠ π/2 + kπ.
- Cotangent function: y = cot x = cos x / sin x, defined only when sin x ≠ 0, that is x ≠ kπ.
On the unit circle, the point M associated with the real number x has x-coordinate cos x and y-coordinate sin x. Since M always lies on a circle of radius 1, sine and cosine only take values from −1 to 1. Tangent and cotangent are quotients of these two numbers, so they take every real value.
| Function | Domain | Range | Period | Even or odd |
|---|---|---|---|---|
| y = sin x | D = ℝ | [−1; 1] | 2π | odd |
| y = cos x | D = ℝ | [−1; 1] | 2π | even |
| y = tan x | ℝ \ {π/2 + kπ} | ℝ | π | odd |
| y = cot x | ℝ \ {kπ} | ℝ | π | odd |
Periodic functions and the period
A function y = f(x) with domain D is called periodic if there is a number T ≠ 0 such that for every x in D, x ± T ∈ D and
The smallest positive T with this property is the period of the function. After every stretch of length T, the graph repeats itself exactly. So it is enough to draw the graph on one interval of length T, then translate it parallel to the x-axis by kT to get the whole graph.
Sine and cosine have period 2π because the point M returns to where it started after one full turn. Tangent and cotangent have period π because after half a turn both sine and cosine change sign, so their quotient stays the same.
Even and odd functions and the symmetry of the graph
All four domains above are symmetric about 0. Use the formulas for opposite angles:
- y = sin x, y = tan x and y = cot x are odd functions. Their graphs are symmetric about the origin O.
- y = cos x is an even function. Its graph is symmetric about the y-axis.
Turn on the comparison option in the tool and you will see the cosine curve (orange) mirrored on both sides of the y-axis, while the sine curve (blue) maps onto itself under a 180° rotation about O.
Variation tables over one period
The function y = sin x on [−π; π]
The function is increasing on each interval (−π/2 + k2π; π/2 + k2π) and decreasing on each interval (π/2 + k2π; 3π/2 + k2π).
| x | −π | −π/2 | π/2 | π | |||
|---|---|---|---|---|---|---|---|
| y | 0 | ↘ | −1 | ↗ | 1 | ↘ | 0 |
The function y = cos x on [−π; π]
The function is increasing on each interval (−π + k2π; k2π) and decreasing on each interval (k2π; π + k2π).
| x | −π | 0 | π | ||
|---|---|---|---|---|---|
| y | −1 | ↗ | 1 | ↘ | −1 |
The function y = tan x on (−π/2; π/2)
The function is increasing on each interval (−π/2 + kπ; π/2 + kπ). The lines x = π/2 + kπ are vertical asymptotes.
| x | −π/2 | 0 | π/2 | ||
|---|---|---|---|---|---|
| y | −∞ | ↗ | 0 | ↗ | +∞ |
The function y = cot x on (0; π)
The function is decreasing on each interval (kπ; π + kπ). The lines x = kπ are vertical asymptotes.
| x | 0 | π/2 | π | ||
|---|---|---|---|---|---|
| y | +∞ | ↘ | 0 | ↘ | −∞ |
The graphs of tangent and cotangent consist of infinitely many identical branches, each lying between two consecutive vertical asymptotes. The tool draws these asymptotes as dashed lines.
Shifting and stretching the graph of y = a sin(bx + c) + d
The general form y = a·sin(bx + c) + d (with a ≠ 0, b ≠ 0) describes every simple harmonic oscillation in physics. Each coefficient has its own job:
| Coefficient | Name | Effect on the graph of y = sin x |
|---|---|---|
| a | amplitude |a| | Vertical stretch (|a| > 1) or compression (|a| < 1). If a < 0, the graph is also reflected across the x-axis. |
| b | angular frequency | Horizontal compression (|b| > 1) or stretch (|b| < 1). The new period is T = 2π/|b|. |
| c | phase | Horizontal shift by |c/b|: to the left if c/b > 0, to the right if c/b < 0. |
| d | vertical shift | Shift up d units if d > 0, down |d| units if d < 0. The new midline is y = d. |
The table gives at once:
For tangent and cotangent, b still changes the period to π/|b|, while a and d leave the range ℝ unchanged.
Recommended order of construction. Write bx + c = b(x + c/b). Starting from the graph of y = sin x: stretch or compress horizontally by b, shift horizontally by −c/b, stretch or compress vertically by a, and finally shift vertically by d. The tool above lists exactly these steps for the function you enter.
Four worked examples
Example 1. Find the domain of y = tan(2x − π/3)
Tangent is defined when the expression inside is not π/2 + kπ:
So D = ℝ \ {5π/12 + kπ/2}. The period is π/2. The same family of points can be written differently, for example −π/12 + kπ/2, because 5π/12 − π/2 = −π/12. Choose tan and enter a = 1, b = 2, c = -pi/3, d = 0 to let the tool draw the vertical asymptotes at these points.
Example 2. Period, maximum and minimum of y = 3sin(2x + π/4) − 1
Here a = 3, b = 2, c = π/4, d = −1. The period is T = 2π/2 = π. Since −1 ≤ sin(2x + π/4) ≤ 1,
The maximum 2 is reached when 2x + π/4 = π/2 + k2π, that is x = π/8 + kπ. The minimum −4 is reached when 2x + π/4 = −π/2 + k2π, that is x = −3π/8 + kπ. The range is [−4; 2].
Example 3. Even or odd?
a) f(x) = sin 2x + tan x. The domain ℝ \ {π/2 + kπ} is symmetric about 0. We have f(−x) = −f(x), so f is odd.
b) g(x) = cos x + sin²x. The domain is ℝ. g(−x) = g(x), so g is even.
c) h(x) = sin x + cos x. Try x = π/4: h(π/4) = √2, while h(−π/4) = 0. These two values are neither equal nor opposite, so h is neither even nor odd. In fact h(x) = √2·sin(x + π/4); enter a = sqrt(2), c = pi/4 in the tool to see that the graph is symmetric neither about O nor about the y-axis.
Example 4. Build the graph of y = 2sin(2x − π/3) + 1 and find where it increases
Write 2x − π/3 = 2(x − π/6). Starting from the graph of y = sin x, do in order:
- Compress horizontally by the factor 1/2 to get y = sin 2x with period π.
- Shift right by π/6 to get y = sin(2x − π/3).
- Stretch vertically by the factor 2 to get y = 2sin(2x − π/3).
- Shift up 1 unit to get the required graph, which oscillates between −1 and 3.
Since a·b = 4 > 0, the function increases when the inner expression lies in an increasing interval of sine:
The function is increasing on each interval (−π/12 + kπ; 5π/12 + kπ) and reaches its maximum 3 at x = 5π/12 + kπ. Enter a = 2, b = 2, c = -pi/3, d = 1 to let the tool redraw it and check every step.
Common mistakes
- Computing the period as 2π/b when b is negative. A period is always positive: T = 2π/|b|.
- Shifting horizontally by c instead of c/b. For y = sin(2x − π) the graph moves right by π/2, not by π.
- Forgetting the domain condition of tan and cot. Remove the points where the cosine (for tan) or the sine (for cot) of the inner expression is 0.
- Joining two tangent branches across an asymptote. The graphs of tangent and cotangent break at every vertical asymptote; no point lies on those lines.
- Deciding even or odd from a single pair of points. One pair of points is enough to rule out evenness or oddness, but to prove it you must establish the identity for every x.
🎯 Practice quiz: applying the theory of trigonometric graphs
Eight questions cover the domain, the period, even and odd functions, maximum and minimum, monotonicity, vertical asymptotes and translating a graph. Pick one answer for each question: the correct answer turns green, a wrong one turns red, and the worked solution appears right below with a ⚠️ Traps section explaining why the distractors are tempting.
🟢 Domain Question 1. The domain of y = tan x is:
Correct answer: C. D = ℝ \ {π/2 + kπ, k ∈ ℤ}
tan x = sin x / cos x is defined only when the denominator is non-zero: cos x ≠ 0 ⇔ x ≠ π/2 + kπ. On the unit circle, cos x = 0 at the two points B and B′ on the y-axis, exactly π apart.
On the graph, every excluded point is a vertical asymptote, drawn as a dashed line in the tool.
⚠️ Traps
- A (ℝ): the domain of sine and cosine. Tangent is a quotient, so the points where the denominator vanishes must be removed.
- B (ℝ \ {kπ}): the domain of cotangent, which removes the points where sin x = 0.
- D (ℝ \ {π/2 + k2π}): only B (π/2) is removed and B′ (−π/2, 3π/2, …) is forgotten, although cos x = 0 there too and tan x is undefined.
⏱️ Period Question 2. The period of y = 2tan(3x + π/4) − 1 is:
Correct answer: B. T = π/3
Tangent has period π. With b = 3 the period becomes π/|b|:
The coefficients a = 2, c = π/4 and d = −1 only stretch and shift the graph, they do not change the period. Check: f(x + π/3) = 2tan(3x + π + π/4) − 1 = f(x), because tangent repeats every π.
⚠️ Traps
- A (2π/3): the formula 2π/|b| of sine and cosine is used for tangent.
- C (π): b is ignored and the period of tan x is kept.
- D (3π): the period is multiplied by b instead of divided. |b| > 1 compresses the graph horizontally, so the period must get shorter.
⚖️ Even or odd Question 3. Which of the following functions is even:
Correct answer: D. y = x·sin x
The domain ℝ is symmetric about 0, and
so y = x·sin x is even and its graph is symmetric about the y-axis. The product of two odd functions (x and sin x) is an even function.
⚠️ Traps
- A (sin 2x): sin(−2x) = −sin 2x, so this function is odd: its graph is symmetric about O, not about the y-axis.
- B (cos(x + π/3)): “cosine is even” no longer holds after a shift. At x = π/3 the value is cos(2π/3) = −1/2, while at x = −π/3 it is cos 0 = 1: neither equal nor opposite.
- C (sin x + cos x): the sum of an odd and an even function. h(π/4) = √2 but h(−π/4) = 0, so it is neither even nor odd (Example 3c).
📏 Maximum and minimum Question 4. The maximum M and the minimum m of y = 3 − 2cos x are:
Correct answer: A. M = 5, m = 1
Start from −1 ≤ cos x ≤ 1. Multiplying by −2 reverses the inequalities, then add 3:
M = 5 when cos x = −1, that is x = π + k2π. m = 1 when cos x = 1, that is x = k2π. This is exactly d ± |a| with a = −2 and d = 3.
⚠️ Traps
- B (2 and −2): d = 3 is forgotten. 2 and −2 are only the extremes of −2cos x.
- C (3 and 1): cos x is taken to range from 0 to 1. When cos x = −1, y = 5 > 3.
- D (1 and −1): the range [−1; 1] of cos x is copied, ignoring the coefficients a and d.
📈 Monotonicity Question 5. On which interval is y = cos x increasing:
Correct answer: C. (−π; 0)
y = cos x is increasing on each interval (−π + k2π; k2π) and decreasing on each interval (k2π; π + k2π). With k = 0 we get (−π; 0).
On the unit circle, as x goes from −π to 0 the point M moves from A′(−1; 0) through B′ to A(1; 0), so its x-coordinate cos x rises from −1 to 1. The variation table of cosine in the theory section shows an upward arrow on this interval.
⚠️ Traps
- A (0; π): this is where cosine decreases, from 1 down to −1.
- B (−π/2; π/2): the increasing interval of sine. The cosine graph rises on (−π/2; 0), peaks at x = 0, then falls on (0; π/2).
- D (π/2; 3π/2): the decreasing interval of sine. Cosine falls on (π/2; π) and rises on (π; 3π/2).
🧱 Asymptotes Question 6. The vertical asymptotes of the graph of y = cot x are:
Correct answer: B. x = kπ, k ∈ ℤ
cot x = cos x / sin x is undefined when sin x = 0, that is x = kπ. As x approaches kπ, the numerator cos x tends to ±1 while the denominator sin x tends to 0, so |cot x| grows without bound:
Each branch of the graph lies between two consecutive asymptotes and spans exactly one period π.
⚠️ Traps
- A (π/2 + kπ): the asymptotes of tangent. At x = π/2, cot(π/2) = 0: the cotangent graph crosses the x-axis there instead of breaking.
- C (k2π): only the point A (0, 2π, …) is kept and A′ (π, 3π, …) is forgotten, although sin x = 0 there too.
- D (kπ/2): the asymptotes of tangent and cotangent are lumped together. x = π/2 is in this set, but cot(π/2) = 0 is defined.
↔️ Translation Question 7. The graph of y = sin(2x − π/3) is obtained from the graph of y = sin 2x by the translation by the vector:
Correct answer: D. v = (π/6; 0)
Factor b out of the bracket:
Replacing x by x − π/6 moves the graph π/6 units to the right and keeps every y-coordinate, so the translation vector is (π/6; 0). With the coefficient table: the horizontal shift is |c/b| = π/6, to the right because c/b = −π/6 < 0.
⚠️ Traps
- A (π/3; 0): the graph is shifted by c instead of c/b, mistake 2 in the list of common mistakes.
- B (−π/6; 0): the wrong direction. A minus sign inside the bracket moves the graph to the right, not to the left.
- C (0; −π/3): a vertical translation. Vertical shifts come from a constant added outside the sine, like the coefficient d.
🔁 Periodic functions Question 8. Which of the following functions has period π:
Correct answer: A. y = cos 2x
y = cos 2x has b = 2, so T = 2π/2 = π. Check: cos 2(x + π) = cos(2x + 2π) = cos 2x.
⚠️ Traps
- B (tan 2x): tangent already has period π, so tan 2x has period π/2. The trap is keeping the π of tangent and forgetting to divide by |b|.
- C (sin(x/2)): b = 1/2 < 1 stretches the graph, so the period is 2π : (1/2) = 4π.
- D (sin(x + π)): seeing π inside the bracket suggests period π, but c only shifts the graph. sin(x + π) = −sin x still has period 2π.
Frequently asked questions
How do I find the period of y = a sin(bx + c) + d?
The period equals 2π divided by the absolute value of b. For tangent and cotangent, the period equals π divided by the absolute value of b. The coefficients a, c and d do not change the period. For example y = 3sin(2x + π/4) − 1 has period π.
Why do the graphs of y = tan x and y = cot x have vertical asymptotes?
tan x equals sin x divided by cos x, so as x approaches π/2 + kπ the denominator cos x tends to 0 and tan x increases or decreases without bound. The lines x = π/2 + kπ are the vertical asymptotes of tangent. Similarly, cotangent has vertical asymptotes x = kπ, where sin x equals 0.
Which trigonometric functions are even and which are odd?
Only y = cos x is even; its graph is symmetric about the y-axis. The three functions y = sin x, y = tan x and y = cot x are odd; their graphs are symmetric about the origin O. After a shift, the new function may be neither even nor odd.
What is the range of y = a sin(bx + c) + d?
Since sin(bx + c) lies between −1 and 1, y lies between d − |a| and d + |a|. The maximum is d + |a| and the minimum is d − |a|. The same holds when sine is replaced by cosine. For tangent and cotangent, the range is always ℝ.
How can I get the graph of y = cos x from the graph of y = sin x?
Since cos x = sin(x + π/2), the graph of y = cos x is the graph of y = sin x shifted π/2 units to the left. In the tool, choose sine, set c = pi/2 and turn on the cosine comparison curve to see the two curves coincide.