# How to prove that given log function is convex

How to prove that $log(1+e^{-x})$ is a convex function?

[from comment]: I have tried with the basic definition of convex function..... like $f(ax+by) \leq af(x)+bf(y)$... but was not able to solve further....

• What have you attempted so far? Did you sketch the graph? Feb 4 '15 at 18:24
• I have tried with the basic definition of convex function..... like f(ax+by) <= af(x)+bf(y).. but not able to solve furhter..... Feb 4 '15 at 18:26

• I don't think it will be easy.. You have to check that $$\log(1+e^{-(tx+(1-t)y)})\leq t \log(1-e^{-x})+(1-t)\log(1+e^{-y}).$$ Maybe trying to reverse engineering it gets you something. Feb 4 '15 at 18:26
• It is not an equivalence, since a convex function is continuous for sure but not necessarily twice differentiable. Consider, for instance, $f(x)=|x|$ or $f(x)=|x|^3$. Feb 4 '15 at 18:39
$$\frac{d}{dx}\log(1+e^{-x}) = \frac{-e^{-x}}{1+e^{-x}} = -\frac{1}{e^x+1}$$ is an increasing function, since $e^x$ is an increasing function.
This gives that $\log(1+e^{-x})$ is a convex function.