Courses
Courses for Kids
Free study material
Offline Centres
More
Store Icon
Store

Piecewise Functions: Definitions, Graphs & Examples

Reviewed by:
ffImage
hightlight icon
highlight icon
highlight icon
share icon
copy icon
SearchIcon

How to Find the Domain and Evaluate Piecewise Functions

A piecewise-defined function is one that is described not by a one (single) equation, but by two or more. Take into account the following function definition:

\[F(x) = \left\{\begin{matrix}-2x, -1 \leq x < 0\\X^{2}, 0 \leq x < 1 \end{matrix}\right.\]

Above mentioned piecewise equation is an example of an equation for piecewise function defined, which states that the function definition is different on different parts of its domain. For the piecewise-defined function above, the domain is [−1, 1][−1, 1], but the function definition on [−1, 0][−1, 0] is distinct from that of function definition on [0, 1][0, 1].


How to Find the Domain of a Piecewise Function

Let’s learn to find the domain and range of the piecewise function 

Consider the function: y = x² if x < 0, y = x + 2 if 0 ≤  x ≤ 3, y = 4 if x > 3?

Domain: (−∞, ∞)

Range: (0, ∞) 

Solution:

It is ideal to begin graphing piecewise functions by first thoroughly reading the "if" statements and you will then possibly shorten the chance of making an error by doing so.

Having said that, we have:

\[\left\{\begin{matrix} y = x^{2} \text{ if x < 0} \\ y = x + 2 \text{ if 0 }\leq x \leq 3 \\ y = 4 \text{ if x }> 3\end{matrix}\right.\]

It is quite crucial to consider the greater/less than or equal to signs because two points on the same domain will make it such that the graph is not a function. Nonetheless:

  • When No Restrictions in the ‘if’ Statements

y = x² is a simple parabola, and you probably know that it begins at the origin, (0, 0), and stretches out indefinitely in both directions. But, our limitation is all x-values less than (<) 0, thus we will only draw the left half of the graph, and leave an open circle at the point (0, 0), as the limitation is less than 0, and does not include 0.

Our next graph is a normal linear function moved upwards by two but only appears from 0 to 3 and includes both, so we will draw the graph from 0 to 3, with shaded circles on both 0 and 3.

The ultimate function is the simplest function, a constant function of y = 4, where there is only a horizontal line at the value of 4 on the y-axis, but only after 3 on the x-axis, because of our limitation.

Let's see how it would appear without the limitation:


(Image will be uploaded soon)

  • When Adding Restrictions in the ‘if’ Statements

Now, let’s find the domain and range of a piecewise function adding the restrictions in the ‘if’ statements:

Like we said earlier, the quadratic just looks like less than zero (<0), the linear only looks like from 0 to 3, and the constant only appears followed by 3, thus:

Domain: (−∞, ∞)

Range: (0, ∞)

Our domain is all real numbers because of our x-values being continuous along the x-axis, seeing that we have one shaded circle on the linear function at x = 0, and one shaded circle on the linear function at x = 3. The constant function continues endlessly to the right thus, despite the functions visually stopping, the graph still continues, therefore, all real numbers.

Our range begins at 0, but doesn't include it, and goes until infinity because of the graph not going below y = 0, and the lowest point being the quadratic not touching the x-axis at the origin, (0, 0), and stretches out endlessly upwards.


(Image will be uploaded soon)


Solved Examples

Solving piecewise functions requires plotting graphs. Let’s understand how to deal with a piecewise-defined function

Example:

Consider the function described as follows.

\[\left\{\begin{matrix} y = x + 2 \text{ if }x < 0 \\ 2 \text{ for }0 \leq x \leq 1 \\ -x + 3 \text{ for }x > 1\end{matrix}\right.\]


seo images


Solution:

In this example, the function is piecewise-linear, since each of the three parts of the graph is a line.

Piecewise-defined functions can also contain discontinuities ("jumps"). The function in the example below consist of discontinuities at x = −2x = −2 and x = 2.


Example:

Graph the function described as given below:

\[\left\{\begin{matrix} y = 1/2x^{2} \text{ if }x < -2 \\ 0 \text{ for }-2 \leq x < 2 \\ 1/2x^{2} \text{ for }x \leq 2\end{matrix}\right.\]


seo images


Note that we take the help of small white circles in the graph in order to indicate that the endpoint of a curve is not included in the graph, and solid dots to show endpoints that are included.


Example:

Graph the function defined below.

y = logx for  0<x<1

1/(x−2)     for  x≥1


seo images


Solution:

Negative values of x and 0 are excluded in the domain since the 1st function, logx, is not defined for those values. The value x=2 is not included in the domain seeing that the 2nd function is undefined for that value (it contains a vertical asymptote there). Thus, the domain of this function is {x | 0<x<2}∪{x | x>2}. This can be illustrated using interval notation as (0,2)∪(2,∞).

FAQs on Piecewise Functions: Definitions, Graphs & Examples

1. What is a piecewise function? Please provide an example.

A piecewise function is a function defined by multiple sub-functions, where each sub-function applies to a different interval or 'piece' of the domain. In simple terms, the function follows different rules for different input (x) values.

For example:
\( f(x) = \begin{cases} x^2, & \text{if } x < 0 \\ x+1, & \text{if } x \ge 0 \end{cases} \)
In this case, if 'x' is a negative number, we use the rule f(x) = x². If 'x' is zero or positive, we use the rule f(x) = x + 1.

2. How do you evaluate a piecewise function for a given value of x?

To evaluate a piecewise function at a specific value of 'x', you must first determine which interval or condition that x-value satisfies. Once you have identified the correct 'piece' of the domain, you apply the corresponding sub-function rule to that x-value to find the output. For example, to find f(3) in the function above, since 3 ≥ 0, we use the second rule: f(3) = 3 + 1 = 4.

3. What are the key steps to graph a piecewise function accurately?

Graphing a piecewise function involves a few critical steps:

  • Identify the intervals: Look at the conditions (e.g., x < 0, 0 ≤ x < 2) that define each piece of the function's domain.
  • Graph each sub-function: Graph each equation (e.g., y = x², y = 2x - 1) but only over its specified interval.
  • Use open and closed circles: Place a closed circle (•) at an endpoint if the interval includes that point (using ≤ or ≥). Use an open circle (o) if the endpoint is not included (using < or >).
  • Combine the pieces: The final graph is the combination of all the individual pieces plotted on the same coordinate plane.

4. What are some common types of piecewise functions studied in the CBSE syllabus?

In the CBSE curriculum for Classes 11 and 12, several important functions are actually specific types of piecewise functions. These include:

  • The Absolute Value Function: f(x) = |x|, which is defined as f(x) = x for x ≥ 0 and f(x) = -x for x < 0.
  • The Greatest Integer Function (Step Function): f(x) = [x], which gives the greatest integer less than or equal to x. Its graph looks like a series of steps.
  • The Signum Function: This function returns -1, 0, or 1 based on whether the input 'x' is negative, zero, or positive, respectively.

5. How are piecewise functions used in real-world scenarios?

Piecewise functions are excellent for modelling situations where conditions or rates change. Common real-world examples include:

  • Income Tax Brackets: Where different tax rates apply to different levels of income.
  • Utility Bills: The cost per unit of electricity or water can change after a certain amount of consumption.
  • Retail Pricing: A product might have a bulk discount, where the price per item decreases if you buy more than a certain quantity.
  • Mobile Data Plans: A flat fee might be charged up to a data limit, after which a different rate per GB applies.

6. Why is it so important to define the domain for each piece of a piecewise function carefully?

Carefully defining the domain for each piece is critical because it ensures the relation remains a true function. By definition, every input 'x' in a function must have exactly one output 'y'. The domain intervals of a piecewise function must be mutually exclusive (non-overlapping) to prevent a single x-value from being assigned to more than one sub-function, which would violate the vertical line test.

7. What is the difference between an open circle and a closed circle when graphing a piecewise function?

The circles at the endpoints of intervals are crucial for showing the function's value precisely at that boundary point.

  • A closed circle (•) indicates that the point is included in that piece of the graph. This corresponds to inequalities like ≤ or ≥.
  • An open circle (o) indicates that the point is excluded from that piece of the graph. This corresponds to strict inequalities like < or >.

Using them correctly is essential for determining properties like continuity and the function's exact value at boundary points.

8. Can a piecewise function be continuous? Explain how.

Yes, a piecewise function can be continuous. For a piecewise function to be continuous at a boundary point where two pieces meet (say, at x = c), the graphs of the two pieces must meet at the same point without any jumps or breaks. Mathematically, this means the limit from the left must equal the limit from the right, and this value must equal the function's value at that point. If they do not meet, the function is discontinuous at that point, which is a key concept in Class 12 Calculus.

9. How do you determine the overall domain and range for a complete piecewise function?

To find the domain and range of a complete piecewise function:

  • Domain: The overall domain is the union (or combination) of all the individual domain intervals for each piece. You simply combine all specified x-values to find the total set of valid inputs.
  • Range: The overall range is the set of all possible output (y) values across all pieces. It's often easiest to find the range by first graphing the function and then observing all the y-values it covers on the vertical axis, from its lowest point to its highest point, noting any gaps.