x1=linspace(0,1,100);
x2 = linspace(1,2,100);

S1 = x1.^3;
S21= -x2.^3 + 6*x2.^2 - 6*x2 + 2;
S22 = -x2.^3 + 2*x2.^2 + 2*x2 - 2;
S23 = -x2.^3 + 2*x2.^2;

figure(1); plot(x1, S1, x2, S21,'linewidth', 2);
%title('3rd derivative does not match')
figure(2); plot(x1, S1, x2, S22,'linewidth', 2);
%title('2nd derivative does not match')
figure(3); plot(x1, S1, x2, S23,'linewidth', 2);
%title('1st derivative does not match')