TITLE: Is $\{\sin x,\cos x\}$ independent?
QUESTION [6 upvotes]: Is $\{\sin x,\cos x\}$ linearly independent in $\mathbb{R}^n$?
I thought they were not because I can write $\cos x=\sin (x+\pi/2)$.
My professor on the other hand said it was independent and his proof is as follows:

If $\{\sin x,\cos\}$ is independent in $[0,2\pi]$, then it will be independent on all of $\mathbb{R}.$ (He didn't prove this either.)
$a\cos x+b \sin x=0  ,\forall \vec{x}\in[0,2\pi].$
$x=0\implies a\cdot1+b\cdot0=0 \implies a=0$.
$x=\pi /2\implies a\cdot 0+b \cdot 1 \implies b=0$.
So $\{\sin x, \cos x\}$ is independent on $[0,2\pi],$ and thus independent everywhere.
$QED$.

Is there something I am missing or not understanding...? Why is this set independent, when I can express an element of the set as a linear combination?

REPLY [6 votes]: I am surprised no one has yet pointed out that your question

Is $\{\sin x,\cos x\}$ linearly independent in $\mathbb{R}^n$?

doesn't make sense.
For a start, $\sin x$ and $\cos x$ aren't in $\mathbb{R}^n$! Your notation is a little ambiguous: you could mean the functions $\sin$ and $\cos$ (in which case they live inside a vector space of functions), or you could mean the numbers $\sin x$ and $\cos x$ for some fixed value $x$, say $x = 5$ (in which case they live inside a vector space of numbers, like $\mathbb{R}$).
I'm going to assume you are thinking of them as functions. So let's be clear about this: let's define $V$ to be the $\mathbb{R}$-vector space spanned by the two vectors $\mathbf{u}$ and $\mathbf{v}$, where secretly $\mathbf{u}$ is the function $\mathbf{u}(x) = \sin x$ and $\mathbf{v}$ is the function $\mathbf{v}(x) = \cos x$.
Now, $V$ is a vector space of functions - what's the zero vector? Of course, it's the zero function, $\mathbf{0}$, defined by $\mathbf{0}(x) = 0$. What does linear independence mean? Well, it means that we can find real numbers $a$ and $b$ such that $a\mathbf{u} + b\mathbf{v} = \mathbf{0}$. But these are functions, and two functions $f$ and $g$ are equal when they agree at all $x$, i.e. $f(x) = g(x)$ for all $x$.
That is, we want $a\mathbf{u}(x) + b\mathbf{v}(x) = 0$ for all $x$, or in more familiar language, $a\sin x + b\cos x = 0$ for all $x$. Now, what are $a$ and $b$?