The following question appears, more or less, [here](https://math.stackexchange.com/questions/3955627/flatness-of-a-subring-generated-by-two-subrings):


Let $k$ be an algebraically closed field of characteristic zero and let $S$ be a commutative $k$-algebra
(I do not mind to further assume that $S$ is an integral domain).


Let $R\_1,R\_2 \subseteq S$ be two (probably different) $k$-subalgebras of $S$ such that
$R\_i \subseteq S$, $1 \leq i \leq 2$ is:
finitely generated, flat and separable (in other words, $R\_i \subseteq S$ is etale).


Denote the $k$-algebra generated by $R\_1$ and $R\_2$ by $R$.



> 
> Is it true that $R \subseteq S$ is flat?
> 
> 
> 


Clearly, $R \subseteq S$ is finitely generated and separable (hence unramified). But what about flatness?
I guess (?) that there exists a counterexample in dimension two.


A non-counterexample: $R\_1=k[x^2], R\_2=k[x^3], S=k[x]$; here $R=k[x^2,x^3] \subseteq k[x]$ is not flat,
but also $R\_i \subseteq S$ are not separable (althouh they are finitely generated and free). See [this](https://mathoverflow.net/questions/371948/separability-of-mathbbcx-over-its-mathbbc-subalgebras) question, which explains that $k[x^2,x^3] \subseteq k[x]$ is not separable, hence $k[x^2] \subseteq k[x]$ and $k[x^3] \subseteq k[x]$ are not separable, since if at least one of them were, then $k[x^2,x^3] \subseteq k[x]$ was separable, by a result concerning separability).


Perhaps [this](https://math.stackexchange.com/questions/1328079/separability-implies-flatness-in-a-special-case) question is relevant.


Any hints and comments are welcome; thank you very much!



Flatness of certain subrings
This is again false. The geometric interpretation is as follows: write $Y = \operatorname{Spec} S$ and $X\_i = \operatorname{Spec} R\_i$. Given étale morphisms $f\_1 \colon Y \to X\_1$ and $f\_2 \colon Y \to X\_2$ of affine schemes, the image factorisation
$$R\_1 \underset k\otimes R\_2 \twoheadrightarrow R \hookrightarrow S$$
corresponds geometrically to taking the (scheme-theoretic) image $Y \to X \hookrightarrow X\_1 \times X\_2$ of the product map $f \colon Y \to X\_1 \times X\_2$. If $Y$ is smooth, then so are the $X\_i$, but $X$ need not be smooth. If $f$ is surjective, it cannot be flat when $X$ is singular [Tags [07NG](https://stacks.math.columbia.edu/tag/07NG) and [00HQ](https://stacks.math.columbia.edu/tag/00HQ)].


We can turn this around to make a counterexample: start with a map $f \colon Y \to X\_1 \times X\_2$ of smooth schemes such that the image is singular but both projections $f\_i \colon Y \to X\_i$ are étale.


**Example.** This is the typical picture of a plane nodal curve: let $Y\_0 = X\_1 = X\_2 = \mathbf A^1$, and consider the morphism $f \colon Y\_0 \to X\_1 \times X\_2$ given by $t \mapsto (t^2-1,t^3-t)$. The scheme-theoretic image is the nodal curve $X\_0 = V(y^2 - x^2(x+1))$, and the map $Y\_0 \to X\_0$ is surjective.


The projections $f\_i \colon Y\_0 \to X\_i$ are not étale, but they become so after removing the points $0$ and $\pm\tfrac{\sqrt 3}{3}$ from $Y\_0$. Let $Y \subseteq Y\_0$ (resp. $X \subseteq X\_0$) be the complement of these points (resp. their images in $X$). This gives the desired counterexample, since we did not remove the singular point $(0,0) = f(-1) = f(1)$ from $X$.


(This parametrisation is explained on [this page](https://www.math.purdue.edu/%7Earapura/graph/nodal.html) of Donu Arapura, which is literally the first result that my favourite search engine produces when I type 'nodal curve'.)


Translated back into algebra, this means $S = k\bigl[t,\tfrac{1}{t},\tfrac{1}{3t^2-1}\bigr]$, with $R\_1 = k[t^2-1] \subseteq S$ and $R\_2 = k[t^3-t] \subseteq S$.


