Let $F$ be a field. Let's suppose we have this ring $$F\langle x,y\rangle$$ when $xy\neq yx$ and the elements take this form $$p\langle x,y\rangle=\sum_{i=1}^n c_i$$ where $c_i=x^{a_{1i}} y^{b_{1i}} x^{a_{2i}} y^{b_{2i}}\cdots x^{a_{m_i i}}y^{b_{m_i i}}$ (The length of the monomial and the exponents both depend on $i$).
I defined this function $\varphi:F\langle x,y\rangle\to F[x,y]$ in these monomials ($c_i$):
$$\varphi(c_i)=x^{\sum a_{ki}}y^{\sum b_{ki}}$$ (which means that I count the number of $x$s and $y$s and "group" them) and extend it as $$\varphi\left(\sum_{i=1}^n c_i\right)=\sum_{i=1}^n \varphi(c_i)$$ for any polynomial. Let's suppose it's a $F-algebra$ homomorphism. It's obvious that it's surjective. I want to prove that $\ker \varphi=\langle xy-yx\rangle$. It's clear that for a multiple of $xy-yx$, $$\varphi(p(xy-yx))=\varphi(p)\varphi(xy-yx)=\varphi(p)(xy-xy)=\varphi(p)0=0$$ So $\langle xy-yx\rangle \subseteq \ker\varphi$. How can I prove the reverse inclusion?
The algebra $F\langle x,y\rangle$ is the free $F$-algebra on two elements, whereas $F[x,y]$ is the free commutative $F$-algebra on two elements.
Let $I = \langle xy-yx\rangle$. You can show that $F\langle x,y\rangle /I$ has the universal property of $F[x,y]$ : if $A$ is commutative and $a,b\in A$, then there is a unique morphism $F\langle x,y\rangle\rightarrow A$ sending $x$ to $a$ and $y$ to $b$, and it necessarily factors through $I$.
So there is a unique $F$-algebra isomorphism from $F\langle x,y\rangle/I$ to $F[x,y]$ sending $x$ to $x$ and $y$ to $y$ : this is your morphism, since any morphism from $F\langle x,y\rangle$ is uniquely determined by the image of $x$ and $y$.