Let $\mathscr{P}_n(\Bbb{R})$ denote the vector space of polynomials with degree $\le$ n... Let $\mathscr{P}_n(\Bbb{R})$ denote the vector space of polynomials with degree $\le$ n.
Define $$T:\mathscr{P}_3(\Bbb{R})\to \mathscr{P}_3(\Bbb{R})$$ by $$T(f(x)) = 2xf'(x) - 7f(x)$$
Compute the matrix of $T$ with respect to the basis $\mathscr{B} = \{1, x, x^2, x^3\}$.
Our professor told us that $T$ is a linear transformation but I do not understand why that is. As for actually computing the matrix of $T$ I know that you apply $T$ to the basis elements. (Plug in the $1, x, x^2, x^3$) to $T(f(x)) = 2xf'(x) - 7f(x)$. But I am lost as to how we do that. Does each element (the ($1, x, x^2, x^3$) become $f(x)$) or am I misunderstanding?
 A: You can simply check that $T(f+g) = T(f) + T(g)$ and $T(\lambda f) = \lambda T(f)$, where $\lambda \in \mathbb R$. To get the matrix with respect to the basis compute $T$ on basis vectors. For example, $T(1) = -7 = -7 \cdot 1,  T(x) = 2x -7x =-5x = -5 \cdot x$ etc., so your first column of the matrix will become $(-7,0,0,0)$ and the second $(0,-5,0,0)$.
A: First, let us verify that it is linear.  Namely, that $T(cf(x))=cT(f(x))$ and that $T(f(x)+g(x))=T(f(x))+T(g(x))$.  To make the job easier, we notice that $T$ is built out of components, each of which is linear:


*

*Multiplication by $x$ (which is a linear map from $P_n$ to $P_{n+1}$

*Differentiation with respect to $x$ (which is a linear map from $P_n$ to $P_{n-1}$

*Scalar multiplication

*Addition (adding two linear maps $A,B:V\to W$ gives a linear map $(A+B):V\to W$).


Because we are just composing linear operations or adding linear maps, everything overall will still be linear.  The only tricky bit is that differentiation lowers the degree and multiplication by $x$ raises it again, so which keeps us from leaving $P_3$ when we do the multiplication.
Let $D$ be the operator that differentiates with respect to $x$.  Since $xD(x^n)=nx^n$, $T$ will behave very well on monomials: if the degree is $n$, we just multiply by $2n-7$.
So, for example, $T(x^2)=-3x^2$.
So compute $T(x^n)$ for $n=0,1,2,3$, and write out the answers in terms of $x^n$ for $n=0,1,2,3$.  The coefficients will be the entries in the matrix you want. 
A: You should also check that T(af)= aT(f) or, putting the two together, that T(af+ bq)= aT(f)+ bT(f), to show that T is a linear operator.
As for writing a linear transformation as a matrix, in a given basis, apply the linear transformation to each basis vector, in turn, writing the result as a linear combination of the basis vectors.  The coefficients in those linear combination form the columns of the matrix.
Here, the linear transformation is T(f)= 2xf'- 7f.  The given basis vectors are 1, x, $x^2$, $x^3$.  So T(1)= 2x(0)- 7(1)= -7.  That can be written as a linear combination of the basis vectors as $-7(1)+0(x)+ 0(x^2)+ 0(x^3)$.  The first column of the matrix is $\begin{bmatrix}-7 \\ 0 \\ 0 \\ 0 \end{bmatrix}$.  T(x)= 2x(1)- 7(x)= -5x.  That can be written as $0(1)- 5(x)+ 0(x^2)+ 0(x^3)$.  The second column is $\begin{bmatrix} 0 \\ -5 \\ 0 \\ 0 \end{bmatrix}$.  $T(x^2)= 2x(2x)- 7(x^2)= 4x^2- 7x^2= -3x^2$.  That can be written $0(1)+0(x)+ -3(x^2)+ 0(x^3)$.   The third column is $\begin{bmatrix}0 \\ 0 \\ -3 \\ 0\end{bmatrix}$.  Finally, $T(x^3)= 2x(3x^2)- 7x^3= 6x^3- 7x^3= -4x^3$. That can be written $0(1)+0(x)+ 0(x^2)- 4(x^3)$ The fourth column is $\begin{bmatrix}0 \\ 0 \\ 0 \\ -4\end{bmatrix}$.  
The matrix representing this linear transformation, in this particular ordered basis is $\begin{bmatrix}-7 & 0 & 0 & 0 \\ 0 & -5 & 0 & 0 \\ 0 & 0 & -3 & 0 \\ 0 & 0 & 0 & -4\end{bmatrix}$.
