# Why can't Mathematica compute this integral $\int_{0}^{\pi/2} \frac{1-a \cos^2x}{1+b\sin^2x} \mathrm e^{-\frac{a}{4}\cos2x}\mathrm d x$?

This question was also asked here.

I have faced some difficulties to do the following integral

$$\int_{0}^{\pi/2} \frac{1-a \cos^2x}{1+b\sin^2x}\mathrm e^{-\frac{a}{4}\cos2x}\mathrm d x,$$

where $a$ and $b$ are constants under $x-$variable. I'm sure this can be solved analytically. However, Mathematica doesn't give explicit answer. My code:

 Integrate[((1 - a Cos[x]^2) Exp[-a/4 Cos[2 x]])/(1 + b Sin[x]^2), {x,0, Pi/2},
Assumptions -> a > 0 && b > 0]


I have found a closed expression in terms of Hypergeometric series. It's Something like that:

Limit[AppellF1[3/2, 1, 1/k, 2, x, k y], k -> 0],


but this not work for me. If you kindly give me some hint or text such that on going through which I can do it by myself. Thanking you.

Edit: Solution in terms of $F_1$:

Here my solution in terms of series. The original integral is that

$$\int_{0}^{2\pi}\mathrm d\phi\int_{0}^{\pi}\mathrm d\theta~\sin\theta\frac{(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{1}$$

where $x$, $y$ and $u$ are positive constants. I tried to do the $\phi$ integral first. Letting $I_\phi$ this $\phi$-integral, then:

$$I_\phi=4\int_{0}^{\pi/2}\mathrm d\phi\frac{1-a\cos^2\phi}{A\cos^2\phi+B\sin^2\phi} \mathrm e^{-\frac{a}{2}\cos^2\phi}.$$

The change of variable $\cos^2\phi=t$ give us

$$I_\phi= \frac{2}{B}\int_{0}^{1}\frac{\mathrm dt}{\sqrt{t}\sqrt{1-t}}\frac{1-at}{1-\nu t}\mathrm e^{-\frac{a}{2}t},$$

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}$. According to this we have then

$$I_\phi=\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]$$

That is my solution until now.

Edit 2

If you prefer, the more general case of the equation (1) is:

$$I= \int_{0}^{2\pi}\mathrm d\phi\int_{0}^{\pi}\mathrm d\theta~\sin\theta\int_{0}^{\infty}\mathrm dr~r^2\frac{\cos(u r \sin\theta \cos\phi)3x^2y^2\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{2}$$

EDIT 3

Here is a solution of the equation $(2)$, wich was found by another person.

$$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}}}.$$

Notice that,numerically,

$$I_G=\sqrt{\frac{2}{\pi}} I$$

as you can see in this 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 **


Therefore, it is possible to find an elementary closed form for $I_\phi$. What do you say?

Edit: that is just a detail

My question comes down to: what steps were taken to get from $I$ to $I_G$.

I let Mathematica run overnight, but it was unable to compute the integral $I$. However, it also didn’t “give up”. What do you say about that? Maybe another CAS will work?

• As for doing integration, you might be interested in Rubi Aug 18, 2018 at 6:24
• Why are you sure it can be solved analytically? Both Mathematica and Rubi are unable to do it with a=b=1. And what is wrong with an answer in terms of hypergeometric functions? Aug 18, 2018 at 7:04
• You might want to consider asking from mathematics site.
– Kiro
Aug 18, 2018 at 9:07
• @FredSimons I'm sure that this integral is solved analytically because it was solved by an acquaintance of mine. And, apparently, he solved it in terms of elementary functions. That's because my hypergeometric solution doesn't work for me. Aug 18, 2018 at 11:46
• Could you convert it into a differential equation in a and b? Aug 18, 2018 at 16:06

@user3321: if you report the solution in your possession it is more likely that you can help in finding a trick to use in MMA.

For now, the only thing that comes to mind is to get an idea of the solutions when the positive parameters a and b change:

points = Table[{a, b, NIntegrate[((1 - a Cos[x]^2) Exp[-a/4 Cos[2 x]])/(1 + b Sin[x]^2),
{x, 0, Pi/2}]}, {a, 0, 20, .5}, {b, 0, 20, .5}];
ListPointPlot3D[points, PlotRange -> All] • Thank you for your help. I'll post my solution soon. Aug 18, 2018 at 18:56
• Did you see my edit? Aug 18, 2018 at 22:46