Method to prove the the below inequality 
On trying to algebracially show for graph $G$(disconnected) with $n$ vertices that for $2$ or more disjoint subgraphs of $G$ edges in total would always be less than the total edges in case of on a isolated point and $K_{n-1}$ graph .


*

*I arrived at :


$n-1 \leq$$n\sum a_{i} - \sum{a_i}^2 - \sum_{i<j} {a_i a_j}  $ sum range is from $1$ to $S-1$ , where $S$ is the number of disconnected components .  And $a_i$ represent the number of vertices in $i -th$ component. And $\sum a_i \leq n-1 $ sum range is same as before .          How do i prove the above inequality ? I dont have any idea although its correctly telling that for equality case $a_1 = 1$ and $a_2,...,a_{S-1} = 0$ and $a_S = n-1$.


*

*I got the expression from considering $\binom{i}{2} + \binom{j}{2}.... \binom{n-i-j-....}{2} \leq \binom{n-1}{2}$, $i$ vertices in $a_i$ similarily others

 A: The algebraic proof does not even require AM-GM Inequality.
Here it is.
The case $s=2$. So let $a>1$ and $b>1$ we have
\begin{eqnarray*}
% \nonumber to remove numbering (before each equation)
  &&\binom{a}{2}+\binom{b}{2}<\binom{a+b-1}{2}\\  
  &\Leftrightarrow &a(a-1)+b(b-1)<(a+b-1)(a+b-2)\\
  &\Leftrightarrow &(a-1)(b-1)>0.  
\end{eqnarray*}
That's it.
The inductive step is even simpler and is obtained automatically.
A: We want to show that among all $n$-vertex disconnected graphs $G$, the one maximizing $e(G)$ has one $K_1$ component and one $K_{n-1}$ component. The proof is basically just repeatedly applying the idea of "if it has the maximum edges, you can't add more edges".

Proof: Let $G$ be a disconnected graph that maximises $e(G)$. We may assume it has exactly two components (if $G$ has more than two components, you can add edges until it has exactly two components, contradicting maximality).
We can also assume that both components of $G$ are cliques - if they are not, you can add edges inside the components, to get a disconnected graph with more edges.
So we know that $G$ is two cliques $K_a \cup K_b$, assume $a\leq b$ and note $a+b = n$. We just need to show $a=1$. Assume to the contrary $a > 1$. The vertices of $K_a$ have $a-1$ incident edges, and the vertices of $K_b$ have $b-1$ incident edges. So you can make a graph $H$ with more edges by `moving' a vertex from the smaller $K_a$ to the bigger $K_b$ to create $H = K_{a-1}\cup K_{b+1}$. This process subtracts $a-1$ edges (removing from $K_a$), but adds $b$ edges (adding to $K_b$), so $e(H) > e(G)$, contradicting maximality of $G$.
