Berkeley Problems in Mathematics 7.5.22 This is the problem: Let $A$ be a real symmetric $n \times n$ matrix with non negative entries. Prove that $A$ has an eigenvector with non-negative entries
I looked at the answer key and don't quite understand it. In the expression containing max, why should it correspond to the eigenvalue $\lambda_0$? I thought that this may be because if Ax is parallel to x, then the dot product between $Ax$ and $x$ is maximised, but is it not possible that it still attains a large value if $A$ transforms $x$ in a way that scales x by so much that Ax is large enough to make $\langle Ax,x\rangle$ large even though they may not be parallel?
Solution(as in answer key):
Let $\lambda_0$ be the largest eigenvalue of $A$. We have
$$\lambda_0 = \max{\{\langle Ax, x\rangle\mid x\in\mathbb{R}^n,\|x\| = 1\}}$$
and the maximum it attains precisely when $x$ is an eigenvector of $A$ with 
eigenvalue $\lambda_0$. Suppose $v$ is a unit vector for which the maximum is attained, and let $u$ be the vector whose coordinates are the absolute values of the coordinates of $v$. Since the entries of $A$ are nonnegative, we have
$$\langle Au,u \rangle \ge \langle Ax,x\rangle =\lambda_0$$ implying that $\langle Au,u\rangle = \lambda_0$, so that $u$ is an eigenvector of $A$ for the eigenvalue $\lambda_0$.

As $A$ is real symmetric, there exists an orthonormal basis $u_0, \dots, u_{n-1}$ of $\mathbb{R}^n$ consisting of eigenvectors of $A$, say $A u_i = \lambda_i u_i$ for $1 \leq i \leq n$ and $\lambda_0 \geq \lambda_1 \geq \dots \geq \lambda_{n-1}$. Now if $x = \sum_{i = 0}^{n-1} a_i u_i$ with $\|x\| = 1$, i.e. $\sum_{i=0}^{n-1} a_i^2 = 1$, then we have 
$$ \langle Ax , x\rangle = \sum_{i = 0}^{n-1} \sum_{j = 0}^{n-1} \lambda_i a_i a_j \langle u_i, u_j \rangle = \sum_{i = 0}^{n-1} \lambda_i a_i^2 \leq \lambda_0 \sum_{i = 0}^{n-1} a_i^2 = \lambda_0.$$
