## Calculus: Early Transcendentals (2nd Edition)

From the graph, we see that this function is formed by "gluing" together pieces of linear functions. This means that the derivative is equal at every interval to the slope of the straight line on that interval. The slope of the linear function $f$ is given by $$m=\frac{f(b)-f(a)}{b-a}.$$ We will split this function into intervals corresponding to pieces of linear functions: 1) For $x\in[-5,-2]$. From the graph $f(-5)=3$ and $f(-2)=0$ so the slope is $$f'(x)=m=\frac{f(-2)-f(-5)}{-2-(-5)}=\frac{0-3}{3}=-1$$ 2) For $x\in[-2,0]$. From the graph $f(-2)=0$ and $f(0)=2$ so the slope is $$f'(x)=m=\frac{f(0)-f(-2)}{0-(-2)}=\frac{0-(-2)}{2}=1$$ 3) For $x\in[0,2]$. From the graph $f(0)=2$ and $f(2)=0$ so the slope is $$f'(x)=m=\frac{f(2)-f(0)}{2-0}=\frac{0-2}{2}=-1$$ 4) For $x\in[2,5]$. From the graph $f(2)=0$ and $f(5)=1$ so the slope is $$f'(x)=m=\frac{f(5)-f(2)}{5-2}=\frac{1-0}{3}=\frac{1}{3}.$$ Note that at the end points of these intervals the derivatives are undefined. Gluing this together we get the graph below.