JOVANA
Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Piecewise, Even, and Odd Functions

Some functions follow different rules on different stretches of the input. Learn to read and evaluate piecewise definitions, then classify a function as even, odd, or neither by testing its symmetry.

One function, several rules

A piecewise function uses different formulas on different parts of its domain. Think of a phone plan: free under 100 minutes, then a per-minute charge above that. Each line of the definition carries a condition telling you which inputs it governs, and the conditions must not overlap.

          | x + 1,    if x < 0
f(x) =    | x^2,      if 0 <= x <= 2
          | 5,        if x > 2

f(-3) : -3 < 0,        use x + 1  -> -3 + 1 = -2
f(0)  : 0 in [0, 2],   use x^2    -> 0^2    = 0
f(2)  : 2 in [0, 2],   use x^2    -> 2^2    = 4
f(7)  : 7 > 2,         use 5      -> 5
Find the input, see which condition it satisfies, then apply only that piece's formula.

Even functions: mirror across the y-axis

A function is even when f(−x) = f(x) for every x. Plugging in the opposite input gives the same output, so the graph is a mirror image across the y-axis. The model is f(x) = x^2; powers like x^4 and x^6, and the cosine, are even.

f(x) = x^2 - 4
  f(-x) = (-x)^2 - 4 = x^2 - 4 = f(x)   ->  EVEN

g(x) = x^4 + 3x^2 + 1
  g(-x) = x^4 + 3x^2 + 1 = g(x)          ->  EVEN
Substitute −x and simplify; if you land back on f(x), the function is even.

Odd functions, and the test that settles it

A function is odd when f(−x) = −f(x): the opposite input gives the opposite output. The graph has rotational symmetry about the origin — spin it 180° and it lands on itself. The model is f(x) = x^3; odd powers and the sine are odd. Most functions are neither, and that is a perfectly good answer.

  1. Compute f(−x) by replacing every x with −x, then simplify.
  2. If f(−x) = f(x), it is even. If f(−x) = −f(x), it is odd.
  3. If it is neither, say so. Example: f(x) = x^3 + 1 gives f(−x) = −x^3 + 1, which matches neither f(x) nor −f(x) — neither.