This article investigates the dynamic pricing problem of ride-hailing platform. It employs optimal control theory to construct a dynamic pricing model for ride-hailing platform with the aim of maximizing platform profit by adjusting the supply-demand relationship within the system through dynamic pricing. The research findings indicate that the optimal dynamic pricing for ride-hailing platform varies with changes in demand within the system. Specifically, as demand increases, the optimal dynamic prices gradually rise, while with decreasing demand, the optimal dynamic prices exhibit a gradual decline. Compared to static pricing strategies, dynamic pricing strategies effectively regulate the supply-demand relationship within the ride-hailing system, thereby achieving maximum platform profit.