I know that the maximum number of edges in a simple graph is nC2, and n is the number of vertices. However, what if the question is the maximum number of edges in a simple graph and the simple graph is a disconnected graph, each vertex has at least 1 edge?
Let's assume there are 7 vertices, my way of thinking is 5C2 + 2C2 = 11, so this makes a disconnected graph but yet it is a simple graph. What I'm trying to do is, group the vertices first so this makes a disconnected graph then I calculate the maximum number of edges.
That's not the definition of a disconnected graph: a disconnected graph has two or more disconnected components (which may not have edges, i.e., isolated vertices). However, this doesn't affect the answer much...
We can quickly conclude that in a disconnected graph with the maximum number of edges, there are exactly $2$ components, which are both complete subgraphs, otherwise we can add an edge without affecting discontinuity. If one component has size $i$ (where $1 \leq i \leq n-1$ and $n \geq 2$), then the other component has size $n-i$, and there are $i(n-i)$ non-edges.
For any given $n$, the function $f:\mathbb{R} \rightarrow \mathbb{R}$ given by $f(i)=i(n-i)$ is an inverted parabola with maximum at $n/2$ (take the derivative with respect to $i$ and equate it to $0$, to show the maximum occurs when $n-2i=0$). It's monotonically increasing when $i \leq n/2$ and monotonically decreasing when $i \geq n/2$. So the value of $i$ we're after is either going to be the least possible $i$, or greatest possible $i$.
Thus we have the minimum number of non-edges when $i=1$ or $i=n-1$. So the maximum number of edges in a disconnected graph is $$\binom{n-1}{2}$$ achieved by $K_1 \cup K_{n-1}$ for $n \geq 2$.
If we add the condition that each component has an edge, then we have the tighter restriction that $2 \leq i \leq n-2$, and $n \geq 4$, and we have the minimum number of edges when $i=2$ or $i=n-2$. So the maximum number of edges in a disconnected graph where each component has an edge is $$1+\binom{n-2}{2}$$ achieved by $K_2 \cup K_{n-2}$ for $n \geq 4$.