# Prove the function has a minimum

I'm stuck in proving the function $$f(x) = \vert x + e^x\vert$$ has a minimum.

This is what I did:

$$f'(x) = (1+e^x)\text{sgn}(1+e^x)$$

But this function is never zero, because the exponential is always positive. So when I study the sign of the derivative, it is always increasing.

Yet the plot of the funciton shows a "sort of" a minimum.

Since there is an absolute value I calculated the difference quotient for $$f(x) > 0$$ and $$f(x) < 0$$ obtaining the function is continuous when $$x+e^x > 0$$ and when $$x+e^x < 0$$

Yet I also understood @Martin R. comment but how to find that point where $$f(x)$$ is discontinuous?

• Hint: $x + e^x = 0$ for some $x \in (-1, 1)$. Dec 2, 2022 at 11:03
• The function is not differentiable everywhere (where?) so you need a bit extra work. Dec 2, 2022 at 11:05
• Proving a function has a minimum is usually significantly easier than finding the minimum. Here your function is continuous, bounded below by $0$ and it tends to $+\infty$ for $x\to\pm\infty$. Therefore, for a given $x_0$ and $M>f(x_0)$, you can find a compact interval $[a,b]$ outside of which $f(x)>M$. Then on $[a,b]$, it's just the extreme value theorem. Dec 2, 2022 at 11:40

$$g(x) = x + e^x$$ is strictly increasing with $$g(-1) < 0 < g(0)$$. It follows that $$g$$ has a (unique) zero $$x_0 \in (-1, 0)$$.

Then $$f(x) \ge 0 = f(x_0)$$ for all $$x \in \Bbb R$$, so that $$f$$ has a minimum at $$x=x_0$$.

$$f$$ is strictly decreasing for $$x < x_0$$, and strictly increasing for $$x > x_0$$. But $$f$$ is not differentiable at $$x_0$$, which explains why $$f'$$ is nowhere zero.

• Thank you, that was enlightening. So Can I simply conclude that $\min(f(x)) = f(x_0)$? Or shall I give more information (if possibile, with elementary reasonings) about the "value" of $x_0$? Which is for sure negative. Dec 2, 2022 at 11:18
• @Numb3rs: If the question is “does $f$ have a minimum” then it suffices to prove the existence of an $x_0$ with $f(x) \ge f(x_0)$ for all $x$. If the question is “where does $f$ attains its minimum” then you need to give information about the location of $x_0$. In your, case $-1 < x_0 < 0$ is easy to see. One can probably express $x_0$ with the help of the Lambert W function. Dec 2, 2022 at 12:05
• Oh, ok. Then no. That function is indeed beyond the course's program, for now. Thank you again! Dec 2, 2022 at 13:09

Your approach has a significant error. You are using the principle that a function $$f$$ will have a supremum (minimum or maximum) at its stationary points, where its derivative $$f'$$ is zero, if the derivative does exist. If the derivative does not exist at a point, you cannot use this rule. A point can still be a supremum without being a stationary point!

The absolute value function $$\left|x\right|$$ is not differentiable everywhere. In particular, it has a sharp change in slope at $$x=0$$. Using this, consider where your expression for $$f'$$ holds everywhere.

Hint: Split the absolute value expression into two differentiable pieces on distinct domains, one where $$x+e^{x}$$ is nonnegative and one where it is negative. Find the minimum of each piece and show that they coincide at the minimum of $$f$$.