# How do I find the constant term of a multivariate polynomial?

So let's say f[x_, y_] := (2 x + 2 y + 1)^2, when I type Coefficient[f[x, y], x y] I receive 8. But what can I input to receive 1, when (x^0) (y^0)? Thanks!

• Look up CoefficientArrays[]. May 21 '15 at 19:44

Pardon me if I misunderstand your request.

{0, 0} /. CoefficientRules[f[x, y], {x, y}]

1

Fold[Coefficient[##, 0] &, f[x, y], {x, y}]

1

CoefficientList[f[x, y], {x, y}][[1, 1]]

1


Or far more elegantly in this case as J.M. recommends in a comment:

f[0, 0]

1

• Thank you! This answered my question May 21 '15 at 19:54
• In fact, since it's a polynomial, even the humble f[0, 0] works nicely. May 21 '15 at 19:58
• You're right, I don't know why I never thought about that May 21 '15 at 20:00
• @J. M. Now I feel foolish. :-( May 21 '15 at 21:08
• Not too late to edit, Wiz. ;) May 21 '15 at 21:13