# Optimization using Lagrange Multipliers for conditions with different codomain

I'm trying to maximize the trace of $X^TAX$ subject to the columns of $X$ being orthonormal, where $A$ is a diagonal matrix and X is not necessarily square, but does not have more columns than rows. I can represent this constraint succinctly as $X^TX = I$, but I'm not sure how I would use this with the method of Lagrange multipliers without explicitly writing out a condition for each row, column pair, as I can't simply add $\lambda(I - X^TX)$ to the derivative to form the Lagrangian. How does one go about doing this?

• solve for $A$ 2 by 2. – Will Jagy Mar 1 '14 at 3:39
• Sorry, but are you saying that it reduces by induction to solving for 2x2 cases, or that there is a pattern which should become evident when doing so? – Thing1 Mar 1 '14 at 4:05
• I am saying you will know a little more if you do the 2 by 2 and 3 by 3 cases as best you can. – Will Jagy Mar 1 '14 at 4:08

$$L(X,Λ)=tr(X^TAX)+tr(Λ(I-X^TX))$$
$$0=\frac{∂ L}{∂X}=X^T(A+A^T)-(Λ+Λ^T)X^T$$
Note that $tr(X^TAX)=tr((XX^T)A)$ and $P=XX^T$ is an orthogonal projector.