# Compute equalizer of maps of polynomial rings, perhaps using Gröbner bases

Suppose that $k$ is a field and I have two ring homomorphisms $$\phi, \psi :k[x_1,...,x_m] \to k[y_1,...,y_n].$$ How can I use Gröbner bases (or other computational tools) to compute the subring of elements $a$ such that $f(a)=g(a)$?

• I intend to apply this in the case $k[x_1, ..., x_m] \to k[x_1, ..., x_m, z_1, ..., z_q]$ where $\psi$ is the obvious inclusion, and $\phi$ is some other algebra homomorphism (not linear, not degree-preserving).
• If it matters, let's assume that $k$ has positive characteristic.