kill(all)$

van=facebook.com/LearningCalculus$

y(x):=((x+a)*(x+b));

dydx:diff(y(x),x)=0;

x[0]:rhs(first(solve(dydx,x)));

y[0]:y(x[0]);

[x[0],y[0]];

fullratsimp(%);

factor(%);

subst(r*sin(theta),b,%)$
subst(r*cos(theta),a,%);

c:(a+b)/2;

(x+c)*(x+c);

subst(r*sin(theta),b,%)$
subst(r*cos(theta),a,%);