# How to prove that the local minimum for $f(x)=\left|x\right|$ occurs at $x=0$?

The first and second derivative tests don't work as $$f\left(x\right)$$ is not differentiable at $$x=0$$. So, critical points can't be obtained to check for local maxima or minima or inflection.

Plotting the graph for $$f\left(x\right)=\left|x\right|$$ does show that $$f'\left(x\right)$$ or $$\frac{df\left(x\right)}{dx}$$ goes from decreasing to increasing as $$f\left(x\right)$$ passes $$x=0$$. Thus, $$x=0$$ can be termed as the point of local minimum.

However, can this be done through another method in addition to curve sketching just like the first and second derivative tests?

• Just check the definition of a minimum: For all $x\in \Bbb R$ is $f(x) = |x| \ge 0 = f(0)$. Jul 28, 2023 at 12:08
• You can use $|x| \ge 0$
– Tim
Jul 28, 2023 at 12:08
• The critical point test still works when $f'$ is undefined as long as $f$ is still continuous there. Most definitions of critical point allow for $f'$ undefined precisely because of this. Jul 28, 2023 at 12:23
• Something overkill here, though more general as well, would be the sub gradient and convexity. Jul 28, 2023 at 12:36
• For this problem, using derivatives at all is the hard way! Jul 28, 2023 at 16:26

No, you can still apply the first derivative test when $$f(x)$$ is not differentiable at $$x=0$$.

From definition, $$0$$ is a critical point of the function $$f$$ even $$f$$ is not differentiable at $$0$$.

To apply the first-derivative test, you only need $$f$$ is continuous at $$0$$, $$f$$ is differentiable on $$(-\delta, 0)$$ and $$(0, \delta)$$ for some $$\delta>0$$.

Since $$f^{'}(x) \ge 0 \: \text{ for all } x\in(0, \delta) \implies f(x) \text{ is increasing on } (0, \delta)$$

$$f^{'}(x) \le 0 \: \text{ for all } x\in(-\delta, 0) \implies f(x) \text{ is decreasing on } (-\delta, 0)$$

$$f$$ has a local minimum at $$x=0$$.

More than that, since $$f(x)=|x| \ge 0$$ and $$f(0)=0$$, $$f$$ has a global minimum at $$x=0$$.

• Ohh yes, makes sense. Critical points can also occur at values of x where f '(x) is undefined. So, the first derivative test can still be applied to prove x=0 is a point of extremum, specifically, point of relative/local minimum which in this case is also the absolute or global minimum. Jul 28, 2023 at 13:20

You don't need to sketch the graph. According to the definition, $$|x|$$ is always $$\ge0$$.

So the minimum will occur when $$|x|=0$$. In another words, minimum will occur when $$x=0$$.

First consider the interval $$]0,\infty[$$, in which $$f(x)=x$$ and thus $$f'(x)=1$$. Since $$f$$ has a derivative on this interval and $$f'$$ is never equal to 0, no value $$x>0$$ can be a local minimum (or maximum).

Second consider the interval $$]-\infty,0[$$, in which $$f(x)=-x$$ and thus $$f'(x)=-1$$. Since $$f$$ has a derivative on this interval and $$f'$$ is never equal to 0, no value $$x<0$$ can be a local minimum (or maximum).

There remains only one value to consider, namely $$x=0$$ where $$f(x)=0$$, which appears to be a global minimum (since $$\forall x \in \mathbb{R}, |x| \geq 0$$).

To conclude, the function $$f$$ has a unique local extremum in $$0$$, which happens to be a global minimum.

• Yes, got it. Thank you! Jul 28, 2023 at 14:16