Constants in localizations of a differential ring Fix a commutative ring $A$, a derivation $\partial_A$ on $A$, and a multiplicative set $S$ in $A$. Then let $B = S^{-1}A$, $f : A \to B$ be the natural map, and $\partial_B$ be the natural extension of $\partial_A$ to $B$. We of course always have 
$$f(\ker \partial_A) \subseteq \ker \partial_B.$$
Broadly speaking, under what situations can we guarantee that this an equality? 
Here are some observations. 


*

*If $A$ is a field, there's of course nothing to do.

*If $A$ is of positive characteristic $p$, there will likely be problems (even if $A$ is a domain). For example, if we take $A = \mathbb{F}_p[t]$ with $\partial_A$ being differentiation with respect to $t$, then $\ker \partial_A = \mathbb{F}_p[t^p]$. If we let $B = \mathrm{Frac}(A) = \mathbb{F}_p(t)$, then $\ker \partial_B = \mathbb{F}_p(t^p)$, which is of course strictly larger. 

*If $A$ is not a domain, there will likely be problems (even in characteristic 0). For example, let $A$ be the ring of smooth functions $\mathbb{R} \to \mathbb{R}$ with $\partial_A$ being usual differentiation. Then $\ker \partial_A = \mathbb{R}$. Moreover, we know that there exist $f, g \in A$ such that the Wronskian $W(f,g) = fg' - f'g = 0$ despite the fact that $f$ and $g$ are $\mathbb{R}$-linearly independent. (An explicit example of such a pair can be found in Bôcher's note from 1900 "On linear dependence of functions of one variable.") So, if we let $S$ be the multiplicative subset generated by $g$, note that $$\partial_B(f/g) = -W(f,g)/g^2 = 0,$$ so $f/g \in \ker \partial_B$ but it is not in $f(\ker \partial_A) = \mathbb{R}$ since $f$ and $g$ are $\mathbb{R}$-linearly independent.

*The subring of constants in a differential field is itself necessarily a field. So, if $A$ is a domain and $B = \mathrm{Frac}(A)$, we know that $\ker \partial_B$ must be a field, so there will be problems if $\ker \partial_A$ is not already a field. For example, let $A = \mathbb{Q}[x,y]$ and $\partial_A$ is differentiation with respect to $y$, so that $\ker \partial_A = \mathbb{Q}[x]$. Taking $B = \mathrm{Frac}(A) = \mathbb{Q}(x,y)$, we get $\ker \partial_B = \mathbb{Q}(x)$.


So... putting together these observations...


*

*Do we have equality when $A$ is a domain such that $\ker \partial_A$ is a field of characteristic 0? (When $A$ is a domain, we may as well assume that $B = \mathrm{Frac}(A)$.)

*If the above conditions aren't sufficient, are there any further (non-tautological) conditions we can impose on $A$ and $\partial_A$ to guarantee equality?


In addition to these specific questions, I'd love to hear anything people have to say about the broad question above also (whether that be in the form of general statements or fun counterexamples).
 A: The answer to your first question is no. Let $\mathbb{C}$ be the field of complex numbers. Take the derivation $D = x\partial_x+y\partial_y$ of $\mathbb{C}[x,y]$. Then $D(x/y) = 0$. Actually, there are many vector fields, of any degree you choose, with rational first integrals, which is what $x/y$ is with 
respect to $D$. In the language of differential equations your second question asks for conditions under which a given vector field doesn't have rational first integrals. I don't think any such conditions are known even for the ring of polynomials in several variables. However, it is true for generic vector fields in $\mathbb{C}[x_1, \ldots, x_n]$, for example. Let me explain what I mean by generic. To a vector field $D = \sum_{i=1}^n a_i\partial_{x_i}$ we can associate the $n$-tuple $(a_1,\ldots, a_n) \in S_k^n$, where $S_k$ is the set of polynomials of degree less than or equal to $k$ in $\mathbb{C}[x_1, \ldots, x_n]$. To say that a condition holds generically, means that the set of points $(a_1, \ldots , a_n) \in S_k^n$ where it holds is not contained in a countable union of hypersurfaces of $S_k^n$. I should probably explain what I mean by hypersurface in this context. In order to do this we identify $S_k$ with $\mathbb{C}^n$, using the basis $x_1^{j_1} \ldots x_n^{j_n}$, with $j_1+ \ldots + j_n \leq k$. A hypersurface of $S_k \cong \mathbb{C}^{nk}$ is the set of zeros of a non-constant polynomial $F(z_1, \ldots , z_{nk})$. So the result is that if $k \geq 2$, the set of $(a_1,\ldots, a_n) \in S_k^n$ for which $D = \sum_{i=1}^n a_i\partial_{x_i}$ does not  have a rational first integral is not contained in a countable union of hypersurfaces of $S_k^n$. Actually the result can be made stronger than this. Here are some books and papers where you can learn more about this stuff. 


*

*Alain Goriely,  Integrability and nonintegrability of dynamical systems, World Scientific 
This is an excellent survey of the whole area. Although it covers an awful lot (from both an algebraic and an analytic point of view) it states many results without proof. It may be a good place to find out what are the various approaches to the problem of finding first integrals to ODEs.

*G. Chèze, Décomposition et intégrales premières rationnelles: algorithmes et complexité, available at https://www.math.univ-toulouse.fr/~cheze/Enseignements.html 
This is a very nicely written and fairly elementary set of notes on the problem of finding rational first integrals to ODEs.  His is a mostly algebraic approach. It is probably the best place to find out what is known and what is not known about this problem.

*F. Cano, D. Cerveau and J. Desertie, Théorie élémentaire des feuilletages holomorphes singuliers, Belin.
This is a textbook on the theory of holomorphic foliations, which provides a geometric approach to the problem of finding first integrals to holomorphic ordinary differential equations. It is a lot more advanced than both Goriely's book and Chéze's notes, but it gives complete proofs of almost everything.
A: Proposition 3.1 in https://arxiv.org/pdf/1304.7663v2.pdf shows that the desired equality is true when $A$ is a differentially simple $\mathbb{Q}$-algebra. This doesn't fully answer the question I posted in full generality, but I think this is enough for me. 
A: Not a definitive answer but some considerations that could help refine the question. 
In fact, we have more that 
$$
N_1=f(\ker \partial_A) \subseteq \ker \partial_B\ .
$$
In general, we have,
$$
N_2=f(S\cap \ker(\partial_A))^{-1}.f(\ker \partial_A) \subseteq 
\ker(\partial_B)=N_3\ .
$$
and this is exactly what occurs in your example with $A=\mathbb{F}_p[t]$. This proves that there are algebras of any characteristics where $N_3=N_2$ (not only $\mathbb{Q}$-algebras). As regards the last example of the MO ($A=\mathbb{Q}[x,y]$) formula $N_2=N_3$ holds also.
So I think the question could be:

Question Give examples, counter-examples and, possibly general statements (chthonian ref is one step in that direction) about the statement "$f(S\cap \ker(\partial_A))^{-1}.f(\ker \partial_A) =  
\ker(\partial_B)$"

Related, but slightly different here.
