# How can I find all polynomials that fit an equation?

How can I ask Mathematica to find all polynomial $$f \!$$s such that, for a constant $$k$$:

$$f(x) \ f(y) = f(x) + f(y) + f(xy) + k$$

I've solved it on paper and want to check my results. I've tried the following, none of which work:

• Solve[f[x] f[y] == f[x] + f[y] + f[x y] + k, f]
• Solve[f[x] f[y] == f[x] + f[y] + f[x y] + k, f[x]]
• Solve[f[x] f[y] == f[x] + f[y] + f[x y] + k, f[z]]
• Reduce[f[x] f[y] == f[x] + f[y] + f[x y] + k, f]
• f[x_] := Sum[Subscript[c, i] x^i, {i, 0, n}]; Solve[f[x] f[y] == f[x] + f[y] + f[x y] + k, Subscript[c, 0]]
• Take a look at this quite analogous problem: Solving functional equations in Mathematica Commented Feb 20, 2020 at 2:20
• I would consider polynomials of increasing degree, and write them in terms of their coefficients. Then solve for the coefficients Commented Feb 20, 2020 at 6:50

It is better to use SolveAlways and to consider a specific value of n. Here is $$n=4$$:
f[x_] := Sum[Subscript[c, i] x^i, {i, 0, 4}]