kill(all)$

van=facebook.com/LearningCalculus$

f(x,a):=(1+a)*x^2 - 3*a*x + 4*a$

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

A: rhs(first(solve(rhs(first(s))=rhs(second(s)),a)));

crit_x:rhs(first(solve(diff(f(x,a),x)=0,x)));

crit_y:factor(f(crit_x,a));