2x^2(x+3) + 4x(x+3)^2
Their method of factoring is as follows:
If what you've posted is the complete worked solution, then I'd say it's no wonder you're confused! After the initial expression, they should have provided the first
step in the solution:
. . . . .
Between the first and second line in their solution, they probably should have shown the step were the 2 inside the square brackets is multiplied through the x + 3, so the simplification inside the square brackets makes more sense. After that, though, they've pretty much shown what's needed.