find the matrix of $D$ a relative to this basis $ (-\cos x, \sin x).$ let $D: V\to V$ be the differentiation operator. find the matrix of $D$ a relative to this  basis $ (-\cos x, \sin x).$
My attempt:
$D(-\cos x)=\sin x=0. \cos x  + 1.\sin x $
$D(\sin x)=\cos x = 1.\cos x + 0 .\sin x$
Therefore the matrix  representing the differential operator  $D$ a relative to this basis $(-\cos x ,\sin x)$ is $\begin{bmatrix} 0 &1 \\ 1& 0 \end{bmatrix} ^T=\begin{bmatrix} 0 &1 \\ 1& 0 \end{bmatrix}$
Is its true ?

$D(\sin x) = \cos x = -(-\cos x)$, as the basis element is $-\cos x$ not $\cos x$. This does not affect the first computation. So the matrix is then $\begin{pmatrix} 0 & -1 \\ 1 & 0\end{pmatrix}$.
