How to find a basis of a linear space, defined by a set of equations Problem
Find a basis of the intersection $P\cap Q$ of subspaces $P$ and $Q$ given by:
$$ P:
\begin{cases}
x_1 - 2 x_2 + 2 x_4=0,\\
x_2 - x_3 + 2 x_4 = 0
\end{cases}
\qquad Q:
\begin{cases}
-2 x_1 + 3 x_2 + x_3 -6 x_4=0,\\
x_1 - x_2 - x_3 + 4 x_4 = 0
\end{cases}
$$
Attempted solution
The intersection of these 2 sets can be written by joining the sets of equations into 1:
$$
\begin{cases}
x_1 - 2 x_2 + 2 x_4=0,\\
x_2 - x_3 + 2 x_4 = 0\\
-2 x_1 + 3 x_2 + x_3 -6 x_4=0,\\
x_1 - x_2 - x_3 + 4 x_4 = 0\\
\end{cases}
$$
After solving it I got the following matrix:
$$
\begin{pmatrix}
1 & 0 & -2 & 6\\
0 & 1 & -1 & 2\\
0 & 0 & 0 & 0\\
0 & 0 & 0 & 0\\
\end{pmatrix}
$$
So, the intersection is the set of vectors, satisfying these 2 equations:
$$
\begin{cases}
x_1 = 2 x_3 - 6 x_4,\\
x_2 = x_3 - 2 x_4\\
\end{cases}
$$
We have 2 independent and 2 dependent variables. What to do next to find the basis?

Having:
$$
\begin{cases}
x_1 = 2 x_3 - 6 x_4,\\
x_2 = x_3 - 2 x_4\\
\end{cases}
$$
We could set
1) For the first element of basis:
\begin{split}
x_3=1,\quad x_4=0:\\
x_1 = 2\cdot 1 - 6\cdot 0 = 2,\\
x2 = 1 - 2 \cdot 0 = 1
\end{split}
So, we get: (2, 1, 1, 0).
2) Second element of basis 
\begin{split}
x_3=0,\quad x_4=1:\\
x_1 = 2 \cdot 0 - 6\cdot 1 = -6,\\
x2 = 0 - 2 \cdot 1 = -2
\end{split}
So, we get: (-6, -2, 0, 1).
Solution
So the basis is $(2, 1, 1, 0), \; (-6, -2, 0, 1)$
