  We study the magnetic excitations in 5d transition-metal oxide Sr$_2$IrO$_4$
on the basis of the Heisenberg model with small anisotropic terms on a square
lattice. We calculate the correlation functions by using the Green's functions
in the spin-wave approximation. The spin waves are split into two modes with
slightly different energies due to the anisotropic terms. It is shown that the
spin correlation functions of the y and z components are composed of a single
peak corresponding to each mode. We analyze the process of resonant inelastic
x-ray scattering (RIXS) without relying on the fast collision approximation to
obtain the local scattering operator. The RIXS intensity is derived as a sum of
the correlation functions of the y and z spin components. We demonstrate that
the RIXS intensity as a function of energy shows two-peak structure brought
about by the two modes, which could be observed in the RIXS experiment.
