8. Split Functions (Piecewise-defined functions)

By D Hu and M Bourne

Most functions you are familiar with are defined in the same manner for all values of x. However, there are some functions which are defined differently in different domains. These are known as split functions (or piecewise-defined functions).

Because split functions may have drastically different behaviours in different domains (that is, for different x-values), it is quite common for a split function to be non-continuous (and as we learn later, it cannot be differentiated).

Example 1 - Ordinary Function for Comparison

f(x) = −x2 + 4

Graph of f(x) = −x2 + 4 , a continuous function.

This function is not a split function. It is defined the same way for all values of x. To find the value of the function at a given x-value, simply substitute into f(x) = −x2 + 4

Some values for f(x) = −x2 + 4 are as follows:

x -3 -2 -1 0 1 2 3
f(x) -5 0 3 4 3 0 -5

Example 2 - Split Function

` f(x)={(2x+3,text(for ) x<1),(-x^2+2,text(for ) x>=1):} `

In the region x < 1, we have a straight line with slope 2 and y-intercept `3`. As x approaches `1`, the value of the function approaches `5` (but does not reach it because of the "`<`" sign).

Now for the region `x ≥ 1`.

When `x = 1`, the function has value

f(1) = −(1)2 + 2 = −1 +2 = 1.

As we go further to the right, the function takes values based on f(x) = −x2 + 2. It is a parabola.

This function has a discontinuity at `x = 1`, but it is actually defined for `x = 1` (and has value `1`).

Later we'll learn about Differentiation. This function is differentiable for all values of x except `x = 1`.

Example 3

Graph the split function:

` f(x)={(-2x-8,text(for ) x<-2),(3x+2,text(for ) x> -2):} `

Answer

In the region `x < -2`, the function is defined as:

`y = -2x - 8`

As x gets closer to `-2` from the left side, we can see that the value of the function gets closer to `-4`.

Now for the region `x > -2`. The function on this side is defined as

`y = 3x + 2`

As x approaches `-2` from the right, we see that the function value also approaches `-4`.

The function is not defined at `x = -2` so it is not continuous there. We represent this with an open circle on the graph.

1 2 3 4 5 -1 -2 -3 -4 -5 5 10 15 -5 x y (-2, -4)
`y = -2x-8`
`y = 3x + 2`

Graph of a split function.

Example 4

`f(x)` `={(sin\ x,text(for ), x<-2),(2-x/2,text(for ), -2<=x<2),(x^2-8x+10,text(for ), x>= 2):}`

This function is defined in three ways.

  • For x less than `-2`, the function is defined as `sin x`.

  • Between `-2` and `2`, the function is defined as `2 - x/2` (straight line).

  • Finally, for x greater than `2`, the function is `x^2- 8x + 10` (parabola).

So, to determine the value of the function at a particular x-value, it is first necessary to decide which "piece" this value falls within. Only then can we know which expression to substitute into.

Notice that the function is defined for all x, but has discontinuities at `-2` and `2`.

Here are some function values for this split function:

x -4 -3 -2 -1 0 1 2 3 4
f(x) 0.757 -0.141 3 2.5 2 1.5 -2 -5 -6

Example 5 - Split Function (Continuous)

` f(x)={(x,text(for ) x<0),(1/5sin\ 5x,text(for ) x>=0):} `

Graph of a piecewise-defined function.

This function is split into two pieces.

For negative values of x, the function is identical to f(x) = x (a straight line).

For non-negative values of x, the function is identical to `f(x) = 1/5 sin\ 5x`. Again, the function is defined for all values of x. However, in this case, the function is continuous (and differentiable) everywhere.

x -2 -1 0 1 2
f(x) -2 -1 0 -0.192 -0.109

Special Notation

Some split functions are so commonly used that they are given special notation.

Example 6 - Absolute Value Function

f(x) = | x |

Graph of `f(x)=|x|`, an absolute value function.

This is the absolute value function. It is really a split function defined in two pieces:

` f(x)={(-x,text(for ) x<0),(x,text(for ) x>=0):} `

The function is continuous everywhere, but only differentiable at non-zero values of x.

x -2 -1 0 1 2
f(x) 2 1 0 1 2

Example 7 - Step Function

You will also encounter split functions in signal analysis (see Fourier Series and Laplace Transforms). For example, a function in electronics can be defined as

` f(t)={(-1,text(for ), -3<=t<0),(1,text(for ), 0<=t<3):} `