Problem: Consider the linear subspaces \begin{align*} U = \text{span} \left\{ (1,0,1,0), (1,a,0,a)\right\} \quad \text{and} \quad W = \text{span}\left\{(-1, a, a^2, 0), (0,1,0,-1)\right\} \end{align*} in $\mathbb{R}^4$. Determine $\dim(U^{\bot} + W)$ in terms of the parameter $a \in \mathbb{R}$, where $U^{\bot}$ denotes the orthogonal complement of $U$ with respect to the standard innerproduct on $\mathbb{R}^4$.
Attempt at solution: In general, we have the equation $\dim(U + W) + \dim(U \cap W) = \dim(U) + \dim(W)$.
In this case, we have $\dim(U) = 2, \dim(W) = 2$ and $\dim(U^{\bot}) = 2$ (since $U^{\bot} \oplus U = \mathbb{R}^4)$.
So $\dim(U^{\bot} + W) = 4 - \dim(U^{\bot} \cap W)$.
Now, $U^{\bot}$ consists of all the vectors $(x,y,z,u) \in \mathbb{R}^4$ such that $\langle (x,y,z,u), (1,0,1,0) \rangle = 0$ and $\langle (x,y,z,u), (1, a, 0, a) \rangle = 0$. This leads to the system of equations \begin{align*} \begin{cases} x+z &= 0 \\ x+ay + au &= 0 \end{cases} \end{align*} The subspace $W$ consists of all vectors $(x,y,z,u)$ such that \begin{align*} (x,y,z,u) = \lambda_1 (-1, a, a^2, 0) + \lambda_2 (0,1,0,-1). \end{align*} This leads to the system \begin{align*} \begin{cases} x &= - \lambda_1 \\ y &= \lambda_1 + \lambda_2 \\ z &= \lambda_1 a^2 \\ u &= - \lambda_2 \end{cases} \end{align*} Now, I was wondering what the intersection is of $W$ and $U^{\bot}$, i.e. how I can determine $U^{\bot} \cap W$. Should I just substitute the expressions for $x,y,z,u$ into the first system? And then solve for $\lambda_1$ and $\lambda_2$?
$U^\bot\cap W$ is a subspace of $W$ and it certainly contains the vector $(0,1,0,-1)$. (Since this vector belongs to $W$ and it is orthogonal to both vectors generating $U$.) So $U^\bot\cap W$ can be either 1-dimensional or 2-dimensional. (In the first case, it is generated by $(0,1,0,-1)$. In the second case it is equal to $W$.)
So now it suffices to find out for which value of $a$ the vector $(-1,a,a^2,0)$ belongs to $U^\bot$. If it does, $\dim(U^\bot\cap W)=2$. If it does not, $\dim(U^\bot\cap W)=1$.