I'm studying for a PhD preliminary exam, and it seems I have some holes in my linear algebra knowledge. I need help with the following problem:

Let A and B be operators V -> V, where V is a finite-dimensional vector space over the complex numbers. Let p be any polynomial such that p(AB) = 0. Then (a) Prove that that q(x) = xp(x) satisfies q(BA) = 0.

Interestingly, I have shown that this problem is equivalent to proving that the minimal polynomial of AB is equal to the minimal polynomial of BA. Therefore, a direct solution to this problem would be to directly show that q(BA) = 0 whereas, given what I've already shown, it would suffice to simply prove that the minimal polynomials of BA and AB are equal. I am interested to a solution of either kind (ideally both!)

Thanks!