function y=pd(x,s)
if s==1
  y=3*x^2-6*x+6;
%  y=24*x^2-24*x+18;
elseif s==2
  y=5*x^4-20*x^3+60*x^2-120*x+120;
%  y=160*x^4-320*x^3+720*x^2-1200*x+1050;
elseif s==3
  y=7*x^6-42*x^5+210*x^4-840*x^3+2520*x^2-5040*x+5040;
%  y=896*x^6-2688*x^5+10080*x^4-33600*x^3+88200*x^2 ...
%   -158760*x+145530;
elseif s==4
  y=9*x^8-72*x^7+504*x^6-3024*x^5+15120*x^4-60480*x^3 ...
  +181440*x^2-362880*x+362880;
%  y=4608*x^8-18432*x^7+96768*x^6-483840*x^5+2116800*x^4 ...
%  -7620480*x^3+20956320*x^2-38918880*x+36486450;
else
  y=11*x^10-110*x^9+990*x^8-7920*x^7+55440*x^6-332640*x^5 ...
  +1663200*x^4-6652800*x^3+19958400*x^2-39916800*x+39916800;
%  y=22528*x^10-112640*x^9+760320*x^8-5068800*x^7+31046400*x^6 ...
%  -167650560*x^5+768398400*x^4-2854051200*x^3+8027019000*x^2 ...
%  -15162147000*x+14404039650;
end
