Increasing attention is being paid to the pricing decisions of ride-hailing platforms. These platforms usually face market demand fluctuation and reflect supply and demand imbalances. Unlike existing studies, we focus on the optimal dynamic pricing of the platforms under imbalance between supply and demand caused by market fluctuation. Dynamic models are constructed based on the state change of supply and demand by using optimal control theory, with the aim of maximizing the platform’s total profit. We obtain the optimal trajectories of price, supply, and demand under three ride demand situations. The effects of some key parameters on pricing decisions, such as coefficient of demand fluctuation, service quality, and fixed commission rate, are examined. We find the optimal dynamic price can improve the match of supply-demand in ride-hailing market and enhance the revenue of platform.