Let $X$ be a simple graph with $n$ vertices and $e$ edges and let $\lambda$ be an eigenvalue of $X$. Show that
$$ |\lambda| \leq \sqrt\frac{2e(n-1)}{n}$$
which is equivalent to
$$n\lambda^{2} \leq 2e(n-1)$$
I've been given an hint to consider the equality $\mathrm{tr}(A^{2}) = 2e$, where $A$ is the adjacency matrix of $X$, which I've already proved, and to use Cauchy-Schwarz inequality from Calculus. I tried to, but I can't figure out which values I'm supposed to consider in that inequality to prove the previous equivalent form.
I also know that $\mathrm{tr}(A^2)$ is the sum of the squares of all eigenvalues of $A$, so that it suffices to show that inequality for the largest module of an eigenvalue.
I would appreciate if someone helps me here.
Since you are considering a simple graph $\sum_{i=1}^n{\lambda_i}=\mathrm{tr}(A)=0$, and therefore $\lambda_1 = -\sum_{i=2}^n{\lambda_i}$. Now use this, $\mathrm{tr}(A^{2}) = 2e$ and Cauchy-Schwarz inequality to get
$$ \lambda_1^2=\left(-\sum_{i=2}^n{\lambda_i}\right)^2\leq (n-1)\sum_{i=2}^n\lambda_i^2=(n-1)(2e-\lambda_1^2). $$