Substitute or subtract?
I'm guessing you mean subtract
essentially you are just subtracting the like terms
-5r^2 subtract 7r^2 is -12r^2
5r subtract nothing because there is not an r to the first power in the second polynomial.
4 subtract 4 is 0
Put it all together and you get
-12r^2+5r
It might be more proper to list the positive term first
5r - 12r^2
either way would be correct.