Can someone explain how greg factored in Homework session 8? I included a picture too

Factored what exactly?