## What is a Piecewise Function?

Certain functions are defined differently in different parts of their domain and are thus more naturally expressed in terms of more than one formula. We refer to such a function as a piecewise function or a piecewise-defined function. Piecewise functions will be useful to us in the study of limits, continuity, and the derivative as examples and counterexamples of functions having certain properties.

If you don’t find enough time to complete this article in a single read, make sure to BOOKMARK this page for future saturation if you don’t want to miss this useful content.

## Examples: How to Graph a Piecewise Function?

Example#1

Let f be the function defined by;

Determine the domain and range of f, and sketch its graph.

Solution:-

The domain of f is (-∞, +∞), the following figure shows the graph of ‘f’; it consists of the portion of the line y=x-1 for which x<3, the point (3,5), and the portion of the line y = 2x+1 for which 3<x. The function values are either numbers less than 2, the number 5, or numbers greater than 7. Therefore the range of f is the number 5 and the numbers (-∞, 2) ∪ (7, +∞).

Example#2

Let g be the function defined by;

Determine the domain and range of g, and sketch its piecewise graph.

Solution:-

The domain of g is (-∞, +∞), following is the graph of the function; The graph contains the portion of the line y= 3x-2 for which x<1 and the portion of the parabola y = x2 for which 1 ≤ x. The range is (-∞, +∞).

Example#3

The H is the function defined by;

Determine the domain and range of H and sketch its graph.

Solution:-

As H is defined for all x, its domain is (-∞, +∞), the graph is sketched below; The range is the set of all real numbers except 6, so in terms of set, we can express range as ℝ-{6}.

Example#4

The piecewise function f is defined by;

Determine the domain and range of f and sketch its graph.

Solution:-

Because f is defined for all x, the domain is (-∞, +∞). The graph appearing below; consists of the point (2, 7) and all the points on the parabola y = x2 except (2, 4). The range is [0, +∞).

Example#5

Determine the domain and range of the absolute value function ‘f’ for which f(x) = |x| and sketch its graph.

Solution:-

From the definition of absolute value function |x|, f(x) is defined piecewise function as below,

The domain is (-∞, +∞). The graph of ‘f’ consists of two half-lines through the origin and above the x-axis. one has slope 1 and the other has slope -1. The range is [0, +∞).

Example#6

The piecewise function f is defined by;

Determine the domain and range of ‘f’ and sketch its graph.

Solution:-

The domain of g is (-∞, +∞), following is the graph of the function; Example#7

A piecewise function f is defined by;

Determine the domain and range of ‘f’ and sketch its graph.

Solution:-

The domain of g is (-∞, +∞), following is the graph of the function; This is a continuous graph having a range (-∞, +∞).

Example#8

A piecewise function f is defined by;

Determine the domain and range of ‘f’ and sketch its graph.

Solution:-

The domain of g is (-∞, +∞), following is the graph of the function; The range is (-∞, 6).

Example#9

Sketch the graph of the signum function (or sign function), denoted by “sgn” and defined piecewise as below;

sgn x is read “signum of ‘x’”.

Solution:-

The domain of sgn x is (-∞, +∞). Following is the graph of sign (signum) function; The range comprises mere three integers as mentioned in the question i.e. {-1, 0, 1}.

Example#10

Sketch the graph and determine the domain and range of the following piecewise function h(x):

Solution:-

The domain is (-∞, +∞), following is how we have sketched the graph; And the range is (-∞, -2) ∪ [0, 5].

How to use a piecewise function calculator to sketch its graph?

There are various online and downloadable graphing calculators available that facilitate users to sketch piecewise functions, few are as follows:

• Desmos Graphing Calculator
• Symbolab
• TI-84
• Mathlab (Get it on google play)

Learn how to use Desmos Graphing Calculator to sketch a piecewise function

Here I am going to elaborate on how to sketch piecewise function graphs using a Desmos graphing calculator?

In the above video, I have selected a few of the examples that were solved and sketched manually in this article, and input their piecewise definitions with corresponding domains in order to obtain their graph, I have picked Example#1 here and tried to substitute commands on Desmos interface, let’s try to understand step by step.

STEP#1

• Open Desmos graphing calculator
• Type first piecewise domain and then the particular function separated by “:”
• Enclose this command in { } brackets. STEP#2

As ‘3’ is not included in the first piecewise domain “x<3” this means that the subjective graph does not contain (3, 2), so we have to develop a “hole” there, for this purpose;

• Click on the “+” icon at the top right, this will open the next expression tab.
• Type (3, 2) • Press on the colorful circle next to (3,2), and you’ll get a panel from where you can select the hollow circle option.
• Click on the hollow-point icon. First piecewise is now accomplished.

STEP#3

• Plot the point (3, 5), which was the second definition of the given piecewise function.
• Keep it a solid point. STEP#4

• Finally type y= {3<x : 2x+1}
• We will get another straight line representing the graph of f(x) = 2x+1 within the domain containing all values of x>3. • As “3” is not included in the domain of f(x)= 2x+1, so we are not going to include (3, 7).
• Type (3,7) as another expression and make it a “hole”. STEP#5

• Let’s apply aforementioned strategies in Example#10 For more examples, you can watch my aforementioned video.

## Uses and Applications of piecewise function

Piecewise functions in addition to Calculus magnanimously contribute to the mathematical modeling of various day-to-day real-life problems, which are later evaluated to get optimal and exact solutions. I have tried to compile some examples from the fields of accounting, Physics, Biology, etc, which would help you to get an idea about the applications and significance of piecewise functions.

• In Denmark, income tax is assigned on the basis of income value, here f(x) is the function that represents the percentage of income that is deducted as tax, and ‘x’ defines the income value.
• I am willing to order caps for “My Maths Club” students from “The Ware House”, Warehouse has charged me with respect to the following payment model which is expressed piecewise below;

Where C(x) is the total cost of caps, and ‘x’ is the number of caps so-ordered.

• Most of the time, there is just one copy of each gene in the early stage of growth of a eukaryotic cell, which is represented as Ni-1. whereas in bacteria, there are multiple DNA plasmids in each cell (more than 100). Now for the sake of simplicity, it is assumed that before cell division, genes or DNAs including plasmid DNA are duplicated. Here we have symbolized the cycle period of cell division as “?”, thus, the following piecewise function can be used to explain cell volume factor v(t).
• A heavy-duty vehicle is moving on the highway with a variable velocity defined piecewise below;

## Conclusion

Piecewise function is indeed a hallmark in the field of Calculus and is deeply involved in the concepts of limits, continuity, differential, and integral calculus. Beyond doubt, piecewise functions have simplified many complex targets of

• Virtual strain fields
• Artificial intelligence
• Random field modeling
• Optical Science
• Pharmaceutical sciences (Pharmacokinetics)
• Laser scanning for environmental sciences
• Scientific Computation in Electrical Engineering
• Sorting out issues in Geology and Mineralogy
• Business, social, and life sciences

Everything, that we study in mathematics has its profound significance and substantial contribution in multifarious fields of real life, piecewise function is a clear example of this.

## FAQs Related to Piecewise Function and its Graphs

Q1) What is a piecewise function?

A piecewise function is a function that is defined by multiple pieces, each of which is defined over a different interval. The pieces of a piecewise function are typically joined together at points called breakpoints.

Q2) What are the properties of piecewise functions?

Piecewise functions have the following properties:

• They are defined over a finite number of intervals.
• The pieces of a piecewise function are joined together at points called breakpoints.
• The value of a piecewise function is continuous at all breakpoints except for the last one.
• The domain of a piecewise function is the union of the domains of the individual pieces.
• The range of a piecewise function is the union of the ranges of the individual pieces.

Q3) What are some examples of piecewise functions?

Some examples of piecewise functions include:

• The absolute value function
• The greatest integer function
• The step function
• The triangle function
• The sawtooth function

Q4) What are the applications of piecewise functions?

Piecewise functions are used in a variety of applications, including:

• Computer graphics
• Economics
• Engineering
• Physics
• Biology
• Medicine

Q5) Can piecewise functions be discontinuous?

A piecewise function can be discontinuous at any point where the two pieces of the function have different values. The discontinuity can be either removable or essential, depending on whether the function can be redefined at the breakpoint to remove the discontinuity.

Q6) How do I deal with discontinuities in a piecewise function?

There are two ways to deal with discontinuities in a piecewise function:

• You can ignore the discontinuities and simply connect the points as smoothly as possible.
• You can draw a gap at each discontinuity to indicate that the function is not defined at that point.

The best way to deal with discontinuities depends on the specific function and the application. If the function is only used for graphical purposes, then it may be acceptable to ignore the discontinuities. However, if the function is used for mathematical calculations, then it is important to draw a gap at each discontinuity.

Q7) How do I graph a piecewise function on a graphing calculator?

To graph a piecewise function on a graphing calculator, you need to first enter the definition of the function into the calculator. Then, you need to select the appropriate mode for graphing piecewise functions.

The specific steps for graphing a piecewise function on a graphing calculator vary depending on the calculator model. However, the general steps are as follows:

• Enter the definition of the function into the calculator.
• Select the piecewise function mode.
• Set the appropriate window.
• Graph the function.

Q8) What are the benefits of using piecewise functions calculator?

Piecewise function calculators can be helpful for a variety of reasons. They can be used to:

• Evaluate piecewise functions quickly and easily.
• Graph piecewise functions accurately.
• Identify the breakpoints of piecewise functions.
• Analyze the properties of piecewise functions.

Related Articles:

Epsilon And Delta Definition Of Limit

Continuous Vs Discontinuous Functions

Squeeze Theorem & Continuity of Trigonometric Functions