A piecewise linear function, as the name suggests, is made up of pieces or line segments, of various linear graphs. For example:
As we can see from the graph, we have three straight line pieces, which in this case are connected together, to create a complete graph over the domain $0\le x<10$0≤x<10. This makes this particular graph continuous over its range of $x$x values (though this isn't always the case).
Notice that at $x=0$x=0 there is a filled circle, indicating that at $x=0$x=0, we look at the first line segment to find the $y$y value. However, at $x=10$x=10 there is a hollow circle which means that at $x=10$x=10 there is no $y$y value that we can read from the graph, in this case, because this is where our graph stops.
Sketch a graph of the following piecewise linear function
$y$y | $=$= | $-x+6$−x+6 | when $0\le x<5$0≤x<5 | |
$1$1 | when $5\le x<8$5≤x<8 | |||
$0.5x-3$0.5x−3 | when $8\le x<10$8≤x<10 |
Solution:
We'll start with the first line segment from $x=0$x=0 to $x=5$x=5. We have many methods we can use to sketch graphs of straight lines and here we'll use a combination of strategies. First we'll plot the $y$y-intercept at $\left(0,6\right)$(0,6). Then we'll calculate the value of $y$y when $x=5$x=5, to find the point at which we want to end the drawing of this first line segment. This gives us $\left(5,1\right)$(5,1). As our equation showed $x<5$x<5, we'll need an open circle at the right hand end of the segment.
Next we'll draw the second linear function. We notice it's a horizontal line because we're drawing $y=1$y=1. This means that it will attach straight onto the endpoint of our last segment and we no longer need the open circle. And we'll draw this horizontal line from $x=5$x=5 to $x=8$x=8, with an open circle at the end.
Finally we'll sketch our last line segment. The best strategy here is to calculate the $y$y-coordinate at each $x$x-coordinate of our endpoints, plot the two coordinates and draw the line. So at $x=8$x=8 we have $y=1$y=1, which again means we can attach our final piece to the middle piece at $\left(8,1\right)$(8,1). At $x=10$x=10 we have $y=2$y=2. So at $\left(10,2\right)$(10,2) we'll draw an open circle to match the information given, and we'll draw the line between our two points.
The function $f\left(x\right)$f(x) is defined as shown below. Sketch a graph of $f\left(x\right)$f(x).
$f\left(x\right)$f(x) | $=$= | $x+2$x+2 | when $x\ge5$x≥5 | |
$x-3$x−3 | when $x<5$x<5 |
Recall we can find the equation of a linear graph by finding the $y$y-intercept and gradient. This is also the case for piecewise linear functions, where we find the equation of each piece and state the values of $x$x for that section covers.
Define the function shown in the graph below.
$y$y | $=$= | $\editable{}$ | if $\editable{}$$\le$≤$x$x$\le$≤$\editable{}$ | |||
$\editable{}$ | if $\editable{}$$<$<$x$x$\le$≤$\editable{}$ |
Sometimes when attempting to create a linear model that describes a relationship between two variables, one linear model is not enough. As one (independent) variable changes, its relationship to the other (dependent) variable may also change. When this occurs, piecewise functions and step graphs can be used, so that multiple linear models can be applied to the one real-life scenario.
Sketch the piecewise linear function that describes the following:
Consider a runner who is running for exercise. Their exercise regime is to jog as a warm up, then start running, and then end their workout at rest. They begin jogging at a constant pace of $150$150 m/min for the first $2$2 minutes. After $2$2 minutes they start to run at $300$300 m/min. They continue at this speed for another $2$2 minutes before finally stopping and resting for the final $2$2 minutes of their workout.
Think: Let $y$y equal the distance covered by the runner, measured in metres and let $t$t equal the amount of time that the runner has been running, measured in minutes.
The person is moving at a constant speed in each part of their workout, so we can represent each section with a linear graph. Assess the information given for each section to determine the gradient and endpoints of the line segment.
Do: Assuming that no distance has been covered until the timer starts, this means that $y=0$y=0 when $t=0$t=0. So the first line will have a $y$y-axis intercept of $0$0 and a gradient of $150$150 metres per minute. The piecewise function follows this behaviour for $0\le t\le2$0≤t≤2.
At the $2$2 minute mark, the runner will have covered a distance of $2\times150=300$2×150=300 metres. We now have the end-points of the first section, $\left(0,0\right)$(0,0) and $\left(2,300\right)$(2,300), so we can plot and join the points to create the segment.
In the second section their speed now increases, which means the slope of the line also increases. The gradient of this second line would be $300$300 metres per minute, the speed at which the runner is now running. So the second line with this gradient can now be drawn between $2\le t\le4$2≤t≤4, connecting to the previous line when $t=2$t=2.
We can also find the distance covered at the $4$4 minute mark to plot the end-point. Since the runner's pace has been $300$300 metres per minute, they will have covered $2\times300=600$2×300=600 metres in the $2$2 minutes that they have been running at this pace, covering a total of $300+600=900$300+600=900 metres.
For the final $2$2 minutes of the workout, so for $4\le t\le6$4≤t≤6, the runner is resting and is therefore not covering any distance during this time. So a horizontal line can be drawn from the previous line at $t=4$t=4 until $t=6$t=6.
Reflect: The graph is now complete and represents the given scenario. The equations could also be defined to create the following piecewise function.
$y$y | $=$= | $150t$150t | when $0\le t<2$0≤t<2 | |
$300t-300$300t−300 | when $2\le t<4$2≤t<4 | |||
$900$900 | when $4\le t<6$4≤t<6 |
Ken starts travelling at $9$9 am from point $A$A and moves towards point $B$B in a straight line.
The distance between Ken and point $B$B at various times in his journey is shown on the graph below.
How far is point $B$B from point $A$A?
How many hours was Ken's journey from point $A$A to point $B$B?
Between what times did Ken travel at the fastest speed?
$2:30$2:30 pm $-$− $4$4 pm
$12$12 pm $-$− $1:30$1:30 pm
$9$9 am $-$− $10$10 am
$10$10 am $-$− $12$12 pm
$1:30$1:30 pm $-$− $2$2 pm
What was Ken's fastest speed in km/h?
What was the distance in kilometres travelled by Ken between $1:30$1:30 pm and $4$4 pm?
What is the total distance travelled by Ken from $9$9 am to $4$4 pm?
A children's pool is being filled with water. The volume of water $V$V, in litres, after $t$t minutes is given by the piecewise graph below. The pool has a maximum capacity of $1500$1500 L.
Estimate the volume of water in litres after $45$45 minutes have elapsed, to the nearest $10$10 litres
Determine the equation that describes the volume of water $V$V in litres after $t$t minutes in the first $45$45 minutes.
After $45$45 minutes, the rate at which the volume of water enters the pool is increased.
The piecewise relationship after $t=45$t=45 is given by $V=26t-970$V=26t−970.
Determine the value of $t$t (in minutes) until the pool is filled up.
A CAS calculator can be used to generate graphs and evaluate piecewise functions. Select your brand of calculator below to view instructions to utilise these features.
Casio Classpad
How to use the CASIO Classpad to complete the following tasks regarding piecewise linear functions.
Consider the function $f\left(x\right)$f(x) is defined as:
$f\left(x\right)$f(x) | $=$= | $-4x+28$−4x+28 | when $x\ge4$x≥4 | |
$1.5x+6$1.5x+6 | when $-2\le x<4$−2≤x<4 | |||
$3$3 | when $x<-2$x<−2 |
Create a graph of the function $y=f(x)$y=f(x).
Find the value of the function when $x=3.5$x=3.5.
For what value(s) of $x$x is the function equal to $9$9.
TI Nspire
How to use the TI Nspire to complete the following tasks regarding piecewise linear functions.
Consider the function $f\left(x\right)$f(x) is defined as:
$f\left(x\right)$f(x) | $=$= | $-4x+28$−4x+28 | when $x\ge4$x≥4 | |
$1.5x+6$1.5x+6 | when $-2\le x<4$−2≤x<4 | |||
$3$3 | when $x<-2$x<−2 |
Create a graph of the function $y=f(x)$y=f(x).
Find the value of the function when $x=3.5$x=3.5.
For what value(s) of $x$x is the function equal to $9$9.
Use technology to assist in graphing and analysing the piecewise function in the following practice question.
Harry goes out for a run. He accelerates from rest up to a desired speed and maintains that speed for some time. Feeling exhausted, his velocity drops until he's back at rest.
The speed $S$S in km/h after $t$t seconds is given by the following piecewise relationship.
$S$S | $=$= | $0.8t$0.8t | when $0\le t<15$0≤t<15 | |
$12$12 | when $15\le t<240$15≤t<240 | |||
$252-t$252−t | when $240\le t\le252$240≤t≤252 |
Find the speed in km/h after $10$10 seconds have elapsed.
Find the speed in km/h after $50$50 seconds have elapsed.
Find the speed in km/h after $150$150 seconds have elapsed.
Find the speed in km/h after $250$250 seconds have elapsed.
Which of the following graphs describes the piecewise relationship?