y=5x³-125x=5x(x²-25)=5x(x-5)(x+5).
Before you can apply the diamond and rectangle method you have to make sure you have a quadratic. This is a cubic because the highest power of x is 3.
So we must find out if we can reduce it to a quadratic by looking for a common factor. In this case 5x is common to both terms, so take 5x outside the parentheses and put the quadratic inside the parentheses:
5x(x²-25). The quadratic is the cubic divided by 5x.
The quadratic must have 3 terms, not two, so insert 0x:
x²+0x-25. Now you can apply the diamond and rectangle method.
The rectangle is divided into 4 boxes and in one box we put in the squared term x² and in the box diagonally opposite we put in the constant -25.
Now we need to list the factors of -25 in pairs. So we have 25 and -1, 1 and 25, 5 and -5, -5 and 5. We need those factors that add up to the x term, which is zero. So, no problem, because 5+(-5)=0. Put these in the remaining two boxes as 5x and -5x. Note that if multiply the diagonal boxes we get the same value:
x² times -25 is the same value as 5x times -5x.
Outside the rectangle we write the greatest common factor of the row and column. So we have x+5 and x-5 as the factors. Job done!