How do you prove $x^2$ is convex using only the definition of convexity?

I apologize beforehand if this is an extremely easy question, I have very limited experience with proving convexity statements. Also, the reason that I choose such a simple example before tackling harder ones is that, if I cannot prove this one, then I have no hope it proving harder convexity statements.

My goal was to shows that the simple $f(x) = x^2$ was convex using the definition only (taking the second derivative and showing is positive is NOT the approach I am looking for).

Recall the definition of a convex function:

$f$ is called convex if: $$\forall x_1, x_2 \in X, \forall t \in [0, 1]: \qquad f(tx_1+(1-t)x_2)\leq t f(x_1)+(1-t)f(x_2).$$

Therefore, I decided to apply both sides of the definition and then compare them:

$$(t x_1 + (1-t) x_2)^2 = t^2x_1^2+2x_1x_2t(1-t)+(1-t)^2x_2^2$$

and I wanted to compare it to:

$$t x_1^2+(1-t)x_2^2$$

I was a little stuck because I didn't know how to show that the inequality is actually true. Intuitively it makes sense because $t \leq 1$ and its square is smaller and thus $t^2x_1^2 \leq t x_1^2$, similarly, $t^2x_2^2 \leq t x_2^2$. However, it was unclear what the cross term did. How do I know that it does not overshoot and make the inequality false?

Thanks for everyones patience.


Subtracting the LHS from the RHS gives $$(t-t^2)x_1^2-2x_1x_2t(1-t)+(t-t^2)x_2^2=t(1-t)(x_1^2-2x_1x_2+x_2^2)=t(1-t)(x_1-x_2)^2\ge 0$$