TITLE: Convexity / Concavity --> Formal Definition
QUESTION [2 upvotes]: How do I show that $f(x, y)=(x + y)^2$ is convex/concave using the formal definition of convexity/concavity?

REPLY [0 votes]: Let $x=(x_1,x_2)$ and $y=(y_1,y_2)$. We will show that
$$
f(tx+(1-t)y)\le tf(x)+(1-t)f(y)
$$
for each $t\in[0,1]$.
We have that
$$
(tx_1+(1-t)y_1+tx_2+(1-t)y_2)^2\le t(x_1+x_2)^2+(1-t)(y_1+y_2)^2,
$$
$$
-t(1-t)(x_1+x_2)^2+2t(1-t)(x_1+x_2)(y_1+y_2)-t(1-t)(y_1+y_2)^2\le0,
$$
$$
-t(1-t)((x_1+x_2)-(y_1+y_2))^2\le0.
$$
Hence, the function $f$ is convex.
{"set_name": "stack_exchange", "score": 2, "question_id": 746309}