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.

$\begingroup$ Note, as mentioned in my answer below, your question is a special case of the reasonably wellknown "Generalized trustregion subproblem" (GTRS). $\endgroup$ – Suvrit Jul 23 '13 at 16:19
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:
A. Beck, Y. Eldar, Strong Duality In Nonconvex Quadratic Optimization With Two Quadratic Constraints, SIAM J. Opt. (2006).
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.

$\begingroup$ Sorry for the late reply. I was revisiting this question. Can you elaborate a bit on your answer? $\endgroup$ – dineshdileep Jan 15 '14 at 4:13