Wikipedia:Reference desk/Archives/Mathematics/2019 August 25

= August 25 =

Multiple integration tricks
If I wanted to integrate something like cos(ax+by+cz) or exp(ax+by+cz) over the unit ball, I could simply apply a coordinate rotation to make the vector (a,b,c) point along one of the axes, and then it'd become easy. Is there a trick to make this work for doing something like x cos(ax+by+cz) or x exp(ax+by+cz) over the same region? Normally in 1D you'd use integration by parts for products xeax, but in 3D I can't rotate to make the argument look nice without messing up the other factor. Double sharp (talk) 10:31, 25 August 2019 (UTC)
 * But you should "mess up" the other factor if it simplifies what's in the exponential! I assume you want something more than just splitting the exponential into factors.--Jasper Deng (talk) 10:37, 25 August 2019 (UTC)
 * Your integrals can be re-written as:
 * $$\oint\limits_{|\mathbf{r}|=1}(\mathbf{re}_x)\exp(\mathbf{ar})dS,$$ and
 * $$\oint\limits_{|\mathbf{r}|=1}(\mathbf{re}_x)\cos(\mathbf{ar})dS,$$
 * which means averaging over the unit sphere. You can try to calculate them using the spherical coordinates. Ruslik_ Zero 12:34, 25 August 2019 (UTC)
 * Could you walk me through the first few steps of this? If I try to simplify that dot product by coordinate rotation before converting to spherical coordinates (which is the trick I saw for the analogous easy integral without that r·ex factor, I end up with my original problem of messing up the ex component outside; is this the way I should go, or should I try to convert to spherical coordinates first? (I've been trying to teach myself some basic multivariable calculus over the last few days and got through the usual basic stuff about changing coordinates for multiple integrals that lets you do the analogous integrals without those x factors easily, so if the problem is that I'm asking something that becomes clear with some more advanced stuff please do tell me what I should be looking at.) Double sharp (talk) 16:24, 26 August 2019 (UTC)
 * Hint: use the cosine formula for the dot product.--Jasper Deng (talk) 18:26, 26 August 2019 (UTC)
 * You can even consider a more general problem with arbitrary vectors a and b:
 * $$\oint\limits_{|\mathbf{r}|=1}(\mathbf{rb})\exp(\mathbf{ar})dS=\frac{d}{d\lambda}\left[\oint\limits_{|\mathbf{r}|=1}\exp(\lambda\mathbf{br}+\mathbf{ar})dS\right]_{\lambda=0}=4\pi\frac{d}{d\lambda}\left[\frac{\sinh|\lambda\mathbf{b}+\mathbf{a}|}{|\lambda\mathbf{b}+\mathbf{a}|}\right]_{\lambda=0}=4\pi\frac{|\mathbf{a}|\cosh|\mathbf{a}|-\sinh|\mathbf{a}|}{|\mathbf{a}|^3}(\mathbf{ab}).$$
 * Ruslik_ Zero 20:23, 26 August 2019 (UTC)


 * You want a trick to compute an integral of the form $$\int_B(u\cdot x)f\big((v\cdot x)\big)dx$$, where $$B$$ is the Euclidean unit ball of $$\R^n$$,  $$u$$ and $$v$$  are given vectors in $$\R^n$$ and $$(x\cdot y)=\sum_{j=1}^n x_jy_j$$ denotes the standard scalar product (in fact, there exist no such things as tricks in mathematics).  As you recalled, for any rotation $$R\in O(n)$$ and any integrable function $$g$$ we have $$\int_B g(x)dx = \int_B g(Rx)dx$$, by rotation invariance. This means that the value of your integral  only depends, besides $$f$$, on the Euclidean norm of $$u$$ and of $$v$$, and their scalar product. Indeed, by a suitable rotation you may take $$u$$ to $$\|u\|e_1$$ and $$v$$ to $$\frac{(v\cdot u) }{\|u\|}e_1$$ plus something orthogonal to $$e_1$$... or even its opposite, since there are enough rotations to do so. Since this "something" enters linearly in the integral, we conclude it has no effect on it, so
 * $$\int_B (u\cdot x)f\big((v\cdot x)\big) dx=\frac{(v\cdot u) }{\|u\|} \int_B x_1 f(\|u\|x_1)dx $$
 * By Fubini's theorem, denoting $$\omega_k={\pi^{k/2}\over \Gamma(1+k/2)}$$ the k-volume of the unit ball of $$\R^k$$, we reduce to an integral on $$[-1,1]$$
 * $$\int_B x_1 f(\|u\|x_1)dx=\omega_{n-1}\int_{-1}^1 f(\|u\|t)(1-t^2)^{n-1\over2}tdt .$$pm a  20:43, 26 August 2019 (UTC)
 * Nitpick: the OP might be meaning the volume integral over the ball (not the surface integral over the sphere). But calculating either can yield the other with some work with the divergence theorem. Unfortunately, the cosine and exponential functions in three dimensions aren't harmonic, otherwise we could apply the mean-value property.--Jasper Deng (talk) 06:08, 27 August 2019 (UTC)
 * Ah – so the idea of coordinate rotation was right, but in my particular case I should be leaving the x-axis alone (in general I should rotate to make whatever vector I had in front simple, but since it was already i I don't need to do anything there), and then simply taking the x-component of a = (a,b,c) because the orthogonal components should have no effect? (And yes, I did mean the volume integral over the ball.) Trying this on the exponential problem I originally gave, x exp(ax+by+cz), I get $$\int_B (\mathbf{i} \cdot \mathbf{r}) \exp (\mathbf{a} \cdot \mathbf{r}) d\mathbf{r} = a \int_B (x \exp x) d\mathbf{r} = 2\pi a \int_{r=0}^{1} \int_{\theta=0}^{\pi} (r^{3} \cos \theta \sin \theta) \exp (r \cos \theta) d\theta dr = 2\pi a \int_{r=0}^{1} [r \exp (r \cos \theta) (1 - r \cos \theta)]_{\theta=0}^{\pi} dr$$ (rotation invariance should let me simplify things a little by setting up spherical coordinates "sideways" so that the x-axis points upwards, so that I can take x = r cos &theta;), and then after some algebra I got $$2\pi a (\frac{e^2 - 7}{e})$$. That agrees with pma's general answer: as expected it only depends on $$\mathbf{a} \cdot \mathbf{i} = a$$. I notice that Ruslik0's answer depends on |a| and hence the other components of a as well: is that because he is integrating over the unit sphere instead? Double sharp (talk) 07:43, 27 August 2019 (UTC)
 * This is because your result is wrong. The correct one will be:
 * $$\int\limits_{|\mathbf{r}|\le1}(\mathbf{rb})\exp(\mathbf{ar})dV=\frac{d}{d\lambda}\left[\int\limits_{|\mathbf{r}|\le1}\exp(\lambda\mathbf{br}+\mathbf{ar})dV\right]_{\lambda=0}=4\pi\frac{d}{d\lambda}\left[\int\limits_{0}^{1}r\frac{\sinh r|\lambda\mathbf{b}+\mathbf{a}|}{|\lambda\mathbf{b}+\mathbf{a}|}dr\right]_{\lambda=0}=4\pi\frac{d}{d\lambda}\left[\frac{\cosh|\lambda\mathbf{b}+\mathbf{a}|}{|\lambda\mathbf{b}+\mathbf{a}|^2}-\frac{\sinh|\lambda\mathbf{b}+\mathbf{a}|}{|\lambda\mathbf{b}+\mathbf{a}|^3}\right]_{\lambda=0}=4\pi\frac{(|\mathbf{a}|^2+3)\sinh|\mathbf{a}|-3|\mathbf{a}|\cosh|\mathbf{a}|}{|\mathbf{a}|^5}(\mathbf{ab}).$$
 * Ruslik_ Zero 17:59, 27 August 2019 (UTC)
 * Yeah, that does make a lot more sense: thank you for your help! I'll try the one with a cosine and come back with an answer. Double sharp (talk) 07:03, 28 August 2019 (UTC)
 * The integral with cosine is always zero. You would be better to try one with a sine. Ruslik_ Zero 10:53, 28 August 2019 (UTC)
 * All right. On further study I think I may have to wait a bit before I see how to do this – I still don't really understand what's going on in your first two equalities. (And I only just got to the divergence theorem Jasper Deng mentioned today in my attempt at teaching myself multivariable calculus...certainly all this is interesting stuff, even if some of this a bit hard to wrap my head around the first time! ^_^) Double sharp (talk) 15:19, 29 August 2019 (UTC)
 * P.S. I understand what you mean about there being no "tricks" here in mathematics: I should have phrased what I had in mind as "insightful approach". Double sharp (talk) 07:47, 27 August 2019 (UTC)

On revisiting this question five months later (and now actually better understanding multivariable calculus) I now wonder why it was so much of a problem in the first place, so thank you both for all your help! ^_^ FWIW, here is the most elementary approach I found for the first integrand: it is (r · i) exp (a · r) where a = (a, b, c). Change to an orthonormal basis with e3 pointing in the direction of a and change coordinates, so r = x i + y j + z k = X e1 + Y e2 + Z e3. The integrand now becomes (X e1 · i + Y e2 · i + Z e3 · i) exp (|a|Z). But the first two terms are zero as the integrand is odd in X and Y, and we know e3 · i = a/|a|, so the integral reduces to a/|a| times that of Z exp (|a| Z). Spherical coordinates then attack the rest of the problem routinely (with some integration by parts), and I confirm that I get Ruslik0's correct answer out of it. Again, thank you! Double sharp (talk) 00:37, 1 February 2020 (UTC)