Skip to content

Piecewise-Defined Functions

Mathematics Grade 7 Difficulty 2/5

Beginning of the lesson

📐 Piecewise-Defined Functions

Big Idea

A piecewise-defined function is a function defined by different formulas on different parts of its domain. Each formula applies only to a specific interval of $x$ values. Think of it as a set of rules — which rule you use depends on the input!

🚕 Why Do We Need Piecewise Functions?

Imagine a taxi that charges:

  • $3 flat fee for the first kilometer
  • $1.50 per kilometer for every kilometer after that

The pricing rule changes depending on the distance! For a 0.5 km ride, you pay $3. For a 4 km ride, you pay $3 + $1.50 · 3 = $7.50. This is a piecewise function in real life.

Other real-life examples include:

🅿️ Parking Fees
Free for 1st hour, $2/hr after
⚡ Electric Bills
Different rates per usage level
📝 Grade Scales
A for 90–100, B for 80–89, etc.
📦 Shipping Cost
Flat rate up to 5 kg, more above

📖 How to Read Piecewise Notation

A piecewise function is written with a large curly brace on the left. Each line shows a formula and the interval (condition) where it applies.

Example Notation:
$$f(x) = \begin{cases} 2x + 1, & \text{if } x < 0 \\ x^2, & \text{if } x \geq 0 \end{cases}$$
Piece 1: Use $2x + 1$ when $x$ is negative (less than 0)
Piece 2: Use $x^2$ when $x$ is zero or positive ($x \geq 0$)
⚠️ Key Rule: Every $x$ value belongs to exactly one interval. The boundary point (like $x = 0$ above) belongs to the piece that includes the equals sign ($\leq$ or $\geq$), not both.

Continue this lesson on YourAIZone

The full lesson has the complete explanation, worked examples, common mistakes, tests with instant checking and an AI tutor. Start right away as a guest, or create an account to keep your progress.

In the full lesson

  • The complete explanation
  • Worked examples
  • Common mistakes and how to avoid them
  • Test questions: 93
  • AI tutor that answers questions about the topic
  • Progress tracking for students, parents and teachers