problem related to binomial theorem We know the there are many objects which do not commute. That is
$xy= yx.$
Consider two possible scenarios. The form
$xy—yx$
is called the commutator.
Suppose we have two objects whose commutator is $1$. That is
$xy — yx = 1$
In this case we like to write all the y terms before all the $x$ terms. The reason for this is because most of the time when we use functions we associate to the right, rather than the left.
In this situation, what is the new analog of the binomial theorem. For example:
$(x + y)^2 = x^2 + 2yx + y^2 + 1 $ 
The second situation to consider is
$xy = zyx$
Where $z$ is just a number. Things like this usually happen when we're dealing with rotations in high numbers of dimensions. For example
$xy = cos(\theta)yx$, for some $\theta \neq 0.$
What is the appropriate analog of the binomial theorem in this case?
$(x +y)^2 = x^2 + (1  + z)yx + y^2.$
 A: For the first problem, for each $n$ define 
$$S(n)=\sum_{k=0}^n \binom{n}{k}y^kx^{n-k}.$$
Note that $S(0)=1,$ and $S(1)=x+y.$ 
We have from $xy=yx+1$ via induction that for $r\ge 1,$ $x^r y=rx^{r-1}+yx^r.$ This allows one to modify each term of an expansion so that all copies of $y$ appear in such a product before any copies of $x.$ 
Now the claim is that $(x+y)^n$ is a sum of positive integer multiples of $S(n),S(n-2),\cdots,$ going down in even decrements until reaching either $S(1)$ or $S(0)$ depending on the parity of $n.$ This follows inductively using the identy obtained by multiplying $S(n)$ on the right by $(x+y),$ which is
$$S(n)(x+y)=S(n+1)+n \cdot S(n-1).\tag{1}$$
To arrive here at the $nS(n-1)$ term involves factoring out $n$ from the factorial expression for the binomial, and using the extra multiplication by the $rx^{r-1}$ term at the appropriate places.
Once the expression for $(x+y)^n$ is found as a sum of integer multiples of sums $S(n-2j),$ identity (1) can be successively applied to the terms to arrive at the expression for $(x+y)^{n+1}$ as a sum of integer multiples of sums $S(n+1-2j).$ 
I have noticed the easy fact that the expansion of $(x+y)^n$ begins with $1\cdot S(n)$ (for highest order terms), and that the coefficient of $S(n-2)$ is a triangular number. I'm still working on a general form for these coefficients, and will update this answer if I find anything simple to describe.
A: If $xy - yx = 1$, then 
$$x^n y = x^{n-1} (1 + yx) = y x^n + n x^{n-1}$$
Thus if $(x+y)^n = \sum_{i,j} c(i,j,n) y^i x^j$, we have
$(x+y)^{n+1} = (x+y)^n x + (x+y)^n y$ so that
$$ c(i,j,n+1) = c(i-1,j,n)+ (j+1) c(i,j+1,n) + c(i,j-1,n)$$
It looks to me like we have an exponential generating function
$$ E(t) = \sum_{n=0}^\infty (x+y)^n t^n/n!
        = e^{t^2/2} e^{ty} e^{tx} $$
Thus the coefficient of $y^i x^j$ in $(x+y)^n$ is $n!$ times the coefficient of 
$t^{n} y^i x^j$ in $E(t)$, that is $0$ unless $n-i-j$ is even and nonnegative, in which case it is
$$ \dfrac{n!}{i! j! ((n-i-j)/2)!} 2^{-(n-i-j)/2}$$ 
