Nash equilibrium for Bertrand Model with Spatial Differentiation
This is a version of Hotelling's Model of Spatial Differentiation 

The easiest solution to this is to find an "X" in-between [0,2] such that the customer is indifferent between going to Firm A or Firm B. 

This will happen when 
$ P(A) + Distance(X-A) - Utility = P(B) + Distance(B-X) - Utility $

Then demand [0, X] would go to A, and demand [X, 2] will go to B. Then using Best Response Functions for this Simultaneous game we can compute prices, quantity, and profits.

I have attached my solution below. For more information, you can see -  SNYDER NICHOLSON HOTELLING'S BEACH EXAMPLE