factor (x**2+4*x*y+4*y**2)
solve((x + 2*y)**2, y)
diff((x + 2*y)**2, y)
series((x + 2*y)**2, y, 0, 10)
Experiment with SymPy at SymPy Live.