0

I have to show that the function $f : \mathbb{R} \rightarrow \mathbb{R}$ defined by $f(x) = \max(x^2, |x|)$ is convex but I am not sure how to. I guess that the function can be written as

$$ f(x) = \begin{cases} x^2 & \ \text{if} \ -\infty < x < 0 \ \text{or} \ 1 < x \\ x & \ \text{if} \ 0 \leq x \leq 1 \\ \end{cases} $$

but I am then not sure how to show the definition that for $\lambda \in [0,1]$ and for $x,y \in \mathbb{R}$ that $f$ is convex if $$ f(\lambda x + (1 -\lambda)y) \leq \lambda f(x) + (1 - \lambda) f(y) $$

Do I have to seperate the two cases?

Thanks.

Mathias
  • 917
  • Can't you just write it as the intersection of the area above $x^2$ and the area above $|x|$? The intersection of two convex areas is convex. – silver Sep 22 '21 at 17:11
  • Thanks for the help. I will see if it can help me move forward! :) – Mathias Sep 22 '21 at 17:16
  • It might be easier to show that the $\max$ of two convex functions is again a convex function. This almost follows from the definition. The functions $x \mapsto x^2$ and $x \mapsto |x|$ are both convex . – copper.hat Sep 22 '21 at 17:21
  • So if the function is $f(x) = \max(h(x), g(x))$ where both $h, g$ are convex functions I only have to show that for $\lambda \in [0,1]$ and for every $x, y \in \mathbb{R}$ that $h(\lambda x + (1 - \lambda) y) \leq \lambda h(x) + (1 - \lambda) h(y)$ and $g(\lambda x + (1 - \lambda) y) \leq \lambda g(x) + (1 - \lambda) g(y)$ to conclude that $f(x) = \max(h(x), g(x))$ is convex? But as you said, since $h, g$ are convex, the proof follows immediately? – Mathias Sep 22 '21 at 17:30
  • Or would I also need to include? $h(\lambda x + (1 - \lambda) y) \leq \lambda h(x) + (1 - \lambda) h(y) \leq \lambda f(x) + (1 - \lambda) f(y)$ and $g(\lambda x + (1 - \lambda) y) \leq \lambda g(x) + (1 - \lambda) g(y) \leq \lambda f(x) + (1 - \lambda) f(y)$. – Mathias Sep 22 '21 at 17:37

0 Answers0