q[x_]:=Cos[x]+Sin[x];
f[x_]:=Cos[x]*(Cos[x]+1)-Sin[x]*(Sin[x]+1);
solution=NDSolve[{u''[x]-q[x]*u[x]+f[x]==0,u[0]==u[2π],u'[0]==u'[2π]},u[x],{x,0,2π}];
Plot[Evaluate[u[x]/.solution],{x,0,2π}]