To simplify the answer, assume that $\{1, x, x^2, x^3\}$ is the ordered basis for $V,$ and $\{1, x, x^2\}$ for $W.$
The matrix of $D$ is a $3 \times 4$ matrix $A$ such that $[Dp] = A[p]$ where $[Dp]$ and $[p]$ are coordinate matrices, which, in this case, are $3 \times 1$ column matrices whose entries are the coefficients of the ordered basis elements of $W.$
We find $A$ as follows: The $i$th column of $A$ is $[Dp_i]$ where $p_i$ is the $i$th element in the ordered basis of $V.$ Hence,
$$\begin{align}
[Dp_1] & = [D(1)] = [0] = [0 \cdot 1 + 0x + 0x^2] = \begin{bmatrix} 0\\ 0\\ 0\end{bmatrix},\\\\
[Dp_2] & = [D(x)] = [1] = [1 \cdot 1 + 0x + 0x^2] = \begin{bmatrix} 1\\ 0\\ 0\end{bmatrix},\\\\
[Dp_3] & = [D(x^2)] = [2x] = [0 \cdot 1 + 2x + 0x^2] = \begin{bmatrix} 0\\ 2\\ 0\end{bmatrix}, \mbox{ and}\\\\
[Dp_4] & = [D(x^3)] = [3x^2] = [0 \cdot 1 + 0x + 3x^2] = \begin{bmatrix} 0\\ 0\\ 3\end{bmatrix}.
\end{align}$$
Thus, the matrix of $D$ is
$$\begin{bmatrix}
0 & 1 & 0 & 0\\
0 & 0 & 2 & 0\\
0 & 0 & 0 & 3\end{bmatrix}.$$
If you go through the same procedure for $D \circ I,$ you find that the matrix of $D \circ I$ is
$$\begin{bmatrix}
1 & 0 & 0\\
0 & 1 & 0\\
0 & 0 & 1\end{bmatrix},$$
although if you see that $D \circ I$ is the identity operator on $W,$ you can skip straight to that answer.