A piecewise function that represents the graph above is
.
In Mathematics and Geometry, the point-slope form of a straight line can be calculated by using the following mathematical equation (formula):
Where:
- x and y represent the data points.
- m represent the slope.
First of all, we would determine the slope of the left line;
Slope (m) = (1 - 8)/(-1 + 8)
Slope (m) = -7/7 = -1
At data point (-1, 1) and a slope of -1, an equation for this line can be calculated by using the point-slope form as follows:
y - 1 = -1(x + 1)
y = -x, if x < -1 (since the dot is hollow at -1).
For line 2, we have;
Slope (m) = (2 + 3)/(4 + 1)
Slope (m) = 5/5 = 1
At data point (0, -2) and a slope of 1, an equation for this line can be calculated by using the point-slope form as follows:
y + 2 = 1(x - 0)
y = x - 2, if x ≥ -1 (since the dot is solid at -1).
Therefore, the piecewise function can be written as follows;