17

I know that a function is convex if the following inequality is true:

$$\lambda f(x_1) + (1-\lambda)f(x_2) \ge f(\lambda x_1 + (1-\lambda)x_2)$$

for $\lambda \in [0, 1]$ and $f(\cdot)$ is defined on positive real numbers.

If $f(x)=x^2$, I can write the following:

$$\lambda x_1^2 + (1-\lambda)x_2^2 \ge (\lambda x_1 + (1-\lambda)x_2)^2$$

$$0 \ge (\lambda ^2 - \lambda) (x_1^2 - x_2 ^ 2) $$

But I am not sure if this is true or not. How can I prove this?

Ali Caglayan
  • 5,726
groove
  • 281
  • 5
    Hint: if a function is second-differentiable, and $f''(x)>0$ for all $x\in A$, then $f$ is convex in $A$. – Hayden Nov 25 '13 at 18:20
  • @Hayden From a few books and online I saw that the derivative method is used much, but I try to figure out using the definition. Unfortunately, I still cannot do this for other functions such as $x^3$, $\log x$, $x \log x$ and $e^{-x}$. – groove Nov 26 '13 at 18:11

3 Answers3

20

You made a mistake in your rearranging. The following are equivalent: $$\begin{eqnarray*}\lambda x_1^2+(1-\lambda)x_2^2 & \ge & \bigl(\lambda x_1+(1-\lambda)x_2\bigr)^2\\(1-\lambda)x_2^2 + \lambda x_1^2 & \ge & \lambda^2 x_1^2+2\lambda(1-\lambda)x_1x_2+(1-\lambda)^2x_2^2\\\lambda x_1^2 & \ge & \lambda^2 x_1^2+2\lambda(1-\lambda)x_1x_2+\bigl[(1-\lambda)^2-(1-\lambda)\bigr]x_2^2\\\lambda x_1^2 & \ge & \lambda^2 x_1^2+2\lambda(1-\lambda)x_1x_2+(1-\lambda)\bigl[(1-\lambda)-1\bigr]x_2\\\lambda x_1^2 & \ge & \lambda^2x_1^2+2\lambda(1-\lambda)x_1x_2+(1-\lambda)(-\lambda) x_2^2\\0 & \ge & (\lambda^2-\lambda)x_1^2+2\lambda(1-\lambda)x_1x_2+(1-\lambda)(-\lambda) x_2^2\\0 & \ge & \lambda(\lambda-1)x_1^2-2\lambda(\lambda-1)x_1x_2+\lambda(\lambda-1)x_2^2\\0 & \ge & \lambda(\lambda-1)(x_1-x_2)^2\end{eqnarray*}$$

The final inequality is true for all $\lambda$ if $x_1=x_2.$ If $x_1\ne x_2,$ then since $\lambda\ge\lambda-1,$ the final inequality holds exactly when $\lambda\geq 0\geq \lambda-1,$ or equivalently, when $\lambda\in[0,1].$

Cameron Buie
  • 102,994
6

$$\lambda x_1^2 + (1-\lambda)x_2^2 \ge (\lambda x_1 + (1-\lambda)x_2)^2\iff$$

$$\lambda x_1^2+(1-\lambda)x_2^2\ge\lambda^2 x_1^2+2\lambda(1-\lambda)x_1x_2+(1-\lambda)^2x_2^2\iff$$

$$\lambda x_1^2(1-\lambda)+(1-\lambda)x_2^2(1-(1-\lambda))-2\lambda(1-\lambda)x_1x_2\ge 0\stackrel{\text{assuming}\;\lambda\neq1}\iff$$

$$\lambda x_1^2+\lambda x_2^2-2\lambda x_1x_2\ge 0\iff\lambda(x_1-x_2)^2\ge 0$$

and since the last inequality is obvious we're done (if $\;\lambda=1\;$ there's nothing to prove...)

DonAntonio
  • 211,718
  • 17
  • 136
  • 287
4

You made a mistake in your simplification, it should reduce to showing $(1-\lambda) \lambda (x_1-x_2)^2 \ge 0$.

Since $\lambda \in [0,1]$, we have $(1-\lambda) \lambda \ge 0$ from which the result follows.

copper.hat
  • 172,524