Why is it considered incorrect to use the variable of integration as a boundary of integration? Recently, a question was asked about limits of integration and the OP made the following "typo":
$$I =  \int_0^x f(x) \, dx$$
as opposed to
$$I =  \int_0^x f(t) \, dt $$
I commented that this typically frowned upon and can make for some odd results. It occured to me however, that I wasn't sure why this was formally incorrect, but that I had just been taught that it shouldn't be done. I couldn't think of a reason why it's considered best practices to differentiate between variable of integration and variables in the limits of integration..
Any thoughts / reasoning behind this?
 A: Let's think about this for a second.  What is
$$\frac{d}{dx} \int_0^x dx \, f(x)$$
Oh! Did you mean
$$\frac{d}{dx} \int_0^x dt \, f(t)$$
I hope you see why the former is nonsense.
A: Let's consider a simple case:
$\int_0^x x\; dx$.
Applying the usual method,
$\int_0^x x\; dx
= \dfrac{x^2}{2}\big|_0^x
=\text{?}
$
The lower term is
$\dfrac{x^2}{2}$
evaluated at $x=0$,
and this is obviously $0$.
The upper term is
more problematical.
It is
$\dfrac{x^2}{2}$
evaluated at $x=x$,
and it is unclear what this means.
Suppose the integral was
$\int_0^{2x} x\; dx$.
The upper term would then be
$\dfrac{x^2}{2}$
evaluated at $x=2x$,
and it is even more unclear what this means.
Good notation makes ideas clear
and helps avoid mistakes;
as shown here,
using the same variable for
the variable of integration
and a limit of integration
can make things unclear.
A: If someone were to write a function:
$$g(x) = \int_0^x f(x,t)dt$$
it becomes clearer why this is problematic. If you instead wrote:
$$g(x)=\int_0^x f(x,x)dx$$
then which $x$ is constant inside the integral, and which $x$ is not?
The same problem happens if you are using $\Sigma$ expressions for sums:
$$\sum_{n=1}^n g(n)$$
is unclear. This could be interpreted either as $ng(n)$ or as $g(1)+g(2)+\dots+g(n)$.
A: The problem is that (as I wrote in another answer just now) calculus books do not tend to distinguish between the integral of a function and the integral of an expression.
Let's look first at $\int_0^{2x} x\,dx$. 


*

*One option is to interpret this as the integral of the function $f(x) = x$ on an interval from $0$ to $2x$. There is nothing odd about that. For any fixed $x$, $\int_{[0,2x]} f$ will be equal to $2x^2$. The "x" inside the integral has no effect because we just view the $x\,dx$ as telling us what function is being integrated, and the function itself is a set that doesn't know anything about "x".

*Another option is to view "$\int_0^{2x} x\,dx$" purely as a symbolic expression and apply a fixed algorithm to it. In this case, that algorithm is to use a table to look up the integral of $x$, which is $x^2/2$, and then substitute the limits to get $(2x)^2/2 - (0)^2/2$, which simplifies to $2x^2$. 
Similarly, we can look at 
$$\frac{d}{dx} \int_0^x f(x)\, dx,$$
where $f$ is continuous. In this case $\int_0^x f(x)\,dx$ is some antiderivative $F(x)$ of $f$, and $\frac{d}{dx} F(x)$ is then just $f(x)$ again. There is no conflict if we view $f(x)$ as a function. The only source of confusion is that calculus books often fail to include  complete rules for how to handle derivatives like that as expressions. For example, most books do not indicate that the rule $\frac{d}{dx}\int_0^xf(t)\,dt = f(x)$ cannot be blindly applied to the expression $f(t) = xt$. But that only because the books tend to take a functional approach rather than expression-based one. 
In neither case is there any problem with the variable of integration being the same as the limit of integration. The same phenomenon holds in general: if we view the integral as operating on a function then the use of any variable in the integrand becomes meaningless once we identify the specific function being integrated, while if we view the integral symbolically and know the correct formal rules to follow then there is again no issue. 
A: In addition to what Marty said i think the latter integral (too lazy to type!) is considered wrong mainly because the limits of integration are a function of x as well.
A big contradiction to the equality of former integral and latter integral is when you differentiate the integral. 
Just try that thing out in both the cases we get totally different answers. 
latter integral is a f(x,t) which has a different and more complicated differentiating form. 
There might be many more reasons to this but yeah you should get the idea. 
If however the limits are independent of x then you can always do that x --> t shift .
