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.

Consider
$$
F(x)=\int_0^x(x-t)e^{\cos t}\,dt=
x\int_0^xe^{\cos t}\,dt-\int_0^xte^{\cos t}\,dt
$$
Then, by the fundamental theorem of calculus,
$$
F'(x)=\int_0^xe^{\cos t}\,dt+xe^{\cos x}-xe^{\cos x}=
\int_0^xe^{\cos t}\,dt
$$
Compute the derivative of the right-hand side and then evaluate both at $0$.
