Note the first line has two terms with the common factor $\color{red}{(6x^4+x)^3}$ ...
$15x^4 \cdot \color{red}{(6x^4+x)^3} \cdot (6x^4+x) + 12x^5 \cdot \color{red}{(6x^4+x)^3} \cdot (24x^3+1)$
pull out the common factor ...
$\color{red}{(6x^4+x)^3} \bigg[15x^4(6x^4+x) + 12x^5(24x^3+1) \bigg]$
distribute the $12x^5$ inside the brackets to arrive at the second line in the image ...