function K3 = newsplinematrix(x,n)

% the n-by-n matrix is k_1(x_i) * k_1(x_j) + k_2(x_i)*k_2(x_j) - k4(abs(x_i-x_j))

k1 = x - 0.5;
k2 = (k1.^2-1/12)/2;
a = x*ones(1,n);
b = abs(a-a');
K3 = k1*k1' + k2*k2'-((b-0.5).^4 -(b-0.5).^2/2+7/240)/24;


