Plot[E^(-0.5 x) NIntegrate[Cos[t] E^(Cos[t] + 0.5 t), {t, 0, x}], {x, 0, 40}]
Mathematica evaluates this integral for each point, which takes a long time. It is possible to iterate each time step without going through the whole function. What is the correct way to do this?

NDSolve[]instead… – J. M.'s missing motivation May 27 '15 at 10:22