  As a powerful tool in scientific computation, Mathematica offers us algebraic
computation, but it does not provide functions to directly calculate
commutators in quantum mechanics. Different from present software packets to
deal with noncommutative algebra, such as NCAlgebra and NCComAlgebra, one
simple method of calculating the commutator in quantum mechanics is put forward
and is demonstrated by an example calculating SO(4) dynamical symmetry in 3
dimensions Coulomb potential. This method does not need to develop software
packets but rather to directly write program in Mathematica. It is based on the
connection between commutator in quantum mechanics and Poisson bracket in
classical mechanics to perform calculations. Both the length and the running
time of this example are very short, which demonstrates that this method is
simple and effective in scientific research. Moreover, this method is used to
calculate any commutator in Hamilton system in principle. In the end some
deficiencies and applications are discussed.
