<s>[INST] Show convexity of a function via inequalities I am stuck with deriving the convexity of the function 
$$
f(x) = \sqrt{1 + x^2}
$$ 
from first principles, that is I would like to show that for any $x,y \in \mathbb R$ and $\lambda \in (0,1)$ we have
$$
f(\lambda x + (1 - \lambda)y) \le \lambda f(x) + (1 - \lambda) f(y)
$$
The fact that it is a convex function is easy to see from the second derivative test so I am ok with the statement, its just that I cannot derive it using basic inequalities! 
Here is what I tried so far:
Attempt 1 
Use the convexity of the squaring function to write
\begin{align*}
\sqrt{1 + (\lambda x + (1 - \lambda)y)^2} &\le \sqrt{1 + \lambda x^2 + (1 - \lambda)y^2} \\
&= \sqrt{\lambda (1 + x^2) + (1 - \lambda)(1 + y^2)}
\end{align*}
Now use the fact that
$$
\sqrt{A + B} \le \sqrt{A} + \sqrt{B}
$$
to bound the the last expression by
\begin{align*}
\sqrt{\lambda (1 + x^2) + (1 - \lambda)(1 + y^2)} &\le \sqrt{\lambda (1 + x^2)} + \sqrt{(1 - \lambda)(1 + y^2)}
\end{align*}
but now I'm stuck because I cannot take out the factors and bound it above as both $\lambda$ and $1 - \lambda$ are less than $1$ .. :(
Attempt 2:
Don't use the convexity of the squaring function, instead expand. Then
\begin{align*}
\sqrt{1 + (\lambda x + (1 - \lambda)y)^2} &= \sqrt{1 + \lambda^2x^2 + 2\lambda(1 - \lambda)xy + (1 - \lambda)^2y^2} \\
&\le \sqrt{1 + 2\lambda^2x^2 + 2(1 - \lambda)^2y^2}
\end{align*}
so now I need to find a way to show that
$$
1 + \lambda^2x^2 + (1 - \lambda)^2y^2 \le \lambda^2 + (1 - \lambda)^2
$$
but somehow I am too blind / tired to find the right argument .. :(
Thanks for hints!
 [/INST] We need to check
$$\sqrt{1 + (\lambda x + (1-\lambda)y)^2} \leq \lambda \sqrt{1+x^2} + (1-\lambda) \sqrt{1+y^2}.$$
This is equivalent to
$$1 + (\lambda x + (1-\lambda)y)^2 \leq \lambda ^2 (1+x^2) + (1-\lambda)^2(1+y^2) + 2\lambda (1-\lambda) \sqrt{1+x^2}\sqrt{1+y^2},$$
or equivalently
$$1 + xy \leq \sqrt{1+x^2}\sqrt{1+y^2}.$$
The last inequality is easy to check.
</s>