completesquare



I was wondering if there's a built in maxima function to compute the  
completesquare of a quadratic expression .Is there one?

Example  :  x^2-2*x+2 ? (x-1)^2+1


Thanks a lot for your solution.

Regards,

Jos? Simons