Hi !

The general solution, only based on the first wording, is :

V(x) = Va +(f(x)-f(xa))(Vb-Va)/(f(xb)-f(xa)) or V(x) = Va +(f(x)-f(0))(Vb-Va)/(f(L)-f(0))

where f(x) is any continuous function.

You cannot determine what kind of function f(x) is without a descriptive physical model for the electrical behaviour from A to B.