Read this lesson as text
Piecewise Functions
Pre-Calculus · Axiom Academy
One function, several rules — each rule taking over on its own stretch of the domain. A piecewise-defined function is built from two or more equations, where each equation applies on its own interval of the domain. A single brace groups the pieces; each line pairs a formula (what to compute) with a condition (when to use it). Read it as: "use x + 2 when ; use 4 - x when ." To find f at a specific input, let the condition route you to the right piece, then substitute. The animation drops a probe from the x-axis up to the curve at and reads the height f(x) off the graph each time. Is your x less than 1 , or at least 1 ? That decides which piece owns it. Substitute the input into the chosen formula — and only that one. f(0) = 0 + 2 = 2 . The input 0 is below the boundary, so use x + 2 . f(4) = 4 - 4 = 0 . The input 4 is at or above the boundary, so use 4 - x . Evaluate f(0.5) . Since , take the first piece: f(0.5) = 0.5 + 2 = 2.5 . Now f(3) : since , take the second piece: f(3) = 4 - 3 = 1 . 3. Endpoints: Continuous or a Jump Where two pieces meet, the endpoints matter. A closed (filled) circle means the endpoint is included ( or ); an open (hollow) circle means it is not ( or ). Whether the graph is connected there depends entirely on the two heights at the boundary. If both pieces give the same y at the boundary, the graph connects — it's continuous there. If they give different y -values, there's a jump discontinuity .
This is the written version of the interactive lesson above. See the full Pre-Calculus course.