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$.

$A$ is real symmetric, so it has $n$ independent eigenvectors with real eigen-values $\lambda_1\geq \cdots \geq\lambda_n$.
Let $v_1,v_2,\cdots, v_n$ be the corresponding independent eigenvectors, and we can assume that their length is $1$ (i.e. they form orthonormal basis).
In max expression, you considered $x$ with $\|x\|=1$. Let 
$$x=a_1v_1+a_2v_2+\cdots + a_nv_n.$$
Then $$Ax=\lambda_1a_1v_1+\cdots + \lambda_na_nv_n.$$
Therefore, w.r.t. above orthonormal basis, noting that $\lambda_i\leq \lambda_1$, we get 
$$\langle Ax,x\rangle=\lambda_1|a_1|^2+\cdots + \lambda_n|a_n|^2 \leq \lambda_1 (|a_1|^2+\cdots + |a_n|^2)=\lambda_1 \langle x,x\rangle=\lambda_1\|x\|^2=\lambda_1.$$
This implies the maximum value of $\langle Ax,x\rangle$ for unit vector $x$ is $\lambda_1$. Now this is in fact attained, if you take 
$$x=v_1= \mbox{ unit eigenvector for the largest eigenvalue } \lambda_1. $$ You can chech this with almost same calculations as above.
