I was given the following question:
Given the $f$ is a function such that the integrals exist, use the substitution $u=a-x$ to show that $$ \int^a_0f(x)\,dx=\int^a_0f(a-x)\,dx $$
I belive I've solved the question by using transformations as follows: $$ \int^a_0f(x)\,dx=\int^0_{-a}f(-x)\,dx=\int^a_0f(a-x)\,dx $$ I would appreciate it if somebody explained to me how I would achieve the same solution using the substitution $u=a-x$.
Suppose $u = a-x$. Then $x = a-u$, so $dx = d(a-u) = -du = (-1)\;du$.
When $x=0$, we have $u=a-0 = a$
When $x=a$, we have $u = a - a = 0$.
So substitution gives
$$\int_{x =0}^{x=a} f(x)\;dx = \int_{\underbrace{u=a}_{x=0}}^{\overbrace{u=0}^{x=a}}f(\underbrace{a-u}_x)\underbrace{(-1)\;du}_{dx}$$ Since $\int_r^s =-\int_s^r$, we may swap limits and change sign to get the desired result $$\int_0^a f(x)\;dx = \int_0^a f(a-u)\;du$$ Since the name of the variable of integration is irrelevant, this is the same as $$ = \int_0^a f(a-x)\;dx$$