[This question](https://mathoverflow.net/questions/190920/any-two-bivariate-algebraically-dependent-polynomials-are-always-in-the-same-rin?noredirect=1&lq=1) asks: If $f,g \in k[x,y]$ are two algebraically dependent polynomials over an arbitrary field $k$, is it true that there exists a polynomial $h \in k[x,y]$ such that $f,g \in k[h]$,
namely, $f=u(h)$ and $g=v(h)$ for some $u(t),v(t) \in k[t]$;
the answer is positive.



> 
> Is it possible to replace the field $k$ by an integral domain $D$?
>  Namely: If $f,g \in D[x,y]$ are two algebraically dependent polynomials over an arbitrary integral domain $D$, is it true that there exists a polynomial $h \in D[x,y]$ such that $f,g \in D[h]$?
> 
> 
> 


Denote the field of fractions of $D$ by $Q(D)$.
It is clear that if $f,g \in D[x,y] \subset Q(D)[x,y]$ are two algebraically dependent polynomials over $D$, then from the above question there exists a polynomial $h \in Q(D)[x,y]$ such that $f,g \in Q(D)[h]$,
namely, $f=u(h)$ and $g=v(h)$ for some $u(t),v(t) \in Q(D)[t]$.


I do not see why, for example, $D[x][y] \ni f=u(h)=u\_mh^m+\cdots+u\_1h+u\_0$ should imply that $h \in D[x,y]$ and $u\_j \in D$
(changing variables does not seem to help, namely if the leading term is $cy^l$,
with $c \in Q(D)$).


Any comments are welcome.



If $f,g \in D[x,y]$ are algebraically dependent over $D$, then $f,g \in D[h]$ for some $h\in D[x,y]$?
No. Choose a field $k$ and $D=k[u^2,u^3,v^2,v^3,uv]\subset k[u,v]$, so $D$ is a noetherian domain. In $D[x,y]$, choose $f=(ux+vy)^2$ and $g=(ux+vy)^3$; they are clearly algebraically dependent (but $ux+vy\notin D[x,y]$). Write $K=k(u,v)=\mathrm{Frac}(D)$.



> 
> Claim: there is no $P\in D[x,y]$ such that $f,g\in D[P]$.
> 
> 
> 


By contradiction, let $P\in D[x,y]$ such that $f,g\in D[P]$. So $f=r\_1(P)$, $g=r\_2(P)$ with $r\_1,r\_2\in D[t]$. Since $f^3=g^2$ and $K[t]$ is a UFD, there exists $r\in K[t]$ such that $r\_1=r^2$ and $r\_2=r^3$. So $r(P)^2=f$. So $r(P)=\pm (ux+vy)$; up to change $(u,v)$ to $(-u,-v)$, let us suppose $r(P)=ux+vy$. This implies that $r\in K[t]$ and $P\in K[x,y]$ have degree 1. Write $r=at+b$ and $P=cx+dy+e$; then $r(P)=acx+ady+ae+b=ux+vy$. So $ac=u$, $ad=v$, $ae+b=0$.


So $c,d$ are nonzero; then $c/d=u/v$, hence $cv=du$. Since $c,d\in k[u,v]$, we can write $c=uq$ and $d=vq$ with $q\in k[u,v]$. We have $aq=1$. Since $r^2\in D[t]$, we have $a^2\in D\subset k[u,v]$. So $a^2$ is invertible in $k[u,v]$, and hence $a\in k^\*$. So $u=a^{-1}c\in D$, a contradiction.


