# How would one prove that a linear combination of convex functions is also convex?

As above, how would one mathematically prove that a linear combination of convex functions is also convex?

We know a function defined on a convex set $$S$$ is convex if:

$$f(tx_1+(1-t)x_2)\leq tf(x_1)+(1-t)f(x_2)$$

where $$t$$ is from $$0$$ to $$1$$

We must prove that $$\sum_{i=1}^n a_i f_i(x)$$ is also convex given a bunch of functions $$f_1, f_2$$ etc.

How do i approach this problem? I could say the following:

$$tf(x_1)+(1-t)f(x_2)+tg(x_1)+(1-t)g(x_2)=t(f(x_1)+g(x_1))+(1-t)(f(x_2)+g(x_2))$$

$$f(tx_1+(1-t)x_2)+g(tx_1+(1-t)x_2)\leq t(f(x_1)+g(x_1))+(1-t)(f(x_2)+g(x_2))$$

Is this how we show it?

Secondly, how would we prove the same thing for a concave function? Isn't it just adding a - sign? How would i mathematically prove it?

• As for the concavity: how did you define concave functions? Why would you want to approach it differently in any way than convex functions? – Qi Zhu Sep 22 '18 at 21:02
• Are the coefficients $a_i$ all non-negative? – robjohn Sep 22 '18 at 22:05

In general your statement is false. The function $$f(x)=x^2$$ is convex, while $$-f$$ is not convex. It is true if you consider so-called conical combinations, i.e. all coefficients are supposed to be nonnegative.
You should assume the coefficients positive. Your sum is finite, so you just need to prove that $$a_1f_1+a_2f_2$$ is convexe.
$$a_i>0.$$
• @KaviRamaMurthy It is true if the $a_i$s are positives. – hamam_Abdallah Sep 23 '18 at 8:59