# Determining if a function is convex

Yes this is homework.

For which values of $a$ is the function $f(x)=e^{-a \sqrt x}$ with $\mathbf dom f = \mathbf R_+$ convex? The possible answers are:

1. $a \le 0$
2. $a \ge 0$
3. $-1 \le a \le 1$
4. $a \le -1$

My original thought was that all are convex because for any $a \in \mathbf R, e^{ax}$ is convex. Also, $e^{g(x)}$ is convex if $g$ is convex and I thought that $g(x)=-a \sqrt x$ might be convex (but I don't know the mechanics of how to show this). Finally, I plotted each answer with $x$ some positive scalar across the range of $a$ and they $looked$ convex. Two of the plots are downward sloping and two are upward.

How do I determine if $f(x)=e^{-a \sqrt x}$ with $\mathbf dom f = \mathbf R_+$ is convex?

• If $a<0, -a\sqrt{x}$ is not convex. Remember a differentialble function is convex if its graph lies on or above its tangent lines. – David Peterson Jan 28 '14 at 21:47
• So given $e^{g(x)}$ is convex if $g$ is convex, does it mean that anywhere that $-a \sqrt x$ is not convex then $e^{-a \sqrt x}$ is not convex? – strimp099 Jan 28 '14 at 22:27
• No, the contrapositive would be: if $e^{g(x)}$ is not convex, then $g(x)$ is not convex. My comment was toward your statement "I thought that $g(x)=-a\sqrt{x}$ might be convex." – David Peterson Jan 28 '14 at 22:35
• I see, thanks .. – strimp099 Jan 28 '14 at 22:41

$$f'(x) = f(x) \left(-\frac 1 2 a x^{-1/2}\right)$$
$$f''(x) = f(x) \left(\frac 1 4 a^2 x^{-1}\right) + f(x) \left(\frac 1 4 a x^{-3/2}\right) = \frac{f(x)}{4 x^{3/2}} \left(a^2 x^{1/2}+a \right)$$
by the chain rule. Now consider values of $a$ to make this positive or negative, after noting that $f$ and $x^{-1}$, $x^{-3/2}$ are certainly positive.
• So within the ranges provided for $a$, any value of $\bigtriangledown^2 f(x)$ at the $a$ must be $\succeq 0$ to be convex, correct? In this case $-1 \le a \le 1$ produces negative values so is not convex at those values of $a$... – strimp099 Jan 28 '14 at 22:12
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://math.stackexchange.com/questions/655127/determining-if-a-function-is-convex", "fetch_time": 1571418674000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2019-43/segments/1570986684226.55/warc/CC-MAIN-20191018154409-20191018181909-00254.warc.gz", "warc_record_offset": 593623532, "warc_record_length": 32371, "token_count": 691, "char_count": 1994, "score": 4.0625, "int_score": 4, "crawl": "CC-MAIN-2019-43", "snapshot_type": "latest", "language": "en", "language_score": 0.8150301575660706, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00048-of-00064.parquet"}