# RSolve? How do I Solve these equations using Mathematica

How do I solve these using Mathematica? I'd like to have formula for p[2] to p[n-1].

P[j] is the general equation,

P[n] is the last element, but finite

x[j] is just some exogenous variables

p[j] == 0.5((p[j + 1] (x[j] - x[j - 1]))/(x[j + 1] -
x[j - 1]) + (p[j - 1] (x[j + 1] - x[j]))/(x[j + 1] -
x[j - 1]) + (x[j + 1] - x[j]) (x[j] - x[j - 1]))

p[1] == 0.5(p[2] + (x[1] + x[2]) (x[2] - x[1]))

p[n] == 0.5(p[n - 1] + (2 - x[n - 1] - x[n]) (x[n] - x[n - 1]))

-
[ and ] cannot be used for grouping, only ( ) can. –  Szabolcs Jun 6 '14 at 14:01