How do you solve this?

Note that 125 = 5³. Make use of the factorization of the sum of cubes:
a³ +b³ = (a+b)(a² -ab +b²) . . . . . . a formula worth keeping handy
Then ...
[tex]\dfrac{x^3+5^3}{x+5}=\dfrac{(x+5)(x^2-5x+5^2)}{x+5}=x^2-5x+25[/tex]
_____
When x=-5, this evaluates to
... (-5)²-5(-5) +25 = 75
[tex] \dfrac{x^3+125}{x+5}=\dfrac{(x+5)(x^2-5x+25)}{x+5}=x^2-5x+25\\\\
(-5)^2-5\cdot(-5)+25=25+25+25=75 [/tex]