Hi, I have the following problem that is solved, but I have no clue what formula the teacher uses to solve it... Thanks a lot for your help!

I have:

Which is equal to

And the coefficient of (and the main thing I don't understand how the teacher gets it) is