Write a piecewise function for the graph calculator

Copyright � 2003�2022 by Stan Brown, BrownMath.com

Summary: You can graph piecewise functions on your TI-83/84 by using the TEST menu. To show the method, we�ll graph the function

Write a piecewise function for the graph calculator

which is read �f of x equals x�+11 for x<0, 11−4x for x between 0 and 2 inclusive, and x�−3x+5 for x>2.� This particular function, as you�ll see, doesn�t have any gaps in it, but exactly the same technique works for piecewise functions that do have gaps.

See also: How to Graph Functions on TI-83/84

Set-up: Dot Mode

The TI-83/84 likes to connect dots with continuous lines or curves where it can. But a piecewise function could have gaps legitimately, and therefore you want to select dot mode.

On a color-TI-84, you can select thick or thin lines or dots. I like the thicker dots, but it�s just a matter of what you find easiest to use.

 One thing to note: If you select MATHPRINT on the Mode screen, and your function is longer than the width of the screen, the TI-84 will display only the first line, and you�ll have to scroll to see the rest. To see the whole function on the screen at once, change to CLASSIC on the first line of the Mode screen.

[MODE] [ 5 times] [] [ENTER]

 

Write a piecewise function for the graph calculator

The mode screen for a black&white TI-84 contains the same information as for a TI-83, apart from the clock. [MODE] [ 4 times] [] [ENTER]

 

Write a piecewise function for the graph calculator
 
Write a piecewise function for the graph calculator

(You may need to switch between dot mode and connected mode, depending on the functions you�re graphing, because a function with a steeply sloping graph can be hard to see in dot mode.)

Enter the Function

The general form you�re going for is

(first piece)(first condition)+(second piece)(second condition)+...

This works because in the TI programming language a true condition is equivalent to a 1 and a false condition to a zero. Therefore each branch of the function is turned on (multiplied by 1) in the proper region and turned off (multiplied by 0) everywhere else.

You can have as many (piece)(condition) pairs as it takes to define the function, and you always need the parentheses around each piece and around each condition. If you have a compound condition like 0 ≤ x ≤ 2, you can use [2nd MATH makes TEST] [] [1] to create an and condition, or code the two conditions in parentheses and multiply them.

For our sample function, you want to get this onto the Y= screen:

Y1=(x�+11)(x<0)+(11−4x)(0≤x and x≤2)+(x�−3x+5)(x>2)

or

Y1=(x�+11)(x<0)+(11−4x)(0≤x)(x≤2)+(x�−3x+5)(x>2)

You already know how to do all of that except the inequality signs in the tests, and as you�ll see, that�s pretty easy.

Clear any previous plots. (Review this on the general graphing page if you need to.) [Y=] and deactivate anything that�s highlighted.
Enter the first branch of the function definition, (x�+11). On the Y= screen, cursor to one of the Y= lines. Press [CLEAR] if necessary, and enter the first piece in parentheses:
[(] [x,T,θ,n] [x�] [+] 11 [)]
Enter the test, (x<0).
Write a piecewise function for the graph calculator
Press [(] [x,T,θ,n] [2nd MATH makes TEST] [5] 0 [)]
Enter the second branch of the function definition, (11−4x). [+] [(] 11 [] 4 [x,T,θ,n] [)]
Enter the second test, (0 ≤ x ≤ 2). You can code this either as the product of two tests, (0≤x)(x≤2), or with an and condition, (0≤x and x≤2). The first way saves a couple of keystrokes, so that�s what I�ll do.
Write a piecewise function for the graph calculator
[(] 0 [2nd MATH makes TEST] [6] [x,T,θ,n] [)] [(] [x,T,θ,n] [2nd MATH makes TEST] [6] 2 [)]
Enter a plus sign and the last branch of the function, (x�−3x+5). [+] [(] [x,T,θ,n] [x�] [] 3 [x,T,θ,n] [+] 5 [)]
Enter the last test, (x>2).
Write a piecewise function for the graph calculator
[(] [x,T,θ,n] [2nd MATH makes TEST] [3] 2 [)]

If you have a color TI-84 with OS update 5.3 or greater, while you�re on the Y= screen you can press [MATH] and select Piecewise to enter each branch of the function, with its condition, on a separate line. This YouTube video gives an example. I don�t see a big advantage to it, but again, it�s a matter of personal preference.

Display the Graph

It�s often helpful to start with [ZOOM] [6], standard zoom, and then adjust the window. This particular function, I think, is a little easier to visualize with the window parameters shown.

Write a piecewise function for the graph calculator
   
Write a piecewise function for the graph calculator

You can zoom, trace, and find values and intercepts just as you would do for any other function.

See the general graphing page for common problems.

One particular problem with piecewise functions is that the TI-83/84 may try to connect the pieces. Make sure you are in dot mode, not connected mode: look on the Y= screen for three dots to the left of your equation.

What�s New?

  • 11 Nov 2020: Added notes about the Mode screen and the �piecewise� option in recent color TI-84s.

    Converted the page from HTML 4.01 to HTML5.

  • 4 Oct 2008: Changed the function from two to three parts, to illustrate all three types of conditions; explained how it works; explained compound conditions; add TI-84 mode screen.
  • (Intervening changes suppressed)
  • 31 Mar 2003: New article.