Category: Functions Level: 201
even: f(-x) = f(x) odd: g(-x) = -g(x)
An even function looks the same in a mirror held on the y-axis. An odd function looks the same after a half turn about the origin.
Here is f(x) = x²/2 − 1. The left half looks like the right half in a mirror.
f(x) = x2/2 - 1
Pick x = 2 and x = −2. Both give 1, so the two points sit at the same height, the same distance from the y-axis. That is the mirror rule.
f(-2) = f(2) = 1
Here is g(x) = x³/4 − x/2. Its left half is the right half flipped upside down as well as left to right.
g(x) = x3/4 - x/2
Pick x = 2: g(2) = 1. Then g(−2) = −1. The segment between the two points passes through the origin, and the origin is its midpoint.
g(-2) = -g(2) = -1
Swap x for −x. Squares hide the sign, so f does not change. Cubes and plain x keep the sign, so g flips. Most functions are neither, and that is allowed.
f(-x) = (-x)2/2 - 1 = f(x), g(-x) = -x3/4 + x/2 = -g(x)
cd svg-generator python3 -m svgmath render even-odd-functions --out /tmp/even-odd-functions
Source: svgmath/diagrams/function_basics.py