Let V be the vector space

$\displaystyle f(x)=\sum^2_{k=1}(a_Kcoskx+b_ksinkx)$

Find the matrix $\displaystyle [D]_B$ of the differentiation operator D on V in the basis $\displaystyle \{ 1,sinx, cosx,sin2x, cos2x \}$.

So I don't understand how they got that matrix for D! To find the matrix for D, what I did was to compute the images of the standard unit vectors under the transformation. These are

$\displaystyle T(e_1)=(1,0,0,0,0)=(0, cos0, -sin0, 2cos0, 2sin0)$

And so on for

$\displaystyle D(e_2)=(0,1,0,0,0)$

$\displaystyle D(e_1)=(0,0,1,0,0)$

$\displaystyle D(e_1)=(0,0,0,1,0)$

$\displaystyle D(e_1)=(0,0,0,0,1)$

And then form the matrix $\displaystyle D_B=[D(e_1), D(e_2), D(e_3), D(e_4), D(e_5)]$. But the resulting matrxix I got was very different from the answer. So what do I need to do?