We investigated the spin dynamics of two-dimensional electrons in (001) GaAs/AlGaAs heterostructure using the time resolved Kerr rotation technique under a transverse magnetic field. The in-plane spin lifetime is found to be anisotropic below 150k due to the interference of Rashba and Dresselhaus spin-orbit coupling and Dyakonov-Perel spin relaxation. The ratio of in-plane spin lifetimes is measured directly as a function of temperature and pump power, showing that the electron density in 2DEG channel strongly affects the Rashba spin-orbit coupling.