I have tried to undersatnd how this step works, it shows a rather messy equation on the top line. Then the line below is one step taken to simplfy. But I can't quite figure out what has happend.
If anyone could shed some light on this it would be extremely helpful.

In the above expression, you have a confusing expression:
$$36x\left(9x^2+3\right)\left(2x-8\right)-2\left(9x^2+3\right)^2$$
One way to see what happened is to simplify it by letting $y=9x^2+3$, and let $z=2x-8$ then substitute to get:
$$36x(y)(z)-2(y^{2})$$
We did the above step to be able to "see" the factors clearly.
Now, factor out $(2y)$ to get:
$$(2y)(18xz-y)$$
At this point you could substitute back the $y$ and $z$ to get the result.