I just purchased my first BMW

. 1995 325i, 52,000 miles, automatic (I know, I know)
Car is great except for one issue. When driving on a level road under steady throttle the car runs great. When you encounter a hill, and increase the throttle slightly to maintain speed, it feels as if the car cannot decide which gear to be in and the RPMs will fluctuate between 2500 and 3000. If you apply more throttle, the appropriate gear kicks in and all is fine. If you run under full throttle, the gears shift smoothly, no hesitation.
Anyone ever had this problem? Any suggestions?