I think I figured it out. It looks like they factored, which I didn't do, but it gives the same answer.
I have a homework problem similar to this, but I was unsure about the example in the book:
The solution steps are as follows:
I get a little lost during the second step, and where did that 6 come from?
This uses the Product and Chain Rule.
Notice the derivative of is . Now you get the six because your bring down the exponent (which is three) and multiply by the derivative of the inside (which is two) thus you get 6.
Similarly the derivative of is .
Now by the product rule,
and already found in the last paragraph. Thus,