The quadratic factor can be obtained by long division, synthetic division, or the “have and need” method, which we will use here.
The first term of the quadratic factor must be \(x^2\) to obtain the \(x^3\) and the last term must be \(25\) to obtain the \(-125\).
Expanding what we have so far,
Have: \(x^3-5x^2+25x-125\)
Need: \(5x^2-25x\) \(=5x(x-5)\)
Hence, the middle term must be \(5x\).