Clear["Global`*"]

f=Sum[a[i]*x^i, {i,0,2}]
df=D[f,x]
ddf=D[df,x]

res=Solve[{(f/.{x->1})==9, (df/.{x->2})==11,(ddf/.{x->4})==4}][[1]]

f/.res

(*X={1,2,4}
K={0,1,2}
F={9,11,4}*)

(*X=Table[Pi/2, {i,0,4}]
K=Table[i, {i,0,4}]
F=Table[D[Sin[x], {x,i}]/.{x->Pi/2}, {i,0,4}]
*)
X={0,0,1,1}
K={0,1,0,1}
F={0,0,0,1}

{0,0,0,1}

f=Sum[a[i]*x^i, {i,0,Length[X]-1}]

sys=Table[(D[f, {x,K[[i]]}]/.{x->X[[i]]})==F[[i]], {i,1,Length[X]}]

res=Solve[sys][[1]]

fres=f/.res

Plot[fres, {x, 0,1}, AspectRatio->Automatic]

A={{1,0,0,0},{0,1,0,0},{1,1,1,1},{0,1,2,3}}

Ai=Inverse[A]

R={1,t,t^2,t^3}.Ai

Plot[R, {t,0,1}]

c=t*{Cos[t],Sin[t]}

F=N[{c/.{t->1/2},D[ c,t]/.{t->1/2}, c/.{t->3/2},D[ c,t]/.{t->3/2}}]

fercubic=R.F

Show[ParametricPlot[c ,{t,1/2,3/2}, AspectRatio->Automatic],
ParametricPlot[fercubic ,{t,0,1}, AspectRatio->Automatic, PlotStyle->Magenta]]

f=Sum[a[i]*x^i, {i,0,5}]

xx=N[Table[i*2*Pi/50, {i, 0,50}]]

ff=Sin[xx]

objfun=Sum[((f/.{x->xx[[i]]})-ff[[i]])^2,{i,1,51}];

res=Solve[Simplify[Table[D[objfun,a[i]], {i,0,5}]]==0][[1]]

Plot[{Sin[x],f/.res}, {x,0,2Pi}]

Table[((f/.res)-Sin[x])/.{x->xx[[i]]},{i,1,51}]

((f/.res)-Sin[x])/.{x->xx}