# How do I solve for the Nash equilibria in the Hotelling price competition model

I'm trying to find the Nash equilibria in the following problem:

Two firms produce an identical product with no fixed costs. The marginal cost of each firm $$i=1,2$$ is $$c_i\in (0,1)$$. Customers are distributed uniformly on $$[1,2]$$. The location of firm $$i$$ is $$i$$. The firms simultaneously choose prices. We denote by $$p_i\in [0,\bar{p}]$$ the price chosen by firm $$i$$, where $$\bar{p}>0$$ is some large number. Customers have linear transportation costs: if customer $$x\in [1,2]$$ buys from firm 1 then he incurs a cost of $$x-1$$, and if he buys from firm 2 then he incurs a cost of $$2-x$$. The value of a unit of the product is $$V>0$$ for each customer, and each customer buys one unit of the product, from the firm that maximizes his utility. This is a game in normal form with two players (the firms).

How do I find the best response functions for both firms? Right now I have solved that: The net value of buying from firm 1 is $$V_1=V-(x-1)-p_1$$, and the net value of buying from firm 2 is $$V_2=V-(2-x)-p_2$$. For consumers located at $$x=1, V_1=V-p_1, V_2=V-(1+p_2)$$. If $$p_1>1+p_2$$, then even for consumers living at $$x=1$$, it's too expensive to buy from firm 1. Thus, all consumers buy from firm 2. For consumers located at $$x=2, V_1=V-(1+p_1), V_2=V-p_2$$. If $$p_2>1+p_1$$, then even for consumers living at $$x=2$$, it's too expensive to buy from firm 2. Thus, all consumers buy from firm 1.

Then if $$p_2-1, then when $$V_1=V_2$$, we have $$x^*=\frac{3+p_2-p_1}{2}$$. Then for all consumers located on the right of $$x^*$$, they buy from firm 2; for all consuemrs located on the left of $$x^*$$, they buy from firm 1.

How do I proceed from this?

edit: ok... so from what I've gathered, the payoff function should be \begin{align} u_i(p_i,p_{-i})=\begin{cases} 0\;\text{if }p_i\geq p_{-i}+1\\ (p_i-c_i)\cdot 1 \;\text{if }p_i\leq p_{-i}-1\\ (p_i-c_i)(\frac{1+p_{-i}-p_i}{2})\;\text{if }p_i\in (p_{-i}-1,p_{-i}+1)\end{cases} \end{align} Then the best response function should be \begin{align} BR_i(p_{-i})=\begin{cases} \frac{1+p_{-i}+c_i}{2}\;\text{(you can compute this by FOC of the 3rd case from u)} \;\text{if p_{-i} is in a range}\\ p_{-i}-1\;\text{if p_{-i} is in a range}\end{cases} \end{align} but I'm having trouble finding the range of $$p_{-i}$$.