kill(all);

van=facebook.com/LearningCalculus$

f(x):=x^2+a*x+b$
g(x):=x^2+b*x+a$

solve(f(x),x);
solve(g(x),x);

X:rhs(first(solve(f(x)=g(x),x)));

[X,f(X)];