##f(x)=x^3-5x^2+x-5##
I have assumed that ##{5i-i}## are intended to be the of the function.
In this case the function can be factored as:
##color(white)(XXX)(x-5)((x-i)(x+i)##
##color(white)(XXX)=(x-5)(x^2-i^2)##
##color(white)(XXX)=(x-5)(x^2+1)##
##color(white)(XXX)=x^3+x -5x^x-5##
(or in standard polynomial form)
##color(white)(XXX)=x^3-5x^2+x-5##