How to prove this equality: $\int_0^x(x-t)e^{\cos t}dt=\int_0^x\bigg(\int_0^te^{\cos s}ds\bigg)dt$ I'm trying to show this equality is true:
$$\int_0^x(x-t)e^{\cos t}dt=\int_0^x\bigg(\int_0^te^{\cos s}ds\bigg)dt$$
I used the fundamental theorem of calculus without success. I need a hint how to solve this question.

Integrate by parts:
$$ \int_0^x (x-t) e^{\cos{t}} \, dt = \left[ (x-t)\int_0^t e^{\cos{s}} \, ds \right]_{t=0}^x - \int_0^x (-1) \int_0^t e^{\cos{s}} \, ds \, dt. $$
The first term vanishes at the endpoints, the second is what you want.
