Examine if the set is linearly independent How do I prove or disprove if $\{1, \cos x, \cos 2x,..., \cos nx\}$ is linearly independent?
I tried solving the problem using the definition of linear independence,
$\sum_{k=0}^n a_k\cos kx = 0$
$\Rightarrow a_k =0 $
but I am not able to prove/disprove it.
 A: Consider the space of continuous functions on $[0,2\pi]$ with the inner product defined by
$$
\langle f,g\rangle=\int_0^{2\pi}f(x)g(x)\,dx
$$
Verifying the properties of an inner product is easy. Let's show that the functions $f_n(x)=\cos nx$ are pairwise orthogonal, which will prove the statement. Thus we need to prove that, for $m>n$,
$$
\int_0^{2\pi}\cos mx\cos nx\,dx=0
$$
By the product-to-sum formula, this can be rewritten as
$$
\frac{1}{2}
\int_{0}^{2\pi}
  \left(\cos\frac{(m-n)x}{2}+\cos\frac{(m+n)x}{2}\right)\,dx
$$
so we're reduced to prove
$$
\int_0^{2\pi}\cos\frac{kx}{2}\,dx=0
$$
where $k$ is a positive integer. Now
$$
\int_0^{2\pi}\cos\frac{kx}{2}\,dx=
\left[\frac{2}{k}\sin\frac{kx}{2}\right]_0^{2\pi}=
\frac{2}{k}(\sin k\pi-\sin0)=0
$$
A: Approach 1
Use Wronskian.
Approach 2
You can start by picking $n + 1$ points, say $x_0, \ldots, x_n$. Then for each function, evaluate it at these points and put the values in an $(n+1)$-dimensional vector. If these vectors are linearly independent, then the original functions are. However, you have to pick $x_i$'s wisely. For example, if you pick them as multiple of $2\pi$, you won't be able to conclude linear independence.
You actually can choose more than $n + 1$ points, but then the check for linear dependence cannot be done so easily via determinant.
Approach 3
Mix the two approaches above. You can in fact choose $n + 1$ pairs $(k, x)$ for the operation "Evaluate the $k$-th derivative at point $x$".
Or more generally, pick any $n + 1$ linearly independent functionals from the space of (smooth) functions to $\mathbb R$. Use the determinant check on the $(n+1)$-by-$(n+1)$ matrix of evaluated values. If the determinant is non-zero, the original functions are independent. Otherwise, it's inconclusive. You might want to pick a new set of functionals.
Note: The Wronskian approach is usually easier to apply because the Wronskian itself is a function of $x$. That means you have the chance to try all values of $x$ at once. Moreover, if your functions are holomorphic (which seems to be the case here), Wronskian being non-zero is a necessary and sufficient condition for your functions to be linearly independent.
