Taking it further

Now we have described the graphs in words, we want to see if we can describe the graphs using mathematical notation. How can we write the equations of these graphs?

You may wish to use the equation cards to help you. Try to match the graphs to their equations. You may find that you need to draw some extra graphs, and write some more equations to complete the set.

Graph 1

 a function that takes a different constant value on different sections of the x axis.

Each section of the function is made up of equations in the form \(y=a\).

The open and closed circles should have reminded us of representing inequalities on a number line.

The equation of this graph was not given by any of the cards.

\[f(x) = \begin{cases}3 & \text{if } -1 ≤ x ≤ 1 \\ 1 & \text{if } 1 < x < 2 \\ -1 & \text{if } 2≤ x ≤ 4 \\ 2 & \text{if } 4 < x ≤ 7 \end{cases}\]

Notice that this function given for this graph is only defined for \(x\) between \(-1\) and \(7\), so the domain of the function is \(-1≤x≤7\). You can work more with domains of functions in Domain and Range dominoes.

You may have noticed that

\[f(x) = \begin{cases}3 & \text{if } x ≤ 1 \\ 1 & \text{if } 1 < x < 2 \\ -1 & \text{if } 2≤ x ≤ 4 \\ 2 & \text{if } 4 < x ≤ 7 \end{cases}\]

was similar, but required a different graph to be drawn.

What is the difference between the two graphs? What is the domain of this function?

Graph 2

A similar graph but with two sloped pieces around x = 0, described below.

The middle section of the graph might have reminded us of a modulus function, as it could be part of the graph of \(y=|2x|\).

But the modulus (or absolute value) function is a piecewise function itself, and can be written,

\[f(x) = \begin{cases}-2x & \text{if } x<0 \\ 2x & \text{if } x≥0 \end{cases}.\]

Two of the equations given in the cards are correct for this graph.

\[f(x) = \begin{cases}4 & \text{if } -3 ≤ x < -1 \\ -2x & \text{if } -1 ≤ x < 0 \\ 2x & \text{if } 0≤ x < 2 \\ 2 & \text{if } 2≤x< 6 \end{cases}\]

and

\[f(x) = \begin{cases}4 & \text{if } -3 ≤ x < -1 \\ -2x & \text{if } -1 ≤ x ≤ 0 \\ 2x & \text{if } 0 < x < 2 \\ 2 & \text{if } 2≤x< 6 \end{cases}\]

By convention we include \(x = 0\) in the right-hand part of the absolute value function, as shown in the first of the equations, but the graphs are the same for both of the functions given above.

Graph 3

A function with some constant pieces and some sloping pieces.

Points \((3,0)\) and \((8,0)\) could be part of two different sections. Have we seen this before?

One equation is

\[f(x) = \begin{cases}2x & \text{if } 0 ≤ x < 1 \\ 0 & \text{if } 1 ≤ x < 3 \\ 2x-6 & \text{if } 3≤ x < 5 \\ 0 & \text{if } 5≤x< 8 \\ 2x-16 & \text{if } 8≤x≤10 \end{cases}\]

which wasn’t included in the equation cards.

The equation that does appear includes \(x = 3\) and \(x = 8\) as part of the flat sections, written as

\[f(x) = \begin{cases}2x & \text{if } 0 ≤ x < 1 \\ 0 & \text{if } 1 ≤ x ≤ 3 \\ 2x-6 & \text{if } 3< x < 5 \\ 0 & \text{if } 5≤x≤ 8 \\ 2x-16 & \text{if } 8<x≤10 \end{cases}\]

Are both of these correct?

The equation

\[f(x) = \begin{cases}2x & \text{if } 0 ≤ x < 1 \\ 0 & \text{if } 1 ≤ x ≤ 3 \\ 2x-6 & \text{if } 3 ≤ x < 5 \\ 0 & \text{if } 5≤x≤ 8 \\ 2x-16 & \text{if } 8≤x≤10 \end{cases}\]

also appears. What is the difference between this equation and the other two? Is this still a function?

Graph 4

A function with two constant pieces and a quadratic piece between x=0 and x=2.

Piecewise functions do not have to be linear, so having a quadratic as one of the sections is not a problem. Note that the final section continues as \(x\) increases and doesn’t have an end point.

The cards include the equation

\[f(x) = \begin{cases}1 & \text{if }-3≤x≤0 \\ x^2 & \text{if } 0≤x≤2 \\ 0 & \text{if } x≥2 \end{cases}\]

Why is this not correct? How would you write a correct function for graph \(4\)?

Extra equations

There are two cards left that we haven’t looked at yet. Can you draw the graphs for them? Are they both functions?

\[f(x) = \begin{cases}2 & \text{if } -3 ≤ x < -1 \\ -2x & \text{if } -1 ≤ x < 0 \\ 2x & \text{if } 0≤ x < 2 \\ 4 & \text{if } x≥2 \end{cases}\]

This function is similar to a function given for graph \(2\), but what is different about this function compared to any of the others we have looked at here?

the continuous piecewise graph of the function above

This also has the same property as the function above. There are no jumps between different pieces of the graph.

\[f(x) = \begin{cases}x^2 & \text{if } x ≥ 0 \\ -x^2 & \text{if } x < 0 \end{cases}\]

the continuous piecewise graph of the function above

These two graphs are known as continuous piecewise functions, whereas the earlier functions are all discontinuous piecewise functions.