# differentiation matrix for trig polynomials

Let $$S = \{1,\cos x, \sin x,...,\cos nx, \sin nx\}$$ and $$H = Span_\mathbb{c}(S)$$. I'm asked to find an ordering of $$S$$ so that the matrix of $$\frac{d}{dx}: H \to H$$ in that basis has a simple form.

Isn't the ordered basis just $$\{1,\cos x, \sin x,...,\cos nx, \sin nx\}$$? I can't think of any other basis, however, I don't think the matrix in this basis will be simple.

Consider the $$n=1$$ case, the matrix will be $$\begin{matrix} 0 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & -1 &0 \\ \end{matrix}$$

and it gets ugly when $$n$$ gets bigger.

• When $n =2$, consider the matrix for the basis $\{ 1, \cos x, \cos 2x, \sin x, \sin 2x \}$. – user7440 Sep 12 at 4:27
• You end up with the matrix $$\pmatrix{0\\&0&1\\&-1&0\\&&&0&2\\&&&-2&0\\&&&&&\ddots\\&&&&&&0&n\\&&&&&&-n&0}$$ where the unwritten entries are $0$. I would say that this matrix follows a relatively simple pattern. In particular it is block-diagonal, which is nice. – Omnomnomnom Sep 12 at 15:20
• Using the other commenter's approach gives you the block-matrix $$\pmatrix{0&D\\-D&0}$$ where $D$ is the diagonal matrix with entries $0,1,\dots,n$. – Omnomnomnom Sep 12 at 15:23