AI Tutor
Imagine a streaming service that costs $10 a month for up to 50 hours of video, but charges $0.50 for every extra hour after that. A single algebraic equation cannot describe your billβ€”you need two different formulas depending on your watch time.

Anatomy of a Piecewise Function

A piecewise-defined function is a single function composed of multiple sub-functions, where each sub-function applies to a specific interval of the input called a sub-domain.
In 1837, mathematician Peter Gustav Lejeune Dirichlet revolutionized mathematics by defining a function not as a single algebraic formula, but as any rule pairing each input with exactly one outputβ€”paving the way for piecewise definitions.
How do we know which rule to calculate when given an input number?

The Two-Step Evaluation Method

Evaluating a piecewise function is an if-then test. You never plug an input into all the equationsβ€”only into the single matching rule.
First, perform Domain Matching by testing the input value against each conditional inequality to determine which specific sub-domain it satisfies.
Second, perform Substitution by evaluating only the corresponding algebraic expression for that chosen sub-domain.
What happens when your input sits directly on the boundary between two rules?

Boundary Values and Strict Inequalities