---
name: Piecewise Function
category: math
description: Piecewise function definition using cases environment
packages:
  - amsmath
preamble: []
---
\[
f(x) = \begin{cases}
  x^2       & \text{if } x \geq 0, \\
  -x        & \text{if } x < 0.
\end{cases}
\]
