Finding the basis and dimension of the simple vector space Suppose I have a vector space $S$ which is represented as all vectors in $\mathbb{R}^3$ satisfying
$$ a_1 - 3a_2+2a_3=0. $$
1) I need to find a basis and dimension. My assumption is as follows:
Basis is 
$$
\begin{bmatrix}
1 \\ -3 \\ 2
\end{bmatrix}
$$
of vectors in the vector space $\mathbb{R}^3$ and dimension is 3.
I know it is a simple question, I just want to make sure that I am on the right track and my assumption is correct.
2) Also, I was wondering what is the right way of finding a basis  and dimension of following vector space defined as a function:  $y(x) = a \cos x + b \sin x$ with arbitrary constants $a$ and $b$.
 A: For the first, you wish to find vectors $(a_1, a_2, a_3)$ such that $a_1 - 3a_2 + 2a_3 = 0.$ If this equation came up in a row reduction process, we would identify $a_2$ and $a_3$ as free variables, since the pivot is in the first column. Thus we may write $a_1 = 3a_2 - 2a_3.$ From this we see that there are two free variables, and thus the dimension of the corresponding space is $2.$
Now for the basis. Any vector in this space has the form $(3a_2 - 2a_3, a_2, a_3)$. Decomposing shows that this is a sum of two vectors $(3a_2, a_2, 0)$ and $(-2a_3, 0, a_3)$, where $a_2$ and $a_3$ are free to be any real number. Thus we see that $(3, 1, 0)$ and $(-2, 0, 1)$ form a basis for this space. Two basis vectors, dimension two.
Let's now consider the collection of functions of the form $a\cos x + b\sin x.$ The zero function is in this collection, and it is easy to show that it is closed under linear combinations. A basis for this function space is the set $\{\sin x, \cos x\},$ with dimension 2.
A: 1) The vector $[1,-3,2]$ doesn't form a basis. You can check that this vector isn't even part of the vector space:
$$ 1\cdot 1 -3 \cdot (-3) + 2 \cdot 2 = 14 \neq 0 $$
In order to find a basis, you have to solve the equation. Write $x_2= s$, $x_3=t$. The solutions then are
$$ \begin{bmatrix}
a_1 \\ a_2 \\ a_3
\end{bmatrix}
=
\begin{bmatrix}
3s - 2t \\ s \\ t
\end{bmatrix}=
s\begin{bmatrix}
3 \\ 1 \\ 0
\end{bmatrix}
+t
\begin{bmatrix}
-2 \\0 \\ 1
\end{bmatrix}.
\tag{*}
$$
Now you should be able to find a basis and the dimension of $S$.
2) I guess that the vector space you are considering is the space of all function of the form $y(x)=a \cos x + b\sin x$, with $a,b\in\mathbb{R}$. Note that this expression is of a similar form as $({}^*)$, you can read the basis from this equation.
