the images of the basis B under T are
T( ex) = ex
T( cos4x) = -16 cos4x
T(sin 4x) = -16 sin 4x
T(e3x) = 9 e3x
now, writing the images of the basis of the domain as the linear combinations of the basis of the codomain.
i.e. T(ex)= 1*ex +0*cos 4x +0* sin 4x + 0* e3x
T(cos4x) = 0* ex -16* cos 4x +0* sin 4x + 0*e3x
T( sin 4x) = 0*ex+0*cos4x-16*sin 4x + 0* e3x
T( e3x) = 0* e
x+ 0* cos 4x+0*sin 4x + 9 * e
3x
consider the coefficients of the linear combinations as a matrix.
transpose the matrix to give the representative matrix of the linear transformation with respect to the given basis.
i.e.

=[T]
B