I have an expression that I want Mathematica to fully expand without any simplification afterwards. I want the output to look like the following example.
(x+y)^2 ⇒ x^2+xy+yx+y^2
Could you help me to solve this problem?
|
I have an expression that I want Mathematica to fully expand without any simplification afterwards. I want the output to look like the following example.
Could you help me to solve this problem? |
||||
|
Try
which will give you
Even J.M.'s solution
will give you the $2 x y$ as separate terms, but has to use the symbol for non-commutative multiplication (for example, x and y may be operators):
and Mathematica won't interpret it as commutative multiplication. Replacing x and y with numerical values
will yield
instead of
|
||||
|
|
Distribute[(x + y) ** (x + y)] /. t_ ** t_ :> t^2? – J. M.♦ Oct 6 '12 at 14:37