Let $\mathbf{A_1}$ and $\mathbf{A_2}$ be two hermitian matrices. Consider the problem \begin{align} \max_{\mathbf{u}^H\mathbf{u}=1}~\mathbf{u}^H\mathbf{A}_1\mathbf{u} \\\ \mathbf{u}^H\mathbf{A}_2\mathbf{u}\geq 0 \end{align} I know how to numerically solve it, for example SemiDefinite Relaxation is easily applicable. I was wondering if there is an analytic approach to it. Note that without the constraint, this is equivalent to the maximum RayleighRitz ratio.

As far as I know, there is no "analytic" solution to your problem. Fortunately, this problem happens to be a special case of optimizing (over $\mathbb{C}^n$) a quadratic function subject to two quadratic constraints. This problem has been studied in detail in the following paper:
In particular, see Theorem 2.2 in the cited paper. Moreover, recently, there has been more activity in this area (solving nonconvex QP's with more than two quadratic constraints, etc.); see for example the webpage of T. Pong. 


It seems to me that there are two possibilities. The first is that the (appropriately oriented) eigenvector of $A_1$ corresponding to the maximum eigenvalue lies in the interior of the cone defined by the inequality. If not, then the solution is in the boundary of the cone. In that case, you can solve for the extremal using Lagrange multipliers. 

