numer:true$
fpprintprec:6$
ratprint:false$
m:5$
phi(i):=x^i$
f(x):=sin(x)$
mh[i,j]:=integrate(phi(i)*phi(j),x,-6,6)$
p:genmatrix(mh,m,m,0,0);

bb:create_list(integrate(f(x)*phi(i),x,-6.,6.),i,0,m);

s:invert(p).bb;

kill(x);mnk1(x):=sum(s[i,1]*x^(i-1),i,1,m+1);
mnk1(x);

plot2d([f,mnk1],[x,-6,6]);