Deduce from the proof of Mantel theorem the following strengthening of the assertion. Let G be a triangle-free graph of order n. Then $e(G) \leq n^2/4$, with equality if and only if G is a complete bipartite graph $ K_{n/2,n/2} $
This is how Mantel's theorem is proved in my textbook:
Let G be a triangle-free graph of order n. Then $\Gamma (x) \cap \Gamma (y) = \phi$ for every edge $xy \in E(G)$, so
$d(x)+d(y)\leq n$
Summing these inequalities for all $e(G)$ edges $xy$, we find that $\sum_{x\in G} d(x)^2 \leq n\space e(G). $
Now since the sum of the degrees is twice the number of the edges then by Cauchy's inequality we have, $ (2 \space e(G))^2 = (\sum_{x\in G} d(x))^2 \leq n \space (\sum_{x\in G} d(x)^2)$ Hence $(2e(G))^2 \leq n^2e(G)$
implying $e(G) \leq n^2/4$
I am not quite sure how to start. Any help would be appreciated.