f(x):=a*x^3+b*x^2+c*x+d;

define(g(x),diff(f(x),x));

linsolve([f(0)=0,f(1)=1,f(1/2)=1/2,g(0)=1/2],[a,b,c,d]);