If $L$ is a Lie algebra in ${\rm gl}\ (n,{\bf R})$ then $$\ast\ {\rm tr}\ {\rm ad}\ z =0$$ for $z$ in commutator ideal $L'$
This is followed from matrix expression. But in 2.5 exercise in Erdmann and Wildon's book, there exists no condition on $L$.
In this case how can we prove $\ast$ ?
It suffices to show the case when $z = [x, y]$ for some $x, y\in L$. So
$$ad_z = ad_{[x, y]} = ad_xad_y - ad_yad_x \Rightarrow \text{tr} \ ad_z = 0\ .$$