Answer
a)
$y=-x+2\ \ $ on $\ \ (0,2]$
$y=-\frac{1}{3}x+\frac{5}{3}\ \ $ on $\ \ (2,5]$
b)
$y=-3x-3\ \ $ on $\ \ (-1,0]$
$y=-2x+3\ \ $ on $\ \ (0,2]$
Work Step by Step
$a).$ Find the equation of line that goes through the points $\ (0,2)\ \ \mathrm{and}\ \ (2,0)\ $ and the line that goes through $\ (2,1)\ \ \mathrm{and}\ \ (5,0).$ Secondly, write down the domain restrictions.
$y-2=\frac{0-2}{2-0}(x-0)$
$y=-x+2\ \ $ on $\ \ (0,2]$
$y-1=\frac{0-1}{5-2}(x-2)$
$y=-\frac{1}{3}x+\frac{5}{3}\ \ $ on $\ \ (2,5]$
$b).$ Find the equation of line that goes through the points $\ (-1,0)\ \ \mathrm{and}\ \ (0,-3)\ $ and the line that goes through $\ (0,3)\ \ \mathrm{and}\ \ (2,-1).$ Secondly, write down the domain restrictions.
$y-0=\frac{-3-0}{0+1}(x+1)$
$y=-3x-3\ \ $ on $\ \ (-1,0]$
$y-3=\frac{-1-3}{2-0}(x-0)$
$y=-2x+3\ \ $ on $\ \ (0,2]$