The following question I have asked in MSE, but have not received an answer, so I ask it here; I really apologize if it is not suitable for MO.
Let $k$ be a field of characteristic zero and let $R_1,R_2,S$ be three commutative $k$-algebras with $R_1 \subseteq S$ and $R_2 \subseteq S$. Assume that $S$ is flat over $R_1$ and also $S$ is flat over $R_2$.
Denote by $R$ the ring generated by $R_1$ and $R_2$. Of course, $R$ is a subring of $S$.
Are there conditions that will guarantee flatness of $S$ over $R$?
Example 1: $R_1=k[x], R_2=k[y], R=k[x,y], S=k[x,y,z]$; $k[x,y,z]$ is free over $k[x]$ and over $k[y]$, hence flat over $k[x]$ and over $k[y]$. Also, $k[x,y,z]$ is free over $k[x,y]$, so it is flat over $k[x,y]$.
However, generally $S$ may not be flat over $R$:
(Counter)example 2: $R_1=k[x^2]$, $R_2=k[x^3]$, $R=k[x^2,x^3]$, $S=k[x]$. Clearly, $k[x]$ is free over $k[x^2]$ and over $k[x^3]$, hence flat over $k[x^2]$ and over $k[x^3]$. But $k[x]$ is not flat over $k[x^2,x^3]$.
Notice the difference between the two examples: In the first example $R_1 \cap R_2 =k$, while in the second (counter)example $R_1 \cap R_2=k[x^6] \supsetneq k$.
Is there another counterexample, but this time with $R_1 \cap R_2=k$?
See also this relevant question about flatness over tensor products.
Thank you very much!