Graphing Basics

How to Enter Equations and Functions Correctly

Type powers with ^ (x^2), roots as sqrt(x) and cbrt(x), absolute value as abs(x), and functions with brackets such as sin(x) and ln(x). Put fractions and exponents with more than one term in brackets: (x+1)/(x−2) and 2^(x+1). Writing 2x or 3(x + 1) multiplies automatically, and −x^2 means −(x²).

Two graphs showing why brackets matter: y = (x + 1)/(x − 2) with an asymptote, and the very different y = x + 1/x − 2.

Check it yourself: every example here can be loaded into the Graphing Calculator.

Open the Graphing Calculator

The notation table

Maths Type Notes
x² x^2 any power: x^3, x^(1/2)
√x sqrt(x) x^(1/2) also works
∛x cbrt(x) real cube root: cbrt(−8) = −2
|x| abs(x) no vertical bars
(x+1) ⁄ (x−2) (x+1)/(x-2) bracket the whole top and bottom
2ˣ⁺¹ 2^(x+1) bracket a multi-term exponent
eˣ e^x or exp(x) e ≈ 2.718
ln x ln(x) natural log
log₁₀ x log(x) or log10(x) base 10
log₂ x log(x, 2) base must be > 0 and ≠ 1
sin x, cos x, tan x sin(x) … choose radians or degrees
π pi or π
3x, 2(x+1), (x+1)(x−1) as written implicit multiplication

Order of operations

The calculator follows the standard order: brackets, then powers, then multiplication and division (left to right), then addition and subtraction (left to right). Two details matter for graphing:

  • Unary minus comes after powers. −x^2 means −(x²), so it opens downward. To square a negative number, write (−x)^2.
  • Powers group from the right. 2^3^2 means 2^(3^2) = 2⁹ = 512.
Three panels comparing inputs: −x^2 (an upside-down parabola) vs (−x)^2 (upright), 2^x+1 vs 2^(x+1), and sin(2x) vs sin(2)x.
Brackets decide which operation happens first.
Text description of this figure

Three panels comparing inputs: −x^2 (an upside-down parabola) vs (−x)^2 (upright), 2^x+1 vs 2^(x+1), and sin(2x) vs sin(2)x.

  1. −x^2 squares first, then negates. Use (−x)^2 to square a negative.
  2. Put multi-term exponents in brackets: 2^(x+1).
  3. Everything a function acts on goes inside its brackets: sin(2x).

Brackets: the most common fix

When a graph looks surprising, the input is usually missing brackets.

  • x+1/x-2 is read as x + (1 ⁄ x) − 2, a completely different curve from (x + 1) ⁄ (x − 2).
  • 2^x+1 is 2ˣ + 1; 2^(x+1) is 2ˣ⁺¹.
  • 1/2x is (1⁄2)·x. If you mean 1 ⁄ (2x), type 1/(2x).
Try it in the calculator

Implicit multiplication

You don’t need to type every multiplication sign. These all work:

  • 2x, 3x^2, -4x
  • 2(x+1), (x+1)(x-1), x(x-3)
  • 2pi x, 3sin(x), x sin(x)

Two numbers next to each other, like 2 3, are rejected because the meaning is unclear. Digits directly after a letter, like x2, are also rejected — write 2x or x^2.

Try it in the calculator

Equations, inequalities and points

  • y = 3x − 1 or just 3x − 1 → a function.
  • f(x) = x^2 → also a function.
  • 2x + 3y = 6 → any equation that can be solved for y is accepted.
  • x = 4 → a vertical line.
  • y > 2x + 1, x <= 3 → shaded inequalities (dashed boundary for < and >).
  • (2, 3) → a point.
  • x^2 {0 <= x <= 2} → a function restricted to an interval.

Curves that cannot be solved for a single y, such as x² + y² = 4, show a message suggesting how to graph them another way.

Error messages and what they mean

Message Fix
Use parentheses after sin, e.g. sin(x). Add brackets around the function input.
A closing parenthesis is missing. Count your ( and ) — they must match.
Two numbers next to each other. Add an operator: 2*3 or 23.
Unknown name “z”. Only x (and y in equations) are variables; other single letters become sliders.
Use abs(x) for absolute value. Replace |x| with abs(x).

Common mistakes

  • Typing sqrt x or ln x. Use sqrt(x) and ln(x).
  • Missing brackets around fractions (the biggest source of wrong graphs).
  • Using log when you mean ln. See natural log vs common log.
  • Degree/radian mismatch in trig — see radians vs degrees.

Questions

Why does sin x give an error?

Functions need brackets so there is no doubt about what they apply to. Type sin(x), sin(2x) or sin(x)^2 — whichever you mean.

Can I use |x| for absolute value?

Use abs(x). Vertical bars are ambiguous inside longer expressions, so this calculator asks for abs().

What is the difference between log and ln?

log(x) is base 10 and ln(x) is base e. For another base use log(x, b), for example log(8, 2) = 3.

Graph your own example with the Graphing Calculator — free, in your browser.

Try it now

Sources and further reading

Worked examples and figures were produced and checked with the Graphing Calculator Lab engine. See the editorial policy.

Related guides

More in Graphing Basics · All guides