I failed the following question in a quiz:
For which values of $a$ the function $e^{-a\sqrt x}$ with $dom = \mathbb{R}^+$ is convex? Check all that apply:
- $a\leq0$
- $a\geq0$
- $-1 \leq a\leq1$
- $a\leq-1$
I said that in all cases it is convex because when plotting for me it was kind of obvious. However, the correct answer is 2. Why?
Thank you.
Well, why not to differentiate twice and check?
$$f(x):=e^{-a\sqrt x}\;,\;\;f'(x)=-\frac a{2\sqrt x}e^{-a\sqrt x}\;,$$
$$f''(x)=\frac{e^{-a\sqrt x}}{4x}a\left(\frac 1{\sqrt x}+a\right)$$
Now
$$f''(x) \geq 0\iff a\left(\frac1{\sqrt x}+a\right) \geq 0\iff\begin{cases} a \geq 0\;,\;\;\;\text{or} \\{}\\a<0\;\;\text{and}\;\;\frac1{\sqrt x}<-a\end{cases}$$