Showing that $\{ 1, \cos t, \cos^2 t, \dots, \cos^6 t \}$ is a linearly independent set The problem is:

Show that $\{ 1, \cos t, \cos^2 t, \dots, \cos^6 t \}$ is a linearly independent set of functions defined on $\mathbb{R}$.

The problem expects the student to use a computer program such as Matlab.
To solve the problem I created a matrix in Matlab with $t$ ranging from $1$ to $7$, then row reduced it and got the identity matrix as result. I.e. the columns of the matrix is linearly independent.
Is it enough to just show for $t=1\to 7$; could it not possibly break down at some other number? And is there a more elegant way of solving this without the use of "brute force"?
Here's the Matlab code if necessary:
for t = 1:7
A(t,:) = [1 cos(t) (cos(t))^2 (cos(t))^3 (cos(t))^4 (cos(t))^5 (cos(t))^6];
end

 A: Two comments:


*

*Suppose that you have functions $f_1(t)$, $f_2(t),\ldots,f_k(t)$, and that they are linearly dependent in the vector space of all real-valued functions. That means that you can find real numbers $\alpha_1,\ldots,\alpha_k$ such that
$$\alpha_1 f_1(t)+\cdots + \alpha_k f_k(t) = 0.$$
That means that for any value $a$ of $t$, you will have
$$\alpha_1f_1(a) + \cdots + \alpha_k f_k(a) = 0.$$
In particular, if you pick $k$ different values for $t$, $a_1,\ldots,a_k$, then you have:
$$\begin{align*}
\alpha_1f_1(a_1) + \cdots + \alpha_k f_k(a_1) &= 0\\
\alpha_1f_1(a_2) + \cdots + \alpha_k f_k(a_2) &= 0\\
&\cdots\\
\alpha_1f_1(a_k) + \cdots + \alpha_k f_k(a_k) &= 0
\end{align*}$$
which in turn means that:
$$\alpha_1 \left(\begin{array}{c}f_1(a_1)\\f_1(a_2)\\ \vdots \\ f_1(a_k)\end{array}\right)
+\alpha_2\left(\begin{array}{c}f_2(a_1)\\f_2(a_2)\\\vdots\\f_2(a_k)\end{array}\right) + \cdots + \alpha_k\left(\begin{array}{c}f_k(a_1)\\f_k(a_2)\\\vdots\\f_k(a_k)\end{array}\right) = \left(\begin{array}{c}0\\0\\\vdots\\0\end{array}\right),$$
so the columns of the corresponding matrix are linearly dependent, so the corresponding matrix is singular.
By contrapositive, if the matrix you get by evaluating the functions at $k$ different points as you did is nonsingular, then the functions have to be linearly independent, as you conclude.
However, the converse is not true: it may be that you get "unlucky" and evaluate at points where the matrix is singular, even if the functions are not. If instead of using $t=1,2,\ldots,7$ you had used $t=\pi,2\pi,\ldots,7\pi$, your matrix would have been singular, even though the functions are, as you concluded, linearly independent. So the matrix being nonsingular is sufficient, but it is not necessary for the functions to be linearly independent.

*As to other methods of doing this... (comment two): the standard way when your functions can be differentiated enough times (as they can be here), is to use the Wronskian.
A: The equality 
$$
\cos x=\frac{e^{ix}+e^{-ix}}{2}
$$ 
shows that $(\cos x)^n$, being a polynomial of degree $n$ in $e^{ix}$ and $e^{-ix}$, is not a linear combination of lower powers of $\cos x$. 
The fact (implicitly used) that the functions $e^{inx}$ are linearly independent follows from the equality 
$$
\frac{d}{dx}\ e^{inx}=in\ e^{inx}. 
$$
A: The computational approach that you used works well.  For our particular collection of functions, or more generally for the powers of a single function $f(t)$, there is a straightforward non-computational approach.  As a bonus, the argument below works just as well for $666$ as it does for $6$.
Suppose to the contrary that our collection $\{1,\cos t, \cos^2 t, \dots, \cos^6 t\}$ of functions is not linearly independent.  Then there are constants $a_0, a_1, \dots, a_6$, not all $0$, such that 
$$a_0+a_1 \cos t +a_2 \cos^2 t +\cdots +a_6 \cos^6 t=0 \quad\text{ for all $t$}.$$
Let $P(x)=a_0+a_1x+a_2x^2+\cdots +a_6x^6$. Not all the coefficients $a_i$ are $0$, so the equation $P(x)=0$ has at most $6$ solutions. (A non-zero polynomial of degree $\le n$ has at most $n$ roots.)  Thus if we can show that the function $\cos t$ can take on more than $6$ different values, we obtain the desired contradiction.  
But $\cos t$ takes on infinitely many different values as $t$ ranges over the reals, or indeed over any interval of non-zero length.  This completes the proof. 
A: The system of functions $f_i,i=1,2,...,n$ is linearly independent on some set $A$ iff the condition 

$\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad \displaystyle \sum\limits_{i}\alpha_i f_i(x) = 0$ for all $x\in A$

is satisfied only for $\alpha_i = 0$ for all $i=1,...,n$. So, you should solve as many equations, as there are elements in $A$. On the other hand, it's sufficient to take just some elements from $A$ to show that
$$
\sum\limits_{i}\alpha_i f_i(x_j) = 0
$$
for all $j=1,...,m$ implies that $\alpha_i = 0$ for all $i$.
I would say that in your case it's sufficient to consider $8$ points $x_j$ to obtain the over-determined system of linear equations on $\alpha_i$ since $n=7$ in your case and to obtain the over-determined system usually it is sufficient to have $n+1$ equation.
