Cal11 calculator

How to Put Piecewise Function in Graphing Calculator

Reviewed by Calculator Editorial Team

Graphing piecewise functions can be challenging, but with the right approach, you can accurately represent complex mathematical relationships. This guide covers the process for popular graphing calculators.

Introduction to Piecewise Functions

A piecewise function is defined by multiple sub-functions, each applied over a specific interval of the domain. The general form is:

f(x) = {
  f₁(x) if condition₁
  f₂(x) if condition₂
  ...
  fₙ(x) if conditionₙ

For example, the absolute value function can be written as a piecewise function:

f(x) = {
  x if x ≥ 0
  -x if x < 0

Graphing calculators provide different methods to input and visualize these functions. The following sections explain how to do this for specific calculators.

TI-84 Graphing Calculator

Step 1: Enter the Function

  1. Press the Y= button to access the function editor.
  2. Select Y1 and enter the first part of your piecewise function.
  3. For the condition, use the IF function: IF(condition, value, 0).
  4. Enter the second part in Y2 with its own condition.

Example for absolute value function:

Y1=IF(X≥0,X,0)

Y2=IF(X<0,-X,0)

Step 2: Set the Window

Press WINDOW and adjust the X and Y ranges to properly display your function.

Step 3: Graph the Function

Press GRAPH to view your piecewise function.

Desmos Calculator

Step 1: Create a New Graph

  1. Go to Desmos.com.
  2. Click the + button to add a new expression.

Step 2: Enter the Piecewise Function

Use the piecewise function syntax:

f(x) = \left\{
  f₁(x) \text{ if } condition₁
  f₂(x) \text{ if } condition₂
  ...
  fₙ(x) \text{ if } conditionₙ

Example for absolute value function:

f(x) = \left\{x \text{ if } x \geq 0, -x \text{ if } x < 0\right\}

Step 3: Adjust the View

Use the mouse to zoom and pan the graph to properly display your function.

GeoGebra

Step 1: Open GeoGebra

  1. Go to GeoGebra.org.

Step 2: Enter the Piecewise Function

In the input bar, enter the function using the If command:

f(x) = If(condition₁, f₁(x), If(condition₂, f₂(x), ...))

Example for absolute value function:

f(x) = If(x ≥ 0, x, -x)

Step 3: Graph the Function

GeoGebra will automatically graph the function based on your input.

FAQ

Can I graph piecewise functions with inequalities?
Yes, most graphing calculators support inequalities in piecewise functions. Use the appropriate syntax for your calculator.
How do I handle undefined points in piecewise functions?
Use the calculator's undefined value representation (like "undefined" or "NaN") for points where the function is not defined.
Can I graph piecewise functions with multiple conditions?
Yes, simply add more conditions to your piecewise function definition, ensuring they cover all possible cases.
What if my piecewise function has overlapping conditions?
The calculator will use the first matching condition. Make sure your conditions are mutually exclusive.
How can I verify my piecewise function is correct?
Test specific x-values within each interval to ensure the function returns the expected results.