Suppose $L$ is a Lie Algebra and $x \in L'=\left[L,L\right]$. As a homework problem, I need to show that $\operatorname{tr}(\operatorname{ad} \, x)=0$. I assumed $\dim(L)<\infty$ (not sure if this is necessary) and tried explicitly computing $\operatorname{tr}(\operatorname{ad} \, x)$. I expressed $x$ as a linear combination of commutators, expanded the brackets in terms of structure coefficients, and ended up with a very nasty sum.
There must be a better way to do this. Hints?
There is a much simpler way indeed. As you perceived, it suffices to show that ${\sf tr}({\sf ad}(w))=0$ when $w$ is a commutator $[x,y]$ . The Jacobi identity implies that
$$ {\sf ad}([x,y])=[{\sf ad} (x),{\sf ad} (y)] $$
and now the bracket on the right can be interpreted as $ab-ba$ where $a={\sf ad} (x)$ and $b={\sf ad} (y)$. Now, ${\sf tr}(ab)={\sf tr}(ba)$ is pure linear algebra and does not need anything about Lie algebras.