# The function f:f(x)=-|x|+1 is decreasing in the interval...?

May 10, 2018

Decreasing on $\left(0 , \infty\right)$

#### Explanation:

To determine when a function is increasing or decreasing, we take the first derivative and determine where it is positive or negative.

A positive first derivative implies an increasing function and a negative first derivative implies a decreasing function.

However, the absolute value in the given function stops us from differentiating right away, so we'll have to deal with it and get this function in a piecewise format.

Let's briefly consider $| x |$ on its own.

On $\left(- \infty , 0\right) , x < 0 ,$ so $| x | = - x$

On $\left(0 , \infty\right) , x > 0 ,$ so $| x | = x$

Thus, on $\left(- \infty , 0\right) , - | x | + 1 = - \left(- x\right) + 1 = x + 1$

And on $\left(0 , \infty\right) , - | x | + 1 = 1 - x$

Then, we have the piecewise function

$f \left(x\right) = x + 1 , x < 0$

$f \left(x\right) = 1 - x , x > 0$

Let's differentiate:

On $\left(- \infty , 0\right) , f ' \left(x\right) = \frac{d}{\mathrm{dx}} \left(x + 1\right) = 1 > 0$

On $\left(0 , \infty\right) , f ' \left(x\right) = \frac{d}{\mathrm{dx}} \left(1 - x\right) = - 1 < 0$

We have a negative first derivative on the interval $\left(0 , \infty\right) ,$ so the function is decreasing on $\left(0 , \infty\right)$

May 10, 2018

Decreasing in $\left(0 , + \infty\right)$

#### Explanation:

$f \left(x\right) = 1 - | x |$ , $x$$\in$$\mathbb{R}$

$f \left(x\right) = \left\{\begin{matrix}1 - x \text{ & "x>=0 \\ 1+x" & } x < 0\end{matrix}\right.$

${\lim}_{x \rightarrow {0}^{-}} \frac{f \left(x\right) - f \left(0\right)}{x - 0} =$

${\lim}_{x \rightarrow {0}^{-}} \frac{x + 1 - 1}{x} = 1 \ne {\lim}_{x \rightarrow {0}^{+}} \frac{f \left(x\right) - f \left(0\right)}{x - 0} = {\lim}_{x \rightarrow {0}^{+}} \frac{1 - x - 1}{x} = - 1$

$f ' \left(x\right) = \left\{\begin{matrix}- 1 \text{ & "x>0 \\ 1" & } x < 0\end{matrix}\right.$

As a result, since $f ' \left(x\right) < 0$ ,$x$$\in$$\left(0 , + \infty\right)$ $f$ is decreasing in $\left(0 , + \infty\right)$

Graph which also helps

graph{1-|x| [-10, 10, -5, 5]}