This question was also asked here and here.

I have faced some difficulties to do the following integral:

$$ I=\int_{0}^{2\pi}d\phi\int_{0}^{\pi}d\theta~\sin\theta\int_{0}^{\infty}dr~r^2\frac{3x^2y^2\cos(u r \sin\theta \cos\phi)\cos^2\theta}{(y^2\cos\phi+x^2\sin^2\phi)\sin^2\theta+x^2y^2\cos^2\theta}\mathrm e^{-\frac{r^2}{2}} \tag{1}, $$

where $x$, $y$, and $u$ are real positive constants. I tried at least two ways to solve this integral:

  • First attempt:

I began to solve the $r$ integral first. By using Mathematica, then

$$ I=\int_{0}^{2\pi}d\phi\int_{0}^{\pi}d\theta~\sin\theta\frac{3x^2y^2(1-u^2\sin^2\theta\cos^2\phi)\cos^2\theta}{(y^2\cos\phi+x^2\sin^2\phi)\sin^2\theta+x^2y^2\cos^2\theta}\mathrm e^{-\frac{u^2}{2}\sin^2\theta\cos^2\phi} \tag{2}. $$

After that, I looked for a solution for $\phi$ integral. My best attempt was:

$$ I_\phi(x,y,u,\theta)=\frac{2}{B}\left[B\left(\frac{1}{2}\right)F_1\left(\frac{1}{2},1,-;1;\nu,-\frac{a}{2}\right)-aB\left(\frac{1}{2}\right)F_1\left(\frac{3}{2},1,-;2;\nu,-\frac{a}{2}\right)\right], $$

where $B=x^2\sin^2\theta+x^2y^2\cos^2\theta$, $a=u^2\sin^2\theta$, and $\nu=\frac{x^2-y^2}{x^2+x^2y^2\cot^2\theta}$. In this way, the final results it's something like that:

$$ I= \int_{0}^{\pi} \mathrm d \theta~3x^2y^2\sin\theta \cos^2\theta~ I_\phi(x,y,u,\theta). \tag{3}. $$

Eq. $(3)$ cannot be further simplied in general and is the nal result.

  • Second attempt:

To avoid the hypergeometric function $F_1$, I tried to start with the $\phi$ integral. In this case, my initial problem is an integral something like that:

$$ \int_{0}^{2\pi} \mathrm d \phi \frac{\cos(A \cos\phi)}{a^2\cos^2\phi+b^2\sin^2\phi}. \tag{4} $$

This integral $(4)$ can be solved by series (see Vincent's answer and Jack's answer). However those solutions, at least for me, has not a closed form. This is my final step on this second attempt :(

What is the point? It turns out that someone has managed to solve the integral $(1)$, at least the integral in $r$ and $\phi$. The final resuls found by this person was:

$$ I_G=\frac{12 \pi x~y}{(1-x^2)^{3/2}}\int_{0}^{\sqrt{1-x^2}} \mathrm dk \frac{k^2 \exp\left(-\frac{u^2}{2}\frac{x^2k^2}{(1-x^2)(1-k^2)}\right)}{\sqrt{1-k^2}\sqrt{1-k^2\frac{1-y^2}{1-x^2}}}, $$

where, I belive, $k=\sqrt{1-x^2}\cos\theta$. As you can see in this following code performed in Mathematica

IG[x_, y_, u_] := 
     Sqrt[Pi/2] NIntegrate[(12  Pi x y)/(1 - x^2)^(3/2)
    (v^2 Exp[-(u^2 x^2 v^2)/(2 (1 - x^2) (1 - v^2))])/(Sqrt[1 - v^2] Sqrt[1 - v^2 (1 - y^2)/(1 - x^2)]), {v, 0, Sqrt[1 - x^2]}]
    IG[.3, .4, 1]
    ** 4.53251 **

I[x_, y_, u_] := 
 NIntegrate[(r^2 Sin[a] Cos[
      u r Sin[a] Cos[b]] 3 x^2 y^2 Cos[a]^2 Exp[-r^2/
       2])/((y^2 Cos[b]^2 + x^2 Sin[b]^2) Sin[a]^2 + 
     x^2 y^2 Cos[a]^2), {r, 0, Infinity}, {a, 0, Pi}, {b, 0, 2 Pi}]
I[.3, .4, 1]
** 4.53251 **

the integrals $I$ and $I_G$ are equals. Indeed, since that they emerge from the same physical problem.

So, my question is: what are the steps applied for that integral $I$ gives the integral $I_G$?


Since my question was not solved yet, I think it is because it is a tough question, I will show a particular case of the integral $I$, letting $u=0$. I hope with this help you help me.

In this case, the $r$ integral in $(1)$ is trivial and the integral takes the form:

$$ I_P=\int_{0}^{2\pi}d\phi\int_{0}^{\pi}d\theta~\sin\theta\frac{3x^2y^2\cos^2\theta}{(y^2\cos\phi+x^2\sin^2\phi)\sin^2\theta+x^2y^2\cos^2\theta}. \tag{5} $$

The $\phi$ integral can be integrated with the help of Eq. 3.642.1 in Gradstein and Ryzhik's tables of integrals. Thereby, the $I_P$ takes the for:

$$ I_P=3xy\int_{0}^{\pi}d\theta\frac{\sin\theta\cos^2\theta}{\sqrt{1+(x^2-1)\cos^2\theta}\sqrt{1+(y^2-1)\cos^2\theta}}. \tag{6}$$

Now the change of variable $k=\sqrt{1-x^2}\cos\theta$ bring expression $(6)$ to the form

$$ I_P= \frac{(const) x~y}{(1-x^2)^{3/2}}\int_{0}^{\sqrt{1-x^2}} \mathrm dk \frac{k^2}{\sqrt{1-k^2}\sqrt{1-k^2\frac{1-y^2}{1-x^2}}}. $$

Did you notice how $I_G$ and $I_P$ are similar? Do you think a similar approach can be applied to my original problem? Please, let me know.

I've solved this problem applying the Schwinger proper-time substitution: $$\frac{1}{q^2}=\int_{0}^{\infty}\mathrm{d\xi}~\mathrm{e^{-q^2\xi}}. $$

  • 7
    $\begingroup$ Why the downvote? $\endgroup$ Aug 22, 2018 at 0:58
  • 2
    $\begingroup$ I guess the downvote could be because the title is rather uninformative, and sounds much like the titles of many low-quality questions that appear on math.stackexchange.com from students wanting homework solutions. A more informative title could be something like “How to derive Mathematica’s solution for this integral in 3-d polar co-ordinates involving nested trig functions?” $\endgroup$ Aug 31, 2018 at 12:41
  • 1
    $\begingroup$ @PeterLeFanuLumsdaine Thanks for the suggestion. But Mathematica failed to do the integral $(1)$. So, there's no " Mathematica’s solution". $\endgroup$ Aug 31, 2018 at 12:49
  • 2
    $\begingroup$ Dinesh: Fair enough, I had misunderstood what you wrote about what Mathematica gave. But my main point was just that it’s good to make the title as specific and informative as possible :-) $\endgroup$ Aug 31, 2018 at 12:58

2 Answers 2


Here is an outline of the approach I have taken to solve this integral.

First rewrite the integral $(1)$ in Cartesian variables:

$$I=\int_{-\infty}^{\infty} \mathrm{d}^3v~ \frac{3x^2y^2v_z^2}{y^2v_x^2+x^2v_y^2+x^2y^2v_z^2}\cos(uv_x)\exp\left(-\frac{v_x^2}{2}-\frac{v_y^2}{2}-\frac{v_z^2}{2}\right). $$

Now use the following substitution

$$ \frac{1}{y^2v_x^2+x^2v_y^2+x^2y^2v_z^2}=\int_{0}^{\infty}d\tau~\mathrm{ e^{-(y^2v_x^2+x^2v_y^2+x^2y^2v_z^2)\tau}},$$

such that

$$ I=\int_{0}^{\infty}d\tau\int_{-\infty}^{\infty} \mathrm{d}^3v~3x^2y^2v_z^2\cos(uv_x) \mathrm{e^{-v_x^2(\tau y^2+1/2)-v_y^2(\tau x^2+1/2)-v_z^2(\tau x^2y^2+1/2)}}. $$

The $(v_x,v_y,v_z)$ can be evaluated with the help of Mathematica. The results gives

$$ \int_{-\infty}^{\infty} \mathrm{d}^3v~3x^2y^2v_z^2\cos(uv_x) \mathrm{e^{-\alpha v_x^2-\beta v_y^2-\gamma v_z^2}}=\frac{3\pi^{3/2}}{2x^2y^2}\frac{\exp\left(-\frac{u^2}{4y^2}\frac{1}{\tau+1/2y^2}\right)}{\left(\tau+1/2x^2y^2\right)^{3/2}\left(\tau+1/2x^2\right)^{1/2}\left(\tau+1/2y^2\right)^{1/2}}.$$


$$ I= -\frac{3~\mathrm{const}}{x^2y^2~\mathrm{const}}\int_{0}^{\infty}\mathrm{d\tau}\frac{\exp\left(-\frac{u^2}{4y^2}\frac{1}{\tau+1/2y^2}\right)}{\left(\tau+1/2x^2y^2\right)^{3/2}\left(\tau+1/2x^2\right)^{1/2}\left(\tau+1/2y^2\right)^{1/2}}. $$

Now, performing the substitution $\tau=\frac{1-x^2}{2x^2y^2k^2}-\frac{1}{2x^2y^2}$ gives us

$$ I=(\mathrm{const})~\frac{3x~y}{(1-x^2)^{3/2}}\int_{0}^{\sqrt{1-x^2}}\mathrm{dk}\frac{k^2\exp\left(-\frac{u^2}{2}\frac{x^2k^2}{\left(1-x^2\right)\left(1-k^2\right)}\right)}{\sqrt{1-k^2}\sqrt{1-k^2\frac{1-y^2}{1-x^2}}}, $$

which is the desired integral unless of a constant. ;)

  • 2
    $\begingroup$ What's the answer? $\endgroup$
    – David Roberts
    Aug 30, 2018 at 6:31
  • $\begingroup$ @DavidRoberts Follow these steps. in the end you will get the integral $I_G$. Please, let me know if this is clear. $\endgroup$ Aug 30, 2018 at 9:41
  • 6
    $\begingroup$ I don't own Mathematica, nor do I care enough to go and figure out the actual integral. But this answer will be most useful for future readers if you give us the output. $\endgroup$
    – David Roberts
    Aug 30, 2018 at 10:18
  • 1
    $\begingroup$ Thank you. I will improve my answer. $\endgroup$ Aug 30, 2018 at 10:23

Here is an outline for a possible approach for the first integral: expand $e^{a\cos^2x}=\sum_ka^2\frac{\cos^{2k}x}{k!}$. So, focus on $J_k:=\int_0^{\pi/2}\frac{\cos^{2k}x}{b^2\cos^2x+c^2\sin^2}dx$. Notice that $I_k:=\int_0^{2\pi}\frac{\cos^{2k}x}{b^2\cos^2x+c^2\sin^2}dx=4J_k$. This allows for contour integration over the circle $\vert z\vert=1$, using complex analysis, by letting $z=e^{ix}$: $$I_k=\frac1{4^{n-1}i}\int_{\vert z\vert=1}\frac{(z^2+1)^{2n}}{(\alpha z^2+\beta)(\beta z^2+\alpha)z^{2n-1}}\,dz$$ where $\alpha=b+c$ and $\beta=b-c$.

I would leave the details to you.

  • 1
    $\begingroup$ Thank you for your time. This approach was also proposed by Jack in Mse. I'm not familiar with contour integration, but Mathematica can do the integral $J_k$. It gives: $$\frac{1}{2} \pi \sec (\pi k) \left(\frac{\left(\frac{c^2}{b^2}\right)^{k+\frac{1}{2}} \left(1-\frac{c^2}{b^2}\right)^{-k}}{c^2}-\frac{\sqrt{\pi } \, _2\tilde{F}_1\left(\frac{1}{2},1;\frac{3}{2}-k;\frac{c^2}{b^2}\right)}{b^2 \Gamma (k)}\right)$$ It seems not useful to me :( $\endgroup$ Aug 22, 2018 at 9:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.