kill(all)$

van=facebook.com/LearningCalculus$

f(x):= x^2 + 7/x - 50;

s: solve(f(x),x);

g(x):=x^2+7*x+8;

g(rhs(s[1])); fullratsimp(%);
g(rhs(s[2])); fullratsimp(%);
g(rhs(s[3]));