Let $\mathbf{v}$ be a vector in an inner product space $V$ over $\R$.
Suppose that $\{\mathbf{u}_1, \dots, \mathbf{u}_n\}$ is an orthonormal basis of $V$.
Let $\theta_i$ be the angle between $\mathbf{v}$ and $\mathbf{u}_i$ for $i=1,\dots, n$.

Prove that
\[\cos ^2\theta_1+\cdots+\cos^2 \theta_n=1.\]

Let $\langle\mathbf{a}, \mathbf{b}\rangle$ denote the inner product of vectors $\mathbf{a}$ and $\mathbf{b}$ in $V$.

Recall that the angle $\theta$ between $\mathbf{a}$ and $\mathbf{b}$ is defined as the unique number $\theta$ between $0$ and $\pi$ satisfying
\[\cos \theta=\frac{\langle\mathbf{a}, \mathbf{b}\rangle}{\|\mathbf{a}\| \|\mathbf{b}\|}.\]

Proof.

Express the vector $\mathbf{v}$ as a linear combination of the basis vectors as
\[\mathbf{v}=a_1\mathbf{u}_1+\dots+a_n\mathbf{u}_n\]
for some real numbers $a_1, \dots, a_n$.

The length of the vector $\mathbf{v}$ is given by
\[\|\mathbf{v}\|=\sqrt{a_1^2+\cdots+a_n^2}. \tag{*}\]

For each $i$, we have using the properties of the inner product
\begin{align*}
\langle \mathbf{v}, \mathbf{u}_i\rangle&=\langle a_1\mathbf{u}_1+\dots+a_n\mathbf{u}_n, \mathbf{u}_i\rangle\\
&=a_1\langle\mathbf{u}_1, \mathbf{u}_i\rangle+\cdots +a_n \langle\mathbf{u}_n, \mathbf{u}_i \rangle\\
&=a_i \tag{**}
\end{align*}
since $\langle\mathbf{u}_i, \mathbf{u}_i\rangle=1$ and $\langle\mathbf{u}_j, \mathbf{u}_i\rangle=0$ if $j\neq i$ as $\{\mathbf{u}_1, \dots, \mathbf{u}_n\}$ is orthonormal.

By definition of the angle, we have
\begin{align*}
\cos \theta_i&=\frac{\langle\mathbf{v}, \mathbf{u}_i\rangle}{\|\mathbf{v}\| \|\mathbf{u}_i\|}=\frac{\langle\mathbf{v}, \mathbf{u}_i\rangle}{\|\mathbf{v}\| } && \text{since $\|\mathbf{u}_i\|=1$.}
\end{align*}
It follows that
\begin{align*}
\cos ^2\theta_1+\cdots+\cos^2 \theta_n &=\frac{\langle\mathbf{v}, \mathbf{u}_1\rangle^2}{\|\mathbf{v}\|^2 }+\cdots+\frac{\langle\mathbf{v}, \mathbf{u}_n\rangle^2}{\|\mathbf{v}\|^2 }\\[6pt]
&=\frac{1}{\|\mathbf{v}\|^2}(a_1^2+\cdots a_n^2) &&\text{by (**)}\\[6pt]
&=\frac{1}{\|\mathbf{v}\|^2}\cdot \|\mathbf{v}\|^2 &&\text{by (*)}\\[6pt]
&=1.
\end{align*}

Thus we obtain
\[\cos ^2\theta_1+\cdots+\cos^2 \theta_n=1\]
as required.

Unit Vectors and Idempotent Matrices
A square matrix $A$ is called idempotent if $A^2=A$.
(a) Let $\mathbf{u}$ be a vector in $\R^n$ with length $1$.
Define the matrix $P$ to be $P=\mathbf{u}\mathbf{u}^{\trans}$.
Prove that $P$ is an idempotent matrix.
(b) Suppose that $\mathbf{u}$ and $\mathbf{v}$ be […]

Inner Product, Norm, and Orthogonal Vectors
Let $\mathbf{u}_1, \mathbf{u}_2, \mathbf{u}_3$ are vectors in $\R^n$. Suppose that vectors $\mathbf{u}_1$, $\mathbf{u}_2$ are orthogonal and the norm of $\mathbf{u}_2$ is $4$ and $\mathbf{u}_2^{\trans}\mathbf{u}_3=7$. Find the value of the real number $a$ in […]

Find the Distance Between Two Vectors if the Lengths and the Dot Product are Given
Let $\mathbf{a}$ and $\mathbf{b}$ be vectors in $\R^n$ such that their length are
\[\|\mathbf{a}\|=\|\mathbf{b}\|=1\]
and the inner product
\[\mathbf{a}\cdot \mathbf{b}=\mathbf{a}^{\trans}\mathbf{b}=-\frac{1}{2}.\]
Then determine the length $\|\mathbf{a}-\mathbf{b}\|$.
(Note […]

Find the Inverse Matrix of a Matrix With Fractions
Find the inverse matrix of the matrix
\[A=\begin{bmatrix}
\frac{2}{7} & \frac{3}{7} & \frac{6}{7} \\[6 pt]
\frac{6}{7} &\frac{2}{7} &-\frac{3}{7} \\[6pt]
-\frac{3}{7} & \frac{6}{7} & -\frac{2}{7}
\end{bmatrix}.\]
Hint.
You may use the augmented matrix […]

Orthonormal Basis of Null Space and Row Space
Let $A=\begin{bmatrix}
1 & 0 & 1 \\
0 &1 &0
\end{bmatrix}$.
(a) Find an orthonormal basis of the null space of $A$.
(b) Find the rank of $A$.
(c) Find an orthonormal basis of the row space of $A$.
(The Ohio State University, Linear Algebra Exam […]

A Symmetric Positive Definite Matrix and An Inner Product on a Vector Space
(a) Suppose that $A$ is an $n\times n$ real symmetric positive definite matrix.
Prove that
\[\langle \mathbf{x}, \mathbf{y}\rangle:=\mathbf{x}^{\trans}A\mathbf{y}\]
defines an inner product on the vector space $\R^n$.
(b) Let $A$ be an $n\times n$ real matrix. Suppose […]

Sum of Squares of Hermitian Matrices is Zero, then Hermitian Matrices Are All Zero
Let $A_1, A_2, \dots, A_m$ be $n\times n$ Hermitian matrices. Show that if
\[A_1^2+A_2^2+\cdots+A_m^2=\calO,\]
where $\calO$ is the $n \times n$ zero matrix, then we have $A_i=\calO$ for each $i=1,2, \dots, m$.
Hint.
Recall that a complex matrix $A$ is Hermitian if […]