# How do you sketch the graph that satisfies f'(x)=1 when x>-2, f'(x)=-1 when x<-2, f(-2)=-4?

Dec 14, 2016

$f \left(x\right) = \left\{\begin{matrix}- x + a & x < - 2 \\ - 4 & x = - 2 \\ x + b & x > - 2\end{matrix}\right.$ where $a , b$ are constants

#### Explanation:

For $x < - 2$ we have $f ' \left(x\right) = - 1 \implies f \left(x\right) = - x + a$, ie a straight line with gradient $- 1$

For $x > - 2$ we have $f ' \left(x\right) = 1 \implies f \left(x\right) = x + b$, ie a straight line with gradient $1$

We want $f \left(- 2\right) = - 4$ and we are not told anything about the gradient when $x = - 2$ (and in fact $f ' \left(- 2\right)$ will be undefined) and we are not told that that the function should be continuous.

Combining the results we get:

$f \left(x\right) = \left\{\begin{matrix}- x + a & x < - 2 \\ - 4 & x = - 2 \\ x + b & x > - 2\end{matrix}\right.$ where $a , b$ are constants

If we wanted a continuous solutions then we would need:

For $x < - 2 \implies 2 + a = - 4 \setminus \setminus \setminus \setminus \implies a = - 6$
For $x > - 2 \implies - 2 + b = - 4 \implies b = - 2$

And so:

$f \left(x\right) = \left\{\begin{matrix}- x - 6 & x < - 2 \\ - 4 & x = - 2 \\ x - 2 & x > - 2\end{matrix}\right.$

Which we can graph as follows: But equally we could choose any values for the arbitrary constants $a$ and $b$, for example we could choose $a = b = 0$ to get

$f \left(x\right) = \left\{\begin{matrix}- x & x < - 2 \\ - 4 & x = - 2 \\ x & x > - 2\end{matrix}\right.$

Which we can graph as follows: 