How to Graph Piecewise Functions on a TI-89
The TI-89 has no "piecewise" template like the TI-Nspire. Instead it uses when(:
when(condition, value if true, value if false)
You can type when( on the keyboard (alpha mode) or pick it from CATALOG.
These steps are for the TI-89 / TI-89 Titanium handheld, from Texas Instruments' guidebook. Our online TI-89 calculator runs PedroM, a free third-party operating system and doesn't support every handheld feature. Handheld only — not available in the online edition: it has no graph screen.
Two pieces
f(x)={ x2 if x<1
2x−1 if x ≥ 1 }
- ♦ F1 (Y= editor).
- Enter
y1=when(x<1,x^2,2x-1). - ♦ F3 to graph.
Both pieces equal 1 at x = 1, so this function is continuous and the graph has no break. The < and ≥ symbols are in 2ND 5 (MATH) → Test.
Three or more pieces: nest when(
g(x)={ −x if x<0
x2 if 0 ≤ x < 2
4 if x ≥ 2 }
y1=when(x<0,-x,when(x<2,x^2,4))
The second when( only runs when the first condition is false, so it already knows x ≥ 0. Texas Instruments recommends nesting like this for three or more pieces.
Another way: restrict each piece with |
You can also enter each piece as its own function and limit its domain with the | ("with") key:
y1=x^2|x<1
y2=2x-1|x≥1
This draws each piece only where its condition is true. It's easier to read, but you can't evaluate it as a single function on the Home screen.
Use it on the Home screen too
Define the function once and you can evaluate, differentiate or integrate it:
Define f(x)=when(x<1,x^2,2x-1)
f(0.5) → .25
f(3) → 5
Define is in F4 (Other).
Jump discontinuities
For a function with a jump, such as when(x<0,-1,1), the graph may show a vertical segment joining the two pieces in Line style. That's the calculator connecting neighbouring points, not part of the function. To avoid it, set the style to Dot (Y= editor → Style), or use the | method with separate functions.
Open and closed endpoints aren't drawn either. Add them yourself when you copy the graph.
Common problems
| Problem | Fix |
|---|---|
| Syntax error | check the commas: when(condition, true, false). Every when( needs its own closing parenthesis |
| Only one piece shows | the condition may be the wrong way round, or the window doesn't reach the other piece |
| Vertical line at a jump | use Dot style or separate pieces with ` |
when( result shows as text on the Home screen |
x has no value. Evaluate with f(2) or y1(2) instead |
Related tutorials
Review note: the handheld keystrokes on this page come from Texas Instruments' TI-89 Titanium guidebook and knowledge base. They have not yet been checked on a physical calculator.