Prove $f(x)=(x-3)^2 +4$ is a convex function for convex functions:
$$\lambda f(x_1)+(1-\lambda)f(x_2)\geq f(\lambda x_1 +(1-\lambda)x_2)$$
for $\lambda \in [0, 1]$
My solution looks like:
$$\lambda (x_1-3)^2 +4\lambda +(1-\lambda)((x-3)^2 +4)\ge\bigl(\lambda x_1+(1-\lambda)x_2 - 3)^2+4$$
 $$\lambda (x_1^2+9-6x_1)+4\lambda+(1-\lambda)(x_2^2+13-6x_2) \ge (\lambda x_1+(1-\lambda)x_2-3)^2 +4 $$
$$\lambda x_1^2 +x_2^2-\lambda x_2^2-6\lambda x_1-6\lambda x_2+13 \ge \lambda^2x_1^2+x_2^2+\lambda^2x_2^2-\lambda x_2^2+9+2\lambda x_1-2\lambda^2 x_2 x_1-6x_2+6\lambda x_2-6\lambda x_1$$
$$0 \ge\lambda x_1^2 - \lambda^2x_1^2 +\lambda^2x_2^2 +2\lambda x_1+12\lambda x_2 -2\lambda^2x_2x_1-4 $$
I am not sure if above solution is correct, but I could not figure out how to proceed from this point.
 A: HINT
Use the second derivative
A: We need to show that $$\lambda (x_1-3)^2 +4\lambda +(1-\lambda)(x_2-3)^2 +4-4\lambda \ge\bigl(\lambda x_1+(1-\lambda)x_2 - 3)^2+4.$$ That is, 
$$\lambda (x_1-3)^2 +(1-\lambda)(x_2-3)^2 \ge\bigl(\lambda x_1+(1-\lambda)x_2 - 3)^2.$$  Equivalently
$$\lambda x_1^2+(1-\lambda)x_2^2-6\lambda x_1- 6(1-\lambda) x_2+9$$ $$\ge \lambda^2 x_1^2+(1-\lambda)^2 x_2^2+2\lambda(1-\lambda)x_1x_2-6\lambda x_1-6(1-\lambda)x_ 2+9$$
Simplifying, we arrive at
$$\lambda x_1^2+(1-\lambda)x_2^2+\ge \lambda^2 x_1^2+(1-\lambda)^2 x_2^2+2\lambda(1-\lambda)x_1x_2.$$ Arranging terms
$$\lambda(1-\lambda) x_1^2+\lambda(1-\lambda)x_2^2-2\lambda(1-\lambda)x_1x_2\ge 0.$$ This inequality is equivalent to 
$$ \lambda(1-\lambda)(x_1-x_2)^2=\lambda(1-\lambda)(x_1^2+x_2^2-2x_1x_2)\ge 0,$$ which clearly holds.
A: Note that we can write
$$\begin{align}
f(\lambda x_1+(1-\lambda) x_2)&=f(\lambda (x_1-3)+(1-\lambda )(x_2-3))\\\\
&=(\lambda (x_1-3)+(1-\lambda)(x_2-3))^2+4\\\\
&=(\lambda (x_1-3))^2+((1-\lambda)(x_2-3))^2\\\\
&+2\lambda (1-\lambda)(x_1-3)(x_2-3)+4 \tag 1
\end{align}$$
Furthermore, we can write
$$\lambda f(x_1)+(1-\lambda)f(x_2)=\lambda (x_1-3)^2+(1-\lambda)(x_2-3)^2+4 \tag 2$$
Subtracting $(1)$ from $(2)$ yields
$$\begin{align}
\lambda f(x_1)+(1-\lambda)f(x_2)-f(\lambda x_1+(1-\lambda) x_2)&=\lambda (1-\lambda)(x_1-x_2)^2\\\\
&\ge 0
\end{align}$$
as was to be shown!
