So how you get to the numbers inside the X you use the numbers from the problem.
To get the top number in the X you do 7x^2*-20 that’s how the -140x^2 came
Than the bottom is just the middle number which is -31x.
For te side numbers they have to be something when multiplied together you get the top number but also when you add them together you get the bottom. And -35x*4x gives you -140x^2. And -35x+4x gives you -31x.
Then for the box it looks like she put the numbers/letter you multiply to be able to get the answers. 7x*x. Gives you 7x^2. And 7x*-5 gives you -35x. So on...