Formal Differentiation and Evaluation of Polynomials Let $R$ be a commutative ring and consider the ring of polynomials $R[x]$. Let $D:R[x]\to R[x]$ be the formal derivative. For any element $a\in R$ we also have an evaluation homomorphism $\varphi_a:R[x]\to R$ defined by $\varphi_a f=$ "$f(a)$".
Suppose we have polynomials $f(x),g(x)\in R[x]$ satisfying $\varphi_a f=\varphi_a g$ for all $a\in R$. In this case do we also have $$\varphi_a Df=\varphi_a Dg \quad \text{for all $a\in R$}?$$
I am looking for a discussion at the undergraduate level. It is difficult to find material on formal differentiation in undergraduate textbooks; my web searches only turn up advanced treatments in terms of K"ahler differentials.
Edit: A commenter points out that this is false for finite fields. So let's assume that $R$ is a field of characteristic zero (or maybe just an infinite domain).
Another Edit: Here is a proof when $R$ is an infinite domain. Let $f(x)=\sum_k a_kx^k$ and $g(x)=\sum_k b_kx^k$. If $\varphi_a f=\varphi_a g$ for all $a$ then since $\varphi_a$ is a homomorphism we have $\varphi_a(f-g)=0$, which says that $f(x)-g(x)$ has infinitely many roots. By Descartes' factor theorem this implies that $f(x)-g(x)$ is identically the zero polynomial, hence $a_k=b_k$ for all $k\in\mathbb{Z}_\geq 0$. But then $ka_k=kb_k$ for all $k\in\mathbb{Z}_{\geq 0}$, which implies that $Df$ and $Dg$ have the same coefficients as well. I was hoping to avoid Descartes' factor theorem and instead formalize the proof from calculus that polynomials defining the same function must have the same coefficients, i.e., substitute $x=0$ into the repeated derivatives.
 A: No this is not the case. Take $R=\mathbb{F}_2$ the field with $2$ elements. Let $f=1+x$ and $g=1+x^2$. Then $\varphi_0 f=1=\varphi_0 g$ and $\varphi_1 f=0=\varphi_1 g$. On the other hand, we have $Df=1$ and $Dg=0$, so $\varphi_a Df\neq \varphi_a Dg$ for all $a\in R$.
A: So let's think carefully about what happens in ordinary calculus. Over the real numbers, if $f(a) = g(a)$ for all $a \in \mathbb{R}$ then
$$f'(a) = \lim_{h \to 0} \frac{f(a + h) - f(a)}{h} = \lim_{h \to 0} \frac{g(a + h) - g(a)}{h} = g'(a).$$
In other words, what makes the argument over $\mathbb{R}$ work is that the values of the derivative $f'(a)$ are defined directly in terms of the values of $f(a)$. Is there any hope that we can salvage this argument in general?
The above definition does have an analogue for the formal derivative: if $f(x) \in R[x]$ then the formal derivative, which I will continue to denote by $f'(x)$, can be defined via
$$f(x + \varepsilon) = f(x) + \varepsilon f'(x)$$
where this computation takes place in $R[x, \varepsilon]/\varepsilon^2$. However, the above argument does not generalize, because the assumption that $f(a) = g(a)$ for all $a \in R$ does not automatically imply that $f(a + \varepsilon) = g(a + \varepsilon)$ for $a + \varepsilon \in R[\varepsilon]/\varepsilon^2$, which is a larger and different ring. It can be salvaged by making a stronger assumption about the two polynomials, namely that $f(a) = g(a)$ for all elements $a$ in every commutative $R$-algebra $S$; but of course this assumption straightforwardly implies that $f = g$ identically, by taking $S = R[x], a = x$.
So, I don't know how to avoid the factor theorem here without making a stronger assumption about the polynomials. The general lesson of working over more general base rings, especially finite fields, is that polynomials over $R$ are not always determined by their values on $R$ unless you allow inputs in extensions of $R$.
