Constants in localized differential rings Fix a differential commutative ring $(A, d_A)$, and a multiplicative set $S$ in $A$. Suppose that $C_A = \{a \in A \mid d_A(a) = 0\}$. 
Let $B = S^{-1}A$ and transfer the derivation $d_A$ to $B$, namely by $d_B$ (first define formally, on $A\times S$, $\tilde{d}(a,q):=(d_A(a).q-a.d_A(q),q^2)$ and pass to the quotients to get $d_B$). Denote $C_B = \{b \in B \mid d_B(b) = 0\}$. 
For example, $A = \mathbb{Q}[x, y]$ and $d_A = \dfrac{d}{dx}$. Then $C_A = \mathbb{Q}[y]$. Nextly, we take $S = \mathbb{Q}[x, y] \setminus \{0\}$ then $B = Frac(A) = \mathbb{Q}(x,y)$. Moreover, $C_B = \mathbb{Q}(y) = Frac(\mathbb{Q}[y])$. 
I'd like to know the way to determinate $C_B$ in the general case. Is it $Frac(C_A)$ as in the above example ? 
And if it is not true, then when is this right ? Thank you so much for your hints.  
 A: Here are counterexamples taken as localizations within the ring smooth functions.
1) Let $A$ be the ring of smooth functions $\mathbb{R}\to \mathbb{R}$. Let us note $\mathcal{O}_f:=f^{-1}(0)$ the set of zeroes of $f$. One can prove the following
$$
f\mbox{ is a zero divisor in } A\Longleftrightarrow \mbox{ interior }(\mathcal{O}_f)\not=\emptyset. 
$$
Let $S$ be the set of functions s.t. $\mbox{ interior }(\mathcal{O}_f)=\emptyset$. It is a (multiplicative) monoid. The localized ring $S^{-1}A$ can be realized as the ring of germs of smooth functions $\mathbb{R}\to \mathbb{R}$ w.r.t. to the filter basis $\mathcal{B}$ of complements of closed subsets without interior
$$
\mathcal{B}=\{(\mathbb{R}\setminus F)\mid F \text{ is closed without interior}\}.
$$
In the ring of germs, every element of $g\in S$ can be inverted as $\frac{1}{g}$ is defined on $\mathbb{R}\setminus \mathcal{O}_g$. Let $B=S^{-1}A$ be the ring of germs, the arrow $A\to B$ is injective, the differential $d=\frac{d}{dx}$ can be transferred uniquely on $B$. One can check however that $\ker(d)$ is infinite dimensional on $\mathbb{R}$.    
2) Let us take 
$$
f(x)= 
  \begin{cases}
    \exp(-\frac {1}{x^2}), & \text{for } x\neq 0\\
    0 & \text{for } x=0 
  \end{cases}
$$
and 
$$
g(x)= 
  \begin{cases}
    sgn(x).\exp(-\frac {1}{x^2}), & \text{for } x\neq 0\\
    0 & \text{for } x=0 
  \end{cases}
$$
and consider $S=\{g^n\}_{n\geq 0}$. Now, as $g$ is not a zero divisor, 
the arrow $\varphi : A\to S^{-1}A=B$ is injective, $d_B(g^{-1}f)=0$ but $g^{-1}f\notin \varphi(S\cap \ker(d_A))^{-1}.\varphi(\ker(d_A))$.
