# Can I bring the variable of integration inside the integral?

$\def\d{\mathrm{d}}$My problem

So I have coefficient of a certain general solution of a PDE that turns out to be $$A_n =\frac{\displaystyle \int_{0}^1 g(x)J_0(\lambda_mx)x\,\d x}{\displaystyle \int_0^1J^2_0(\lambda_m x)x\,\d x}.$$ Now the book says that when we replace $f(x)$ by $1$ we should get $$A_n=\frac{2}{\lambda_n J_1(\lambda_n)},$$ however I couldn't get there so I thought that by plagging it in the solution $$Q(x,t)=\sum_{n=0}^\infty A_nJ_0(\lambda_n x)g(t),$$ where $g(t)$ is another function I just don't write. I could maybe bring the $J_0(x\lambda_n)$ inside the integral and use some sort of orthogonality or something else.

• No, this changes the expression. Apr 24, 2017 at 16:29
• no you cannot, why would you think you might be able too? Once you out it in you get a number, if you leave it out you get an expression for $x$ so its clearly wrong. Apr 24, 2017 at 16:29
• And for precisely these reasons, it's a terrible idea to use the same symbol for the bound variable in the integral and the free variable outside it. Apr 24, 2017 at 16:30
• @ZiadFakhoury well cause I have a problem and the solution seems to come from bringing a function of the variable of integration, inside the integral, but maybe I just can't find the right method to solve irt Apr 24, 2017 at 16:31
• As Chappers alludes to but more explicitly, the $x$ outside the integral and the $x$ inside the integral are different variables and can't be interchanged. Apr 24, 2017 at 18:21

No; since: $$\int_0^1x^2 \,\mbox{d}x=\frac{1}{3}$$ you would have: $$x\int_0^1x^2\,\mbox{d}x=\frac{1}{3}x$$ while: $$\int_0^1x^3\,\mbox{d}x=\frac{1}{4}$$

Or to put it differently: if you would be allowed to bring in such a factor, you would also be allowed to take out any factor and it might be easier (?) to understand that this can't work...

Also note that in a definite integral, the variable is just a dummy so it would be less confusing to not use the same variable but rather write something like: $$x\int_0^1t^2\,\mbox{d}t=\frac{1}{3}x$$ Now, as AccidentalFourierTransform pointed out in a comment, you can bring the $x$ inside if $x$ and $t$ are independent since in that case, $x$ is a constant with respect to $t$ and the integral is linear: $$x\int_0^1t^2\,\mbox{d}t=\int_0^1xt^2\,\mbox{d}t=\frac{1}{3}x$$

• I'd like to point out that in the last expression, once you rename the integration variable from $x$ to $t$, we are, in fact, allowed to bring the $x$ inside the integral. Apr 24, 2017 at 17:32
• @AccidentalFourierTransform Indeed, assuming $x$ and $t$ are independent variables. Apr 24, 2017 at 17:33
• @AccidentalFourierTransform The point is you can't bring in the variable of integration from outside, because it doesn't exist outside (in programming terms, it's a nested scope). Anything outside has to be "something different" (to the variable of integration) and so really ought to have a different name, if for no other reason than clarity. Apr 25, 2017 at 12:31

It is better to understand more deeply about this whole "variable of integration" thing. The definite integral denoted by symbol $$\int_{a}^{b}f(x)\,dx\tag{1}$$ is actually dependent only on two things: the function $f$ being integrated and the interval $[a, b]$ of integration. The most common way to represent a function is by giving an explicit formula to compute the image under the function written using some variable $x$ and then $f(x)$ denotes the image of $x$ under $f$. Thus in equation $(1)$ the symbol $x$ in $f(x)$ and in $dx$ is dummy. It serves no other purpose than to represent the function. In fact the whole $dx$ does not serve any purpose at all except that it helps to memorize the technique of substitution in evaluation of integrals.

Thus we may well represent the integral in $(1)$ just via the symbol $$\int_{a}^{b}f\tag{2}$$ if we know the function $f$ being talked about. But as I said earlier most convenient notation for functions has turned out to be giving a formula for image under $f$ using some variable so that the equation $(1)$ is the preferred notation compared to $(2)$.

But when we use an independent variable just to express the function, we must understand that it does not serve any more purpose than that. The variable $x$ in your question which lies outside the integral serves a different purpose. Most probably it is representing some real number in a given context and the integral after it is just another real number. But if we bring the $x$ (lying outside the integral) inside the integral sign it does interfere with the expression of the function being integrated. It is best to use a different variable under the integral sign to avoid confusion.

The same problem can be seen in the case of limit operation when we are dealing with an expression like $$x\lim_{x \to a}f(x)\tag{3}$$ Again understand that the expression $\lim_{x \to a}f(x)$ is dependent only on function $f$ and point $a$ and the symbol for a variable $x$ is used only because that is the most convenient way to represent a function and the variable under limit operation is thus a dummy variable and if there is a need (to avoid confusion) we may well replace it with any other symbol we wish to use.

You can also give similar remarks about the notation $$\frac{d}{dx}f(x) = g(x)\tag{4}$$ and I leave it as an exercise for you.

I like to write integrals as operators on functions, as much as possible1:

$$\int_0^1{x^2}\,\mbox{d}x = \int_0^1f$$ with $$f(x) = x^2.$$

Then your question becomes whether

$$x\int_0^1f = \int_0^1{xf}.$$

Well... because there is no "integration variable", it is clear that $x$ is a constant for the purposes of integration. So, written like that, it is ok. It is the same as $\int_0^1xt^2\,\mbox{d}t$ in StackTD's answer.

On the other hand, the $\mbox{d}x$ inside the integral "captures" your $x$, and it would be interpreted as being another appearance of the integration variable. The meaning of the expression changes.

1. At least for single-parameter functions...

I'm going to reiterate my popular point from the comments: in calculus of functions of a single variable, we see (in the coarsest sense) two sorts of variable quantities appearing in functions: those that are internal to the operations on functions, and disappear once we complete the operation, which we call bound variables and the true variables on which the problem originally depended (which by analogy are unbound). (These names are from logic, where the thrust of the argument is that bound variables don't act like variables at all.) Bound variables essentially always turn out to be an artefact of notation in calculus, but frequently the weird conventions are useful when actually evaluating the objects, rather than speaking theoretically.

The first place one normally encounters a bound variable is in a limit. We speak of the limit of a function $f$ at a point $a$—no mention of a variable! But what we write is $$\lim_{x \to a} f(x).$$ We could write this as $l(f,a)$, since $l$ is a function of only these two things, but somehow the first notation feels better: we imagine, Newton-like, the point $x$ creeping towards $a$ until its ultimate value is $l(f,a)$ (which is the same as $f(a)$ if the function is continuous). But what we called this creeping point is irrelevant: $\lim_{y \to a} f(y)$ is the same thing. (One makes here a distinction with the conventions of physicists, who like to think their letters actually mean things, so $t$ is always a time, and $x$ a displacement, and so on. But it is mathematics that we are discussing.) And as you've probably noticed, this notation is universal: literally no one writes their limits with this function $l$. This is probably because quite often we need to talk about complicated combinations of functions, to which we do not wish to give a specific name, if only to avoid running out of letters (which is a constant problem in long proofs!). (Also, the more layers of naming we give to functions, the harder it is to remember what we are talking about in the first place.)

When we move up to the derivative, however, there is a common notation that doesn't carry bound variables around (and it's not Newton's notation: although $\dot{x}$ carries no bound variables, Newton's notation carries instead the baggage of a tacit assumption about parametrisation): Lagrange's notation $$f'(a) = \lim_{x \to a} \frac{f(x)-f(a)}{x-a}.$$ Of course, we're all huge fans of the chain rule around here, and somehow $(f \circ g)' = (f' \circ g) \cdot g'$ just doesn't have that memorable pop. On the other hand, Leibniz's notation $$\frac{df}{dx}$$ makes the basic statement of the chain rule accessible to anyone who can manipulate fractions, even if we know that this is an ill way to think about it. Thing is, $df/dx$ is not actually the correct notation ($f$ is a "pure" function, so doesn't actually have a dependence on $x$: what Leibniz would do is write $y=$ [some expression involving $x$s], and then $y$ does depend on $x$, so $$\frac{dy}{dx}$$ is a well-defined thing that gives you the function expressing the gradient of the tangent line as $x$ varies. We should write $df(x)/dx$, but this looks terrible, and isn't a "pure" function anymore: it's stuck depending on $x$. To evaluate the gradient at a point, one has to resort to the notation $$\frac{df}{dx}(a),$$ which again doesn't really make sense, or $$\left. \frac{df}{dx} \right|_{x=a},$$ which is really beyond the pale (and sadly, survives in differential geometry texts, where the basis of $T_pM$ is often called $\partial_i \mid_p$, or worse, $\left. \frac{\partial}{\partial x_i} \right|_p$). So to be totally precise, you end up with $$\left.\frac{dy}{dx} \right|_{x=a} = \left.\frac{dy}{du} \right|_{u=u(a)} \left.\frac{du}{dx} \right|_{x=a},$$ which is really no more mnemonic than the Lagrange notation.

Anyway, where was I? So the Leibniz-style derivative also contains a bound variable, but you don't normally notice (this also demonstrates what is wrong with writing $df/d2$, for example: $2$ is not a variable, so it can't be a bound variable: the bound variable cannot exist outside the expression in which it is bound.

To finally reach the point, the same is true in integration, but much more so, since the Leibnizian $\int_a^b f(x) \, dx$ dominates completely. (Newton had the rather sweet notation $\boxed{x}$ for the integral (integration being referred to as "squaring" a curve in them days), and that you've never heard of this should give you an indication of how popular that became.) The integral is, to a first approximation of a definition, the area under a curve. As Paramanand Singh's answer notes, this only depends on two things: the set over which one integrates, and the function. Hence one may write, without ambiguity, $$\int_a^b f.$$ But as anyone who has ever evaluated an integral knows, manipulating pure functions is much more difficult than manipulating what are essentially algebraic expressions, so $$\int_a^b f(x) \, dx$$ is much, much easier to work with. But once again, the $x$ inside the integral only has life and meaning inside it. Hence, while we can use the same letters for bound and unbound variables, we really shouldn't: this is why $F(y):=\int_a^b f(x,y) \, dx$ is only a function of $y$. But if we write $F(x) = \int_a^b f(x,x) \, dx$, it becomes uninterpretable: there is no way to distinguish the bound from the unbound. One has even worse problems dealing with the so-called "indefinite integral", $\int f(x) \, dx$, but this essay's already long enough!

Now, as far as the second part of your question goes, what you need to know is the following recurrence relation for the derivatives of Bessel functions: $$(rJ_1(r))' = rJ_0(r)$$ Hence one immediately obtains $$\int_0^1 rJ_0(\lambda_m r) \, dr = \frac{1}{\lambda_m} J_1(\lambda_m).$$ For the denominator, one has in addition the relation $J_0'(r) = -J_1(r)$, so one finds that $$\left( \frac{1}{2}r^2(J_0(r)^2 + J_1(r)^2) \right)' = rJ_0(r)^2,$$ and so $$\int_0^1 rJ_0(\lambda_m r)^2 \, dr = \frac{1}{2}(J_0(\lambda_m)^2 + J_1(\lambda_m)^2) = \frac{1}{2}J_1(\lambda_m)^2,$$ which will then cancel into the answer you want.