Assume $f\in k[x\_1,\ldots, x\_n]$ is irreducible. Let for $g\in k[x\_1,\ldots, x\_n]$, $\partial(g)$ is divisible by $f$ for each derivation $\partial$ with $f\in\ker\partial$. Is it true that $g-t$ is divisible by $f$ for some $t\in k$?



Is it true that $g-t$ is divisible by $f$?
Consider the map $g:X\to\mathbb{A}^1$, where $X$ is defined by $f=0$ in $\mathbb{A}^n$. Your condition implies $dg=0$ and thus this map must be constant. This is what you wanted to prove.


