diff(u(t),t)+u(t)=1;
desolve(%,u(t));
subst(u(0)=0,%);
es:subst(%,u(t));

ip(u,v):=integrate(u*v,t,0,1);

n:3;
phi(t):=sum(c[i]*t^i,i,1,n);
R:diff(phi(t),t)+phi(t)-1;
eqs:create_list(ip(R,t^i)=0,i,1,n);
vars:create_list(c[i],i,1,n);
solve(eqs,vars);
as:subst(%,phi(t));

plot2d([es,as],[t,0,1])$