Question: How do I factor a simple quadratic equation?

OK, what am I doing wrong here?

This polynomial can be factored by almost anyone who knows algebra:

factor(x^2+y^2+2*xy);

but Maple refuses:

 x2  + y2  + 2 xy

but if I pose the question this way:

ans := expand((x+y)^2);

factor(ans);

(x + y)2

I get the expected result.  What is wrong with how I am using the factor?

Please Wait...