Use logarithmic differentiation to find the derivative of the following equation.

in the home work i was doing it was a multiple choice question, and i ended up getting it right, but i'm not exactly sure how to get from the question to the answer

i worked out the problem and got everything in this answer except for the part, and i don't know where it came from in the derivative formulas that i have.

I'm asking in case there is a question like this on the test and i'll have no idea how to do it correctly.