Then d(1,x) is the inner product (1-x,1-x) = integral from -1 to 1 of (1-x)^2 dx, which is the same as the integral from -1 to 1 of (x-1)^2 dx. Antiderivative is , and from it, you easily get the answer = .