When writing $\int_{1}^{x}x^2dx$, is $x$ a variable or a constant? If the $x$ in $\int_{1}^{x}x^2dx$ is a constant, then the way in which people evaluate it doesn't make sense to me. For example, say $x=5$, then intuitively I would think of the integral as being the same as
$$
\int_{1}^{5}5^2=\left[25x\right]_{1}^{5}=25(5)-25(1)=25(4)=100
$$
However, this does not give the correct answer. Presumably, this is because we are looking at the area under of the graph of $y=x^2$, rather than the graph of $y=25$. However, if this is the case, then it seems $x$ is being treated as both a variable and a constant: a constant in the sense that it is one of the fixed bounds of integration; and a variable in the sense that we are looking at the $y-$values as $x$ changes. Putting these two together, it seems like $x$ is going from $1$ to $x$, which doesn't make sense to me.
It also seems that people try to get around this problem in a number of ways. The natural logarithm is defined as
$$
\ln(x)=\int_{1}^{x}\frac{1}{t}dt
$$
If it is correct to write $\int_{1}^{x}x^2dx$, then why don't we defined the natural logarithm as
$$
\ln(x)=\int_{1}^{x}\frac{1}{x}dx
$$
 A: It is technically not correct, but it's usually accepted in physics for example. Usually,
$$\int_1^x x^2\mathrm{d}x=\int_1^x t^2\mathrm{d}t.$$
A: Of course, one should avoid to use of symbols as integration (or other bounded) variables which are already used in the context. Logically, however, one could argue for a very narrow interpretation of the context of an integral, namely only what is inside the integral. E.g., if the function to integrate is called $f$, then $f$ is forbidden as an intergration variable that is $\int_a^b f(f)df$ is not allowed. I would also opt to not allow the integral sign and the Leibniz symbol $d$ like in $\int_a^b f(\int)d\int$ or $\int_a^b f(d)dd$. But I think that one could consider the bounds $a,b$ as being outside the integral. As far as I remember, computer software like mathemaica do not complain about the use of $\int_0^xf(x)dx$. This is very reasonnable: Imagine the desaster of a computer program which would always complain if a variable which is used in the main program is also used with a different meaning in some subroutine or function.
A: In the notation $$\int_1^x x^2\,dx,$$
the symbol $x$ represents one thing in some places and a different thing in another place.
The symbol $x$ is a so-called dummy variable within this expression:
$$ x^2 \, dx.$$
The notation $dx$ establishes $x$ as a dummy variable that is defined only within the integrand, which in this case is $x^2.$
On the other hand, the $x$ that appears at the top of the integral sign, $\int^x,$ is a free variable of this expression. You can do things to that variable that will have no effect on the dummy variable inside the integrand.
For example, if we add some text outside the integral,
$$
\int_1^x x^2\,dx \quad \text{where $x = 5$},
$$
the phrase "where $x = 5$" binds the formerly free variable $x$ to the constant value $5.$ So "$\int_1^x x^2\,dx \ \text{where $x = 5$}$" means
$$
\int_1^5 x^2\,dx.
$$
The $x$ in $x^2$ isn't touched because, as before, the notation $dx$ declared that this $x$ is not the same thing as any $x$ that occurs outside the expression $x^2\,dx.$
Do you find this confusing? So do I! It is a terrible way to write an integral.
The best policy is to choose a name for the dummy variable that is not used for anything else in the formula. For example, we could write
$$
\int_1^x t^2\,dt,
$$
which means exactly the same thing as $\int_1^x x^2\,dx$
but is much easier to understand and much less likely to cause mistakes.
Using $x$ for two different things in the same expression also leads to questions like this one:
Integral notation confusion - $x$ vs. $t$.
A: It's technically incorrect, but is often used in physics, usually in integrals involving $t$. For instance
$$s(t)=\int_{0}^{t}\sqrt{\dot{x}(t)^2+\dot{y}(t)^2}\mathrm{d}t$$
Is commonly seen.
