Dynamic Optimal Pricing of Ridesharing Platforms under Network Externalities with Stochastic Demand

Ridesharing two-sided platforms link the stochastic demand side and the self-scheduling capacity supply side where there are network externalities. The main purpose of this paper is to establish the optimal pricing model of ridesharing platforms to dynamically coordinate uncertain supply and stochastic demand with network externalities in order to maximize platforms’ revenue and social welfare. We propose dynamic pricing strategies under two demand scenarios that minimize order loss in the surge demand period and maximize social welfare in the declining demand period. The numerical simulation results show that dynamic pricing strategies could stimulate the supply to reduce delayed orders in the surge demand scenario and adjust the demand to maximize social welfare under declining demand scenario. Additionally, we further ﬁnd that the direct network externalities positively inﬂuence the platforms’ revenue, and the indirect network externalities have a negative eﬀect on social welfare in the declining demand scenario, and a higher wage ratio cannot enhance the platforms’ revenue.


Introduction
With the rapid growth of sharing economy, ridesharing platforms, which offer service to consumers via sharing idle social labors, have entered in our lives and have deep and long-lasting impact on transportation [1]. Ridesharing is becoming an important way for resident travelling in cities. In 2018, the ridesharing platforms provided services for 20 billion customers, which accounts for thirty-six percent of resident travelling market in China [2]. Ridesharing platforms connect consumers and drivers and make revenue by charging consumers "price" and build delivery capacity by providing drivers "wage." Lower price and convenience are the main reasons for consumers to order service on ridesharing platforms, but for drivers, except for wage, their participation decisions are usually influenced by the quantity of platform's orders and drivers [3,4]. e ridesharing platforms are facing the challenge on coordination self-scheduling capacity supply with stochastic demand. e sharing drivers who provide delivery capacity for ridesharing platforms are part-time social labors with high mobility and instability. e self-scheduling social drivers [5] who can provide service and decide working hours by themselves can be far less controlled by ridesharing platforms. Meanwhile, the order demand of platform's consumers is stochastic, largely because customers could place the ride request order online at anytime and anywhere. Because consumers and drivers are sensitive to price and wage [6], a dynamic pricing strategy could be applied to effectively manage the stochastic demand and uncertain supply of the ridesharing platforms [7].
Moreover, dynamic pricing strategies for ridesharing platforms have complex demand scenarios of surge demand [7] in peak time, i.e., in the busy morning and declining demand [8] in the off-peak time, i.e., in the leisurely afternoon. Under surge demand scenario in the peak time, the demand of the ridesharing platforms extremely exceeds the capacity supply, which causes delayed orders. However, under declining demand scenario in the off-peak time, the demand of the ridesharing platforms is less than the capacity supply, which make some drivers idle. en, for platforms, the balance between the supply and demand is not the only viable objective in many cases because of the delayed orders or the idle driver accumulation issue.
Meanwhile, ridesharing platforms are completely twosided, which exhibit network externalities between customers' demand side and drivers' supply side. For instance, drivers will choose to join the ridesharing platforms for sufficient income when they observe large online orders of the platforms. In addition, drivers can view information about the idle drivers in the nearby zone in real-time on ridesharing platforms. erefore, the self-scheduling capacity supply offered by sharing the social drivers might be influenced by indirect network externalities from the demand side of the quantity of platforms' orders and the direct network externalities within the supply side of other drivers' participation as well. erefore, the network externalities of ridesharing platforms are worthwhile considered in a dynamic pricing strategy [9,10].
Our research addresses these challenging issues for ridesharing platforms and tries to answer the following research questions: (1) How to effectively manage the dynamic demand and supply of ridesharing platforms via dynamic pricing strategy? (2) How to solve the delayed orders and idle drivers' problem for the platforms? (3) How does network externalities influence the pricing strategy of the platforms?
To answer these questions, our research focuses on the dynamic pricing modeling considering network externalities in order to balance the demand and supply to maximize ridesharing platforms' revenue. Furthermore, we study the dynamic pricing strategies in two scenarios, which are the surge demand scenario in peak time to minimize the delayed order loss and the declining demand scenario in off-peak time to minimize idle drivers. en, we conduct a numerical study to verify the dynamic pricing strategies and analyze the influence of network externalities.
Our study generates several contributions. First, this paper extends prior research on the dynamic pricing strategy of ridesharing platforms [5] to complex network externality circumstances. We build the pricing model with network externalities and illuminate the impact of network externalities on the dynamic pricing strategy and ridesharing platforms' revenue. Second, we put forward dynamic pricing strategies for ridesharing platforms not only under surge demand scenario [5,11,12] but also under declining demand scenario in which the idle drivers are reduced to maximize the social welfare.
ird, the optimal control theory [13,14] is applied to optimize the pricing strategy more precisely. In our research, the ridesharing service price is taken as the control variable. e delayed orders and idle drivers are state variables, respectively, in two scenarios, which are minimized in pricing optimization with objectives of maximum revenue and social welfare. Furthermore, our study also contributes to the general ridesharing pricing literature [5] by illustrating the importance for platforms to develop dynamic pricing strategies to adapt to the complex and dynamic environment with temporary and lasting features of evolution. Our study has managerial implications to optimize the ridesharing platforms' performance. e rest of the paper is organized as follows: in Section 2, we review the related literature and search the research gap. Section 3 describes the problem and puts forward assumptions. In Section 4, we build a dynamic pricing model under surge demand scenario and analyze the pricing strategy. Section 5 analyzes the dynamic pricing model in the declining demand scenario. In Section 6, the dynamic pricing models are verified with numerical study in which the effect of network externalities and wage ratio are analyzed. Finally, Section 7 concludes this paper.

Related Literature
Our research is closely related to three streams of literature: ridesharing platforms, dynamic pricing, and network externalities.

Ridesharing Platforms.
Ridesharing, in a real sense, originates from Uber founded in 2009 and is sharing selfscheduling drivers, which is very different from that of regular taxi. e ridesharing platforms have changed the travel mode and eased traffic pressure, but it is almost inevitable that the development of the online peer to peer ridesharing service has also brought various problems waiting to be resolved. e researchers have done various studies on ridesharing from the perspective of spatial dimension. Some researchers consider the ridesharing services as solutions to pressure due to the traffic congestion. Li et al. [15] built a path-based equilibrium model to describe the decision-making of travelers and examine how the ridesharing program will reshape the spatial distribution of traffic congestion in the presence of the ridesharing program. Meanwhile, Tafreshian and Masoud [16] proposed a new market model to address the ride-matching problem, which outputs matching, role assignment, and pricing to analyze an opportunity cost of missed social welfare or revenue for a P2P ridesharing system. In addition, passengers' mobility preferences are also viewed as the service strategies; for example, Bian et al. [17] proposed a novel mechanism, namely, "mobility-preference-based mechanism with baseline price control" (MPMBPC) to promote consumers' participation in the on-demand first-mile ridesharing accounting for mobility preferences including arrival deadlines, maximum willing-to-pay prices, and detour tolerances. Some researchers proposed the approach to balance between user privacy and utility. Mejia and Parker [18] explored whether the operational transparency is beneficial with potentially biased service providers in the context of ridesharing platforms through an experiment. Avodji et al. [19] developed a privacy-preserving service to compute meeting points in ridesharing with each user in control of his location data. Ridesharing platform pricing is also especially important to address the traffic issue from time dimension in the demand side. Wei et al. [20] modelled a multimodal network with ridesharing services, where two types of travelers who have their own cars or not could have different choices. Based on the doubly dynamical framework, two different congestion pricing schemes are proposed to reduce network congestion and improve traffic efficiency. María et al. [21] analyzed user preferences toward pooled on-demand services regarding their time-reliability cost trade-offs, including value of time (VOT) and value of reliability(VOR) of the different trip stages.

Dynamic
Pricing. Many researchers have studied the dynamic pricing model on perishable products [22][23][24] and electricity market. Herbon and Khmelnitsky [13] developed an inventory replenishment model with dynamic pricing, considering the interdependence of demand on price and time. Referred to Chen et al. [25], they compared four dynamic pricing models with and without menu costs for deteriorating products and analyzing the impact of menu costs on deteriorating products. Dynamic pricing is used in electricity market for load management in the peak period [26]. Sharifi et al. [27] studied optimal pricing strategies and demand response models for a pool-based electricity market based on the bilevel Stackelberg-based model in order to enhance retailer's profit and consumers' welfare during peak hours of power consumption. e economic demand response model [28] is also employed for residential consumers in liberalized electricity markets to change their consumption pattern from times of high energy prices to other times to maximize their utility functions. Abapour et al. [29] proposed a noncooperative game to obtain the best bidding strategy of demand response aggregators in the electricity market. e robust optimization method is used to optimize the robustness of the pricing strategies. e dynamic pricing strategy plays an important role in coordinating the balance of the demand and supply for ridesharing platforms [30]. Bimpikis et al. [31] explored the role of spatial price discrimination in ridesharing networks and highlighted the effect of demand pattern. In addition, surge pricing should not be ignored, which is an effective mean to adjust the capacity in the peak time for ridesharing platforms. Cachon et al. [5] studied a revenue model in which the optimal contract of a service platform applies a surge pricing policy, considering self-scheduling of providers. In addition, Guda and Subramanian [11] analyzed the function of surge pricing on managing the platform service through considering workers' behavior of moving between adjacent zones, taking forecast communication and worker incentives into account as well.
Ridesharing platforms have stochastic demand and uncertain social supply. e load management by dynamic pricing strategies on electricity markets focuses on demand response and customer flexibility during peak hours of power consumption. Existing ridesharing literature mainly studies dynamic pricing of peak time in order to coordinate the supply with demand to maximum platforms' revenue. In this paper, we extend the existing literature on load management [27] and ridesharing [5] to minimize delayed order loss in peak time. Moreover, considering the social feature of ridesharing drivers, we study the dynamic pricing strategies in off-peak time to minimize idle drivers and maximize social welfare.

Network Externalities.
Inevitably, with the development of technology and smartphone, two-sided ridesharing platforms linking customers and drivers have the characteristic of network externalities. Rohlfs [32] proposed the network externalities in the communication industry. Katz and Shapiro [9] redefined the concept and formulated a static, one-period model that uses market equilibria to capture network externalities, competition, and compatibility as vital elements. e network externalities exist in multiple situations [33,34], such as retailers and manufacturers [35], green manufacturing [36], consumers and retailers in supply chain [37], social networks [38], and so on. e research is beginning to pay attention on network externalities in ridesharing platforms in recent years. Wu and Zhang et al. [10] develop an instantaneous pricing model in the context of two-sided market theory, and spatial differentiation and network externalities are considered as factors that affect the pricing mechanism of online car hailing platforms.
Ridesharing two-sided platforms connect customers' demand side and social drivers' supply, which have network externalities between two sides. We focus on the dynamic pricing strategy under network externalities in ridesharing platforms using optimal control theory. Optimal control theory is a systematic theory developed in 1950s, which is used in the field of control at the beginning. Now, the optimal control theory has been applied in the management field, such as production planning [14] and financial system [39]. e dynamic optimization of the optimal control theory can depict the dynamic pricing trajectory of platforms in continuous time; thus, it can improve the accuracy and timeliness of the pricing strategy by changing the state in continuous time [40]. erefore, extending the work of Herbon and Khmelnitsky [13], this paper studies the dynamic pricing strategies under two scenarios (surge demand and declining demand) based on Pontryagin's maximum principle method of optimal control theory [41,42], considering the network externalities. Meanwhile, in this paper, we innovatively take delayed orders and idle drivers as the state variables of two scenarios, respectively, instead of taking the inventory level as the state variable in the existing literature, aiming to reduce loss cost while coordinating the supply and demand to obtain more platform revenue. Furthermore, network externalities have analyzed the influence on dynamic pricing strategies of ridesharing platforms. Our research fills the theoretical gap in dynamic pricing of load management and ridesharing management.

Problem Description.
Ridesharing platforms are typical two-sided markets. On the demand side, consumers pay "price" to obtain service in platforms. e online demand of consumers is stochastic and changes with time; it means they can request service at any time through the platforms. On Complexity the supply side, platforms pay "wage" to drivers for service capacity supply. Since drivers could decide participation and work time by themselves, the ridesharing platforms have self-scheduling capacity supply. Hence, it is more difficult for the platforms to control the self-scheduling supply and stochastic demand. In this case, the ridesharing platforms have exhibited significant network externalities. Drivers are inevitably effected by the network externalities in online ridesharing platforms. Figure 1 shows a brief operation process of the ridesharing platforms.
In Figure 1, the two sides represent the demand side and the supply side, respectively. e demand side requests service from platforms via pay "price", and the supply side offers service to get "wage", ridesharing platforms make revenue by paying "price" and charging "wage". Because consumers and drivers can choose whether to join platforms via observing price and wage, it is more convenient for platforms to manage both sides through dynamic pricing based on fixed commission contract. Unlike traditional taxi, the ridesharing platforms are transparent two-sided markets for demand side and supply side. In term of drivers, they can observe not only the number of idle drivers around this order (direct effect), but also the regional thermodynamic diagram, which displays platforms' orders (indirect effect). Obviously, drivers could be influenced by network direct network externalities from the same supply side and indirect network externalities from the demand side; in addition, network externalities influence the pricing strategy of ridesharing platforms.
Generally, ridesharing platforms might face two demand scenarios, which are surge demand scenario and declining demand scenario.
e interaction clearly appears between consumers and drivers and occurs over the process of coordinating demand and supply. As shown in Figure 2, customers request ride demands to ridesharing platforms, and the platforms accept demand orders and evaluate the supply capacity. When order demand exceeds the supply capacity, the platforms adopt the surge pricing strategy to stimulate driver supply until a balance between demand and supply is reached. When supply capacity exceeds the demand, the platforms can adopt a dynamic pricing strategy to adjust customer demand until a balance between demand and supply is reached. e description of variables and parameters involved in ridesharing platforms is shown in Table 1.

Assumption.
We study dynamic pricing strategies in two scenarios, which are surge demand scenario in peak time and declining demand scenario in off-peak time by taking the delayed orders and idle drivers as the state variables, respectively, of two scenarios, and taking the optimal price as the control variable. Second, we consider network externalities on the supply side, which are from the cross demand side of the quantity of orders and the same supply side of other drivers. On the supply side, drivers can view information about the idle drivers around nearby location in realtime through platforms (direct effect). On the demand side, driver's participation decision to the platforms depends on the order quantity (indirect effect). Hence, the network externalities on the drivers' supply from both the demand side and supply are discussed in the paper considering the self-scheduling capacity of ridesharing platforms, which could be controlled by dynamic pricing to balance with the stochastic demand. ird, except for maximizing platforms' revenue, the platforms can ensure minimum order loss under surge demand and maximum social welfare under declining demand via controlling price.
Referring to Krishnamoorthy et al. [43] and Herbon and Khmelnitsky [13], we assume that the demand is a nonlinear time effect function, and the initial market demand is ae − bt in time period [0, T] (b < 0 represents the negative-exponential time effect on demand and b > 0 represents positiveexponential time effect, where b indicates the stochastic demand to some extent). e current demand of the ridesharing platforms is affected by rational and price-sensitivity consumers. Considering the price and time dependence of consumers, we assume that the demand is increasing under the surge demand period (b < 0), and the demand is decreasing under the declining demand period (b > 0). Specifically, the demand function is as follows: (1) For convenience, we adopt a fixed commission contract to connect wage and price, that is, wage W(p,t) is linear with price p(t), W(p,t) � cp(t) (Hu and Zhou [6]). us, the capacity supply of the platforms provided by drivers is similarly stimulated by the service price [10]. Given the effect of indirect network externalities, we also assume that μ 2 has a positive effect in all time period. Considering the effect of order quantity on drivers' decision, we assume that the direct network externalities μ 1 have a positive effect on the surge demand period because of insufficient driver supply and a negative effect on declining demand period due to idled drivers.
en, the supply function in the surge demand Let S e (p,t) denotes driver's rational expectation of supply at time t [9], S(p,t) � S e (p,t). To simplify the presentation, the joint dynamic pricing, time, and network externalities supply function is as follows: Conversely, the supply function in declining demand is as follows:

Ridesharing platform
Indirect network externalities Supply side Demand side Direct network externalities

Complexity
Meanwhile, since orders of the demand side cannot be satisfied by drivers in the surge demand period, it results in the delayed order accumulation, Y(t). We assume that the delayed order quantity at time T is φ T , initial delayed order is φ 0 , and the loss cost per unit of delayed order is h. In the declining demand period, it will be surplus in the supply side as the quantity of drivers exceeds orders, where I(t) represents the quantity of idle drivers waiting for orders at time t. In addition, the waiting cost of the idle driver per unit is c. In addition, we assume that the initial idle driver quantity is ψ 0 , and at time T it is ψ T . erefore, we mainly control the optimal price trajectory to minimize the delayed order Y(t) from φ 0 to φ T in peak time, and idle driver I(t) from ψ 0 to ψ T in off-peak time, while maximizing the platforms' revenue and social welfare. In other words, we design the model for determining the optimal dynamic pricing strategy for the corresponding state variable (loss cost) by means of the optimal control theory subjected to the maximum revenue and social welfare. en, this paper focuses on dynamic ridesharing pricing under two complex demand scenarios, surge demand and declining demand.

Surge Pricing Strategy to Minimize Delayed
Order Loss under Surge Demand is paper proposes dynamic ridesharing pricing strategies under two demand scenarios, which are surge demand and declining demand. e timeline of two scenarios are shown in Figure 3. In Section 4, we mainly discuss the surge pricing strategy under surge demand. And, Section 5 analyzes dynamic pricing strategy under declining demand Surge demand [7] in ridesharing platforms occurs in peak time. Generally speaking, it is when the order demand far exceeds the supply capacity and gradually increases. Due to the selfscheduling capacity characteristic of the supply side, ridesharing platforms could attract more drivers to actively join via increasing price, i.e., surge pricing. In the surge demand scenario, the demand side has a negative-exponential time effect.
rough increasing price, the platforms stay at an equilibrium level. However, the delayed orders still exist in platforms, even though the delayed order rate reaches zero, that is, Y � 0, but Y ≠ 0 at T pb . en, the platforms continue to simulate the supply side to reduce real-time orders and delayed orders. When Y � 0 at T pm , the platforms' revenue   Wage of driver at time t Y(t) Delayed order quantity at time t I(t) Idle driver quantity at time t Complexity 5 reaches the maximum value.
e timeline of the surge demand period is shown in Figure 3(a).
Referring to Herbon and Khmelnitsky [13], the ridesharing service price p(t) is taken as the control variable in the dynamic pricing model based on optimal control theory. e state variable Y(t) is denoted as the delayed orders accumulated in the surge demand period while the demand exceeds the drivers' supply. e ridesharing service price is dynamically optimized by controlling the state variable of cumulative delayed orders decreased to zero in order to maximize the expected revenue of ridesharing platforms [13,41]. e changing rate Y(t) of the delayed orders is decreased with the difference between the demand and supply (D(p, t) − S(p, t)), which is indicated with a negative sign in the following state equation: eoretically, Wang et al. [12] have studied the price trajectory to minimize the cumulative delayed orders' loss cost in crowdsourcing platforms. Extending the work of Wang et al. [12] and considering the influence of network externalities, we obtain the objective function of platforms' expected revenue as follows: In order to obtain the optimal price of the platforms, we introduce the Lagrangian multiplier λ(t), which is the costate variable, and the construct Hamilton function to the optimal control problem as follows: ereby, the second-order derivative for p from the Hamiltonian function is deducted as follows: 6 Complexity us, the solution of the optimal price can maximize the Hamiltonian function. For a given pair of 0 < β < 1, 0 < c < 1, platforms' expected profit is a concave function, which satisfies the maximum condition. By applying Pontryagin's maximum principle, the first-order conditions of maximum objective function (5) are given by Based on the above mentioned conditions, we can obtain the optimal price p * (t), shadow price λ * (t), supply S * (t), and demand D * (t) with respect to time t as follows: is section mainly focuses on the dynamic pricing trajectory under the balance moment and the minimum order loss. us, we assume that the balance moment of demand and supply is T pb , which means S(p, T pb ) � D(p, T pb ). At time T pb , Y (T pb ) � 0 but Y(T pb ) > 0, and it shows that delayed orders still exist. erefore, the platforms take some time to increase the service price and motivate the drivers. Meanwhile, we assume that T pm is the moment of minimum order loss, where Y(T pm ) � 0, and the accumulated delayed order quantity decreases to zero. In doing this, we propose the following theorem.

Theorem 1. p * T pm (t) is a strictly increasing function at time period [0, T pm ].
Proof. From equations (5) and (6), we obtain the optimal price p * T pm (t), shadow price λ * T pm (t), supply S * T pm (t), and demand D * T pm (t) at T pm . en, the first-order of p * It shows that p * T pm (t) increases with respect to t in peak time. e larger is the demand order quantity, the higher is the price. eorem 1 shows that optimal price always increases and over time under surge demand. b < 0 represents the increasing orders, and the demand side is greater than the supply capacity as a whole. e increasing price can directly Complexity 7 motivate drivers, which is due to the fixed commission contract, further help to reduce real-time and delayed orders. us, Lemma 1 shows the variation trajectory of the supply side as the control parameter p * T pm (t) change. □ Lemma 1. S * T pm (t) increases with p * T pm (t) for εc ≥ βμ 2 .
Proof. By simple deformation, the supply S * T pm (t) is where the effect of the price incentive is greater than the indirect network externalities, and S * T pm (t) has a positive correlation with p * T pm (t). On the basis of eorem 1, p * T pm (t) is a strict increasing function with time t. Obviously, the supply side also increases with time t.
Considering the direct effect of network externalities on optimal price, we further have insight into the influence of the network externalities on the supply trajectory. Proof.
e results of S T pb (t) in the following can be obtained from equation (12).
en, the two first-order for μ 1 and μ 2 from S T pb (t) are, respectively, Obviously, solving the two first-order conditions from S T pb (t) yield (zS T pb (t)/zμ 1 ) ≥ 0 and (zS T pb (t)/zμ 2 ) ≥ 0, which represent that S T pb (t) increases with respect to μ 1 and μ 2 . Actually, drivers can observe the surge demand and insufficient supply by smartphone application, and the increasing price stimulates drivers to join the platforms, which could increase the capacity supply.
In addition, the ridesharing platforms revenue p and the drivers revenue s will be verified by numerical simulation in Section 6.

Dynamic Pricing Strategy to Maximize Social
Welfare under Declining Demand e ridesharing platforms' demand is declining in the offpeak time, except for the surge orders, over a longer period of time [8]. Some drivers are idle in the declining demand period, which shows that the whole drivers exceed the order demand. When platforms decreases the price, more consumers will be attracted to choose the ridesharing service. Until the balance moment T ob , the demand side and supply take some time to gradually reach equilibrium. However, the idle drivers still exist at T ob , even though the idle driver rate reaches to zero, i.e., I � 0, but I ≠ 0. en, the platforms continue to simulate the demand side by reducing the ridesharing price. When I � 0 at T om , the social welfare can reach the maximum value with decreasing idle loss. e timeline of declining demand period can be referred to Figure 3(b) in Section 4.
Referring to Herbon and Khmelnitsky [13], the ridesharing service price p(t) is taken as the control variable in the dynamic pricing model based on optimal control theory. e state variable I(t) denotes the idle drivers accumulated in the declining demand period ,while the drivers' supply exceeds demand. e ridesharing service price is dynamically optimized by controlling the state variable of cumulative idle drivers decreased to zero in order to maximize the social welfare [13,41]. e idle drivers' changing rate I(t) decreases with the difference between the supply and demand (S(p, t) − D(p, t)), which is indicated with a negative sign in the following state equation: D(p, t)), e main goal for ridesharing platforms is to make profit like other companies. In fact, platforms still take into account the development issue especially during the off-peak time. Referring to Yu et al. [1], we propose the social welfare denoted by the sum of drivers' earnings and ridesharing platforms' revenue, where the ridesharing platforms revenue' is represented in equation (15) and drivers' earning is in equation (16). en, our proposed optimal control problem of maximization social welfare (denoted by SW ) is as follows:

[D(p, t)p(t) − D(p, t)W(p, t) + S(p, t)W(p, t) + ct(D(p, t) − S(p, t))]dt. (17)
We then introduce costate variable λ(t) and construct Hamilton function of social welfare maximization, D(p, t) − S(p, t)). (18) Hamilton function is a differential and nonlinear equation. By applying Pontryagin's maximum principle, the first-order conditions of the Hamilton function are given by Combining equations (18) and (19), we obtain the optimal price p * T om (t) and shadow price λ * T om (t), further obtaining the supply S * T om (t) and demand D * T om (t) as follows: where parameter δ satisfies the following equation: is section mainly focuses on the optimal pricing trajectory under declining demand scenario, where the model is proposed to maximize social welfare. Meanwhile, we obtain the minimum idle loss cost via controlling ridesharing price. In the declining demand, the drivers exceed order demand, which means some drivers are in an idle state to wait for limited orders. en, dynamic pricing takes the role of controlling the drivers and attracting consumers.
Given the supply-demand balance moment, T ob , where S(p, T ob ) � D(p, T ob ). At time T ob , I (T ob ) � 0, but I(T ob )≠0, there still exists accumulated idle drivers on the platforms. e platforms continue to control price and stimulate consumers. We assume that T om is the moment of minimum idle driver loss, where I(T om ) � 0, and accumulated idle driver quantity decreases to zero. us, the platforms can obtain the optimal social welfare at T om . e proposed theorems are given as follows.
Substituting p(T ob ) into the optimal price equation p * T ob (t) and simplifying, where ψ 0 satisfies the following equation: From this, as well as eorem 3, we can conclude that the solution for the optimal price does exist under declining demand. λ * T ob (t), S * T ob (t), and D * T ob (t) have to be considered along with the optimal control parameter. eorem 3 shows that the control parameter p * (t) exists and have effect on the platforms, including real-time and cumulative idle drivers' loss. Considering the effect of network externalities on drivers, we try to look for the correlation between them.
Proof. By simple deformation, the demand D * Obviously, D * T om (t) has a negative correlation with p * T om (t). at is, the demand side shows an increasing trend when platforms decrease price. e decreasing price can stimulate consumers to join platforms. Wage has a direct effect on the optimal price. en, we further prove the influence of the wage ratio on the optimal price trajectory. □

Theorem 4.
e optimal price p * T ob (T ob ) is high initially and then decreases with c over time.
Proof. Note that the first-order of p * T ob (T ob ) for c is Interestingly, we find that the higher wage ratio leads to a lower ridesharing price. In other words, p * T ob (T ob ) decreases with the wage ratio. When platforms' price remains relatively stable, increasing c means that drivers obtain more revenue, and more drivers prefer to stay on the platforms. Due to the complexity relationship between social welfare SW and c, μ 1 and μ 2 will be verified by simulation in the following section.

Numerical Study
In Sections 4 and 5, we, respectively, present the dynamic pricing strategies under two scenarios of the surge demand in peak time and declining demand in off-peak time. Next, we examine the numerical study to analyze the optimal price, the supply, and the demand, even the revenue of ridesharing platforms and social welfare with and without considering network externalities. DiDi is a typical online ridesharing platform introduced in 2012, and gradually occupies most of ridesharing market share in China. We take DiDi as an example for numerical analysis. Without loss of generality, we adopt initial values a � 10 6 , b � 0.03, h � c � 0.2, μ 1 � 0.5, μ 2 � 0.2, φ 0 � ψ 0 � 10 5 , c � 0.2, and T pm � T om � 35, i.e., time t is allowed to vary from 0 to 35. Meanwhile, given ε � 40000 and β � 50000 for εc < βμ 2 and ε � 90000 and β � 90000 for εc ≥ βμ 2 .

Price Strategy.
Under surge demand and declining demand, the trends of the optimal price p * become obviously different, which are subject to the supply, the demand, and especially parameter b of market size change, as shown in  In Figure 4, the optimal price p * is steadily moving higher in the surge demand period with network externalities (μ 1 � 0.5, μ 2 � 0.2) and without considering network externalities μ 1 and μ 2 . It is consistent with eorem 1, thus we can obtain that the intensity of network externalities μ 1 and μ 2 has no effect on the overall trend of p * , but have a major influence on the price range.
As shown in Figure 3(a) (surge demand), the price p * is an increasing function for b < 0, which is in accordance with eorem 1. erefore, the ridesharing platforms entail to raise price to increase drivers' supply when the demand increases with t in peak time. As shown in Figure 4 (declining demand), the ridesharing price p * in off-peak time is strictly concave with t. In addition, the price p * is a decreasing function for b > 0. erefore, it is consistent with the actual market, and illustrates the difference between the network externality case and nonnetwork externality case in the considered two scenarios. e ridesharing platforms reduce price to increase the demand when the demand side decreases with t.
Furthermore, Figure 5, respectively, shows that the trends of order demand and driver supply varies with the optimal ridesharing price during two scenarios of surge demand and declining demand. e supply cannot satisfy the order requirements when b < 0 (surge demand) in Figure 5(a), then the ridesharing platforms increase price to stimulate drivers' supply when the price is more attractive to drivers εc ≥ βμ 2 . It is consistent with Lemma 1. Interestingly, in the declining demand period when b > 0, the demand curve shows an overall upward trend as shown in Figure 5(b), the trend is consistent with Lemma 2. It indicates that the decreasing ridesharing price could increase the demand in the declining demand period. Concretely speaking, the price can effectively coordinate the demand and supply of the ridesharing platforms. Figure 6, except for cost loss, also shows the state trajectory in which the state variables Y(t) and I(t) gradually decrease to zero with the change in the control variable. Obviously, the control of dynamic pricing is directed toward avoiding a certain loss cost for further earnings. According to Figure 6, the ridesharing platforms achieve the minimum order loss at T pm in the surge demand period, and reaches maximum social welfare at T om in the declining demand period. erefore, the dynamic pricing strategy could reduce the cost loss to maximize the platforms' revenue and social welfare.

Effect of Network
Externalities. According to Sections 4 and 5, the network externalities μ 1 and μ 2 have influence on self-scheduling drivers supply side, which is a typical characteristic of online ridesharing platforms. As shown in Figure 7, for all b, the indirect network externalities μ 2 always has a positive effect on drivers' supply. In other words, the overall trend means that large orders can encourage drivers to join the platforms. For the direct network externalities μ 1 , S * increases with μ 1 in surge demand, and decreases in declining demand. When the demand in the surge demand period increases, it attracts more drivers to provide service for ridesharing platforms. On the contrary, excessive idle drivers in the declining demand period make the drivers adopt a wait-and-see attitude or quit platforms. Next, we consider the change in P and S , which is influenced by μ 1 and μ 2 . Simultaneously, there is no doubt that μ 1 and μ 2 have strong increasing effect on revenue for b < 0. In Figure 6, we can see the supply trend with μ 1 and μ 2 . Figures 7 and 8 further compares the μ 1 and μ 2 influence on revenue P and S in the surge demand period. When b < 0, S * always increases with μ 1 (Figure 7(a)), and P and S increase under satisfying orders. However, the supply side gradually exceeds the demand with μ 1 , where the revenue of idle drivers suffers cost loss as P declines. Similarly, P and S gradually increase with μ 2 .
In the declining demand period, μ 1 always has a positive effect on social welfare SW . Hence, SW increases with μ 1 as shown in Figure 9. We redefine the social welfare, which is the total revenue of platforms and drivers, and the quantity of other drivers is always beneficial to the supply side. However, under the declining demand, we can see that the curves of different μ 2 move down greater. Drivers need to share the limited orders in the declining demand period, and they usually choose to exit the platforms. us, μ 2 has a negative effect on SW . erefore, lower μ 2 and higher μ 1 appropriately can contribute to the revenue.

Effect of Wage Ratio.
In self-scheduling supply side, we use fixed commission contract to manage and determine the revenue level of drivers. In other words, c directly influences the price and social welfare. Although the ridesharing platforms have been widely controlled at the level of optimal dynamic pricing, the relation between drivers and pricing under network externalities is fairly recent. To explore the effect of wage fully, we study equally the sensitivity of c to resort to numerical analysis.
From the price perspective, the higher ridesharing price allocates the driver a higher wage, which may motivate more sharing drivers to join platforms. From Figure 10, we can obtain that p * and S * without considering network externalities still present the same trends. In declining demand, p * shows a decreasing trend with c, instead S * increases with c. us, it proves that the high wage ratio is extremely attractive to drivers. However, the higher wage ratio could increase the gap between the supply and the demand. en, within a certain range, the wage ratio can benefit to the platforms. Ridesharing platforms should not only rely on the wage ratio to coordinate the demand and supply.  Furthermore, the analysis of the wage ratio is discussed for platforms' revenue, drivers' earning, and social welfare. In Figure 11, increasing c is always beneficial to drivers, so S increases with c. Similar to the increasing effect on supply, social welfare always presents the positive trend. By comparison, as the wage ratio increases, the revenue of ridesharing platforms gradually increases and then decreases. en, the whole trend is consistent with the actual platforms. us, appropriate increase in c is beneficial to attract drivers and the development of ridesharing platforms.
In ridesharing platforms, the demand and supply are highly flexible; this model quickly offers the real-time price according to the market situation. Likewise, these strategies compensate the loss cost and helps secure the maximum revenue. en, our model is evaluated in the numerical study. In the coordinating process between two sides, the network externalities between the demand side and the supply side make the dynamic pricing for ridesharing platforms more complicated. In summary, the model based on optimal control theory was proposed to create a dynamic pricing strategy by ridesharing platforms to increase platforms' revenue and social welfare under two demand scenarios. Specifically, the surge pricing model can decrease the speed of the surging demand, and increase the quantity of the supply side. e decreasing pricing model of the declining demand can control the decreasing demand to rise slowly. Meanwhile, the loss cost of two periods can be reduced to zero via optimal dynamic pricing. e application of optimal control has important management significance to dynamically coordinate demand and supply for the real ridesharing platforms.
ese studies benefit to our better understanding of the dynamic characteristics of the ridesharing platforms.

Conclusions
is paper mainly focuses on the dynamic optimal pricing model involved in network externalities applying optimal control theory. We discuss that platforms take the pricing strategy to maximize platforms' own revenue as the objective function under surge demand and take the maximization of social welfare under declining demand. Compared with the previous studies on ridesharing platforms, the loss cost caused by delayed orders and idle drivers is simultaneously optimized.
e results show that the optimal price and platforms' revenue considering the effect of network externalities have changed significantly. Our model is implemented for the actual ridesharing platform pricing and social welfare, which is one step closer to reality. e simulation result draws the following conclusions: (1) Optimal price has changed gradually with time, which is associated with loss cost and revenue. During the surge demand period, increasing price can reduce real-time orders and digest cumulative orders. Meanwhile the existing order loss signifies that the platforms entail to continually increase price to motivate drivers. During the declining demand period, ridesharing platforms opt to decrease price to attract consumers and avoid idle drivers' loss. ese results reveal the reason why the optimal price continues the original trend to increase or decrease  Without μ 1 , μ 2 Figure 10: e effect of c on P * and S * (declining demand). e X axis refers to the wage ratio c, Y axis (left) refers to the optimal price P * , and Y axis (right) refers to the supply capacity. after the balance moment of demand and supply. In addition, ridesharing platforms can simultaneously reach the minimum delayed order loss and idle driver loss via control pricing.
(2) Network externalities simultaneously influence the optimal price, supply side, and revenue. In terms of the direct effect of network externalities on the supply side, it means that platforms may pay more effort for management. e dynamic price model combining network externalities can endogenously control the changes of platforms.
(3) Wage ratio parameter identifies the vital position. e higher is the wage ratio, the higher is the supply capacity level, which means that the higher wage will give drivers more motivation to join platforms. Within a certain range, the wage ratio benefits to platforms and social welfare.
e results indicate that the optimal dynamic pricing considering network externalities provide reference values to ridesharing platforms, and offers the evidence for the market to achieve robust and orderly development. However, this paper only studies the optimal pricing on the single platform with the constraint of a fixed commission contract, that is, our model is applicable to a single platform. us, future work can study the dynamic pricing strategy under the competition between two or more ridesharing platforms with dynamic commission contract.

Data Availability
e data used to support the findings of this study are included within the article.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.