factor (x**2+4*x*y+4*y**2)

solve((x + 2*y)**2, x)

diff((x + 2*y)**2, x)

series((x + 2*y)**2, x, 0, 10)

Want to compute something more complicated? Try a full Python/SymPy console at SymPy Live.