Prove $f(x,y)= x^2 + y^2$ is convex function I have trouble proving that $f(x,y)= x^2 +y^2$ is a convex function with the definition. I know that sum of convex functions is a convex function. But, I am confused, could we use this theorem when the variable is not the same? I mean when we know $f(x)=x^2$ and $g(x)=|x|$ is convex function so $h(x)=x^2+|x|$ is convex function. But when $f(x)=x^2$ and $f(y)=y^2$ convex function could we say that $f(x,y)=x^2+y^2$ is a convex function?
Note : I am prohibited from proving this with the Hessian.
 A: You can decompose your function $ f(x, y) = x^2 + y^2 $ into two terms defined over the same domain as $ f_1(x, y) = x^2 $ and $ f_2(x, y) = y^2 $. Both $ f_1(x, y) $ and $ f_2(x, y) $ are convex functions. Thus, $ f(x, y) = f_1(x, y) + f_2(x, y) $ is a convex function.
A: Foreword: Sum of convex functions is a convex function.
Consider that $f(x) = x^2$ has $f''(x) = 2 > 0$, so $f$ is a convex function. It is also strongly convex too (and hence strictly convex) with strong convexity constant $2$.
Now the same holds for $f(y) = y^2$, so you're done by what I said in the foreword.
Proof for the convexity of $x^2$
Proposition
A function $f: X\to \mathbb{R}$ is convex if, $\forall (x_1, x_2) \in X$, with $x_1\neq x_2$, and every $\lambda\in(0,1)$ we have
$$f((1 - \lambda)x_1 + \lambda x_2) \leq (1 - \lambda)f(x_1) + \lambda f(x_2)$$
And it's strictly convex if the relation $\leq$ becomes a $<$.

Be $x\in\mathbb{R}$, we prove $f(x) = x^2$ is strictly convex.
Pick $x_1, x_2$ (different each other), and $\lambda \in (0, 1)$. Now by the definition of convex function:
$$\begin{split}
f((1-\lambda)x_2 + \lambda x_2) & = ((1 - \lambda) x_1 + x_2)^2 \\
& = (1 - \lambda)^2 x_1^2 + \lambda^2 x_2^2 + 2(1 - \lambda) x_1 x_2
\end{split}$$
Now since $x_1 \neq x_2$, we have $(x_1 - x_2)^2 > 0$. Expanding this means $x_1^2 + x_2^2 > 2 x_1 x_2$.
This means that
$$
\begin{split}
(1 - \lambda)^2 x_1^2 + \lambda^2 x_2^2 + 2(1 - \lambda) x_1 x_2 & < (1 - \lambda)^2 x_1^2 + \lambda^2 x_2^2 + (1-\lambda)\lambda (x_1^2 + x_2^2) 
\\\\
& = (1 - 2\lambda - \lambda^2 + \lambda + \lambda^2)x_1^2 + (\lambda - \lambda^2 + \lambda^2)x_2^2
\\\\
& = (1 - \lambda)x_1^2 + \lambda x_2^2 
\\\\
& = (1 - \lambda)f(x_1) + \lambda f(x_2)
\end{split}$$
as wanted.
A: Since $f(x,y)$ is obviously continuous, in order to show its convexity it is enough to show its midpoint-convexity, i.e. that
$$ f(x,y)+f(X,Y) \geq f\left(\frac{x+X}{2},\frac{y+Y}{2}\right). $$
This is a trivial inequality since
$$ x^2+X^2-\left(\frac{x+X}{2}\right)^2 = \left(\frac{x-X}{2}\right)^2 $$
$$ y^2+Y^2-\left(\frac{y+Y}{2}\right)^2 = \left(\frac{y-Y}{2}\right)^2. $$
No need to invoke derivatives.
A: Directly from first principles, without using that $f(x,y)=x^2$ is convex. Also, the same proof works in arbitrary dimension, or even any Hilbert space.
We need to show for $u,v\in\mathbb R^2$ and $t\in[0,1]$ that $$ |tu+(1-t)v|^2 \le t|u|^2 + (1-t)|v|^2 .$$ Expanding the inner product and applying Cauchy-Schwarz gives
$$|tu+(1-t)v|^2 = t^2 |u|^2 + (1-t)^2 |v|^2 + 2t(1-t)u\cdot v \le t^2 |u|^2 + (1-t)^2 |v|^2 + 2t(1-t)|u||v|$$
This RHS is simply equal to $\Big|t|u|+(1-t)|v|\Big|^2$ so we can use the convexity of the 1D function $x\mapsto x^2$ between $|u|$ and $|v|$ to conclude.
Or we can reuse the proof of its convexity, which is to use the easy inequality $2xy\le x^2 + y^2$ with $x=|u|$ and $y=|v|$ to find
$$|tu+(1-t)v|^2 \le (t^2 + t(1 -t))|u|^2 +( (1-t)^2 + t(1-t))|v|^2 $$
Then just observe that $t^2 + t(1 -t)=t$ and if you put $t=1-s$ in this equality we also get $(1-s)^2 + s(1-s)=1-s$, which proves the result.
