Remember that 5x^25x2 is the result of "first times first" multiplication, 18x18x is the sum of "outside times outside" and "inside times inside" multiplications, and -35−35 is the result of "last times last" multiplication.
To begin, think about the factor pairs whose product is 3535.
1*351⋅35 and 5*75⋅7 are the only options.
Now consider the factor pair whose product is 35x^235x2.
1x*5x1x⋅5x is the only one.
We know that the two "first" terms in the factorization will be 1x1x and 5x5x. We can easily discard 1*351⋅35 as the factor pair to obtain the product of 3535, because of the large sums that would result from adding the outside & inside products.
Therefore we must decide on the proper placement of the 55 and 77, along with one ++ and one -− & the effect of the 5x5x, to get the outside & inside sum of 18x18x.
(x + 7)(5x - 5)(x+7)(5x−5) does not work, because the "outside times outside" multiplication results in -5x−5x & the "inside times inside" multiplication results in 35x35x. The sum of these two products is 30x30x. Try again.
(x + 5)(5x - 7)(x+5)(5x−7) works. Do FOIL to verify:
(x + 5)(5x - 7)(x+5)(5x−7)
5x^2 - 7x + 25x - 355x2−7x+25x−35
5x^2 + 18x - 355x2+18x−35
This verifies that the correct factorization is
(x + 5)(5x - 7)(x+5)(5x−7).