The angle between the $x$-axis and the vector that reachs the $2$-norm of a matrix

eigenvalues-eigenvectorsmatricesnormed-spaces

Suppose we have a matrix $A\in \mathbb{R}^{2\times 2}$. We have the $2$-norm defined as $\left \|A\right \|_2=\max_{\left \|x\right \|_2=1}\left \|Ax\right \|_2$.

We know that in order to find a unit vector $v$ such that $\left \|Av\right \|_2=\left \|A\right \|_2$, we have to find the eigenvalues of $A^TA$, take the greatest eigenvalue, find a corresponding eigenvector and finally normalize it.

Of course, this would lead us to two different solutions: a vector $v$ and its corresponding additive opposite. Nevertheless, we will take the one with non-negative value of $x$ (i.e. the one which is to the right of the $y$-axis).

Once we have this vector, it is easy to find the angle it forms with the $x$-axis. But I have the following question: Is there any better way to find this angle, providing that it is the only information we want?

This question arises from the following example: if $A=\begin{pmatrix}
1 & 1\\
0 & 1
\end{pmatrix}$
, the eigenvalues of $A^TA$ are $\frac{3\pm \sqrt{5}}{2}$, and the calculation becomes very difficult. Moreover, I found a solution (which I could not understand) that finds the angle without finding the vector. This is the solution:

Have to maximize the function $f\left (\theta\right )=\cos^2\theta +2\sin\theta\cos\theta +2\sin^2\theta=1+\sin2\theta+\sin^2\theta$ and so setting the first derivative to be zero: $0=f'\left (\theta\right )=2\cos2\theta +2\sin\theta\cos\theta=2\cos2\theta+\sin2\theta$. That is $\tan2\theta=2$.

Maybe this can be generalized in order to obtain a general way to find this angle? In that case, I would like to have a better-explained solution. I do not understand where the function $f$ comes from.

Best Answer

Because your setup is $2\times2$, you can work with less theory. Since you only need to look at real vectors $(x,y)$ with $\|(x,y)\|=1$, you may assume that $x=\cos\theta$, $y=\sin\theta$. So now (for your particular $A$) you are looking at \begin{align} \|A(x,y)\|^2=\|(x+y,y)\|^2 &=(\cos\theta+\sin\theta)^2+\sin^2\theta=\cos^2\theta+\sin^2\theta+2\cos\theta\sin\theta+\sin^2\theta\\ &=1+2\cos\theta\sin\theta+\sin^2\theta\\ &=1+\sin2\theta+\sin^2\theta. \end{align} Now you are looking for $\theta$ that maximizes this expression, so differentiate and equate to zero.

If you have $A=\begin{bmatrix} a_{11}&a_{12}\\ a_{21}&a_{22}\end{bmatrix}$, now the function to be maximized will be $$ (a_{11}\cos\theta+a_{12}\sin\theta)^2+(a_{21}\cos\theta+a_{22}\sin\theta)^2. $$