Question of category of rings How to verify that $\mathbb{Z}[x_1, x_2],$ with the evident morphisms satisfies the universal property for the coproduct of two copies of $\mathbb{Z}[x]$ in the category of commutative rings. Further why it does not satisfy it in the category of Rings.
 A: Let $R$ be a commutative ring. Let $r,s \in R$.
By the universal property of polynomial rings, there exist unique ring homomorphisms $f:\mathbb Z[x] \to R$ sending $x$ to $r$ and $g:\mathbb Z[y] \to R$ sending $y$ to $s$. (Remember that since $\mathbb Z$ is initial in rings, we have $f|_{\mathbb Z} = g|_{\mathbb Z}$.)
Let $\iota_x: \mathbb Z[x] \to \mathbb Z[x,y]$ and $\iota_y: \mathbb Z[y] \to \mathbb Z[x,y]$ be the natural inclusions.
Then there exists a ring homomorphism $\varphi: \mathbb Z[x,y] \to R$ sending $x$ to $r$ and $y$ to $s$, uniquely determined by $f$ and $g$:
$$\varphi\left(\sum m_{i, j}x^i y^j\right)=\sum f(m_{i,j})f(x)^i g(y)^j=\sum f(m_{i,j})r^i s^j.$$
So, $\mathbb Z[x,y]$ satisfies the universal property for the coproduct of $\mathbb Z[x]$ and $\mathbb Z[y]$ in the category of commutative rings.

If $R$ is not commutative, then there exists $r$ and $s$ in $R$ which do not commute. Therefore, the ring homomorphisms $f$ and $g$ above will be a counterexample to $(i_x, i_y, \mathbb Z[x,y])$ being initial.
A: Using the yoneda lemma
$$\begin{align}
\mathbf{CRing}(\mathbb{Z}[x] \amalg \mathbb{Z}[y], R) &\cong \mathbf{CRing}(\mathbb{Z}[x], R) \times \mathbf{CRing}(\mathbb{Z}[y], R)
\\&\cong R \times R \cong R^2
\\&\cong \mathbf{CRing}(\mathbb{Z}[x,y] , R)
\end{align}$$
So the yoneda lemma says $\mathbb{Z}[x] \amalg \mathbb{Z}[y] \cong \mathbb{Z}[x,y]$.
Using free rings
If $F$ is the free ring functor, then
$$ \mathbb{Z}[x,y] \cong F(\{x, y \}) \cong F(\{x\} \amalg \{y\}) \cong F(\{x\}) \amalg F(\{y\}) \cong \mathbb{Z}[x] \amalg \mathbb{Z}[y] $$
The free ring functor preserves coproducts (in fact, all colimits) because it is a left adjoint. (its right adjoint is the forgetful functor that sends a ring to its set of elements)
Noncommutative rings
For noncomutative rings, the problem is that
$$\mathbf{Ring}(\mathbb{Z}[x,y], R) \cong \left\{ (a,b) \in R^2 \mid ab = ba \right\} $$
or equivalently,
$$ \mathbb{Z}[x,y] \cong F(\{x,y\}) / \langle xy - yx \rangle $$
