TITLE: Showing that $\{ 1, \cos t, \cos^2 t, \dots, \cos^6 t \}$ is a linearly independent set
QUESTION [7 upvotes]: 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

REPLY [3 votes]: 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}. 
$$