# Calculating a double integral

I want to calculate the following integral: $$\int^{10}_{0}\int^{\pi}_{0}\sqrt{(37-\frac{45\cdot37\cdot x^2}{74\cdot 150})^2\cdot \sin(t)^2-(40-\frac{27\cdot37\cdot x^2}{16\cdot 150})^2\cdot \cos(t)^2}\,dt\,\,dx$$

It is rather a complex integral and I am not sure how to solve it all at once. I have tried first calculating the inner integral, ie: $$\int^{\pi}_{0}\sqrt{(37-\frac{45\cdot37\cdot x^2}{74\cdot 150})^2\cdot \sin(t)^2-(40-\frac{27\cdot37\cdot x^2}{16\cdot 150})^2\cdot \cos(t)^2}\,dt$$

Here is the respective Mathematica code:

    Integrate[ Sqrt[(37 - 45 37x^2/(74 150))^2) Sin[t]^2
-(40 - 27 37x^2/(16 150))^2) Cos[t]^2], {t, 0, Pi}]


The answer included an elliptic integral function (EllipticE), where one of the parameters is expressed in terms of $$x$$.

Then I tried using the command Integrate[%,{x,0,10}] in order to compute the full integral shown above (where % is the answer of the inner integral, as in my notebook it is the last generated result). However, Mathematica did not compute it. Instead it displayed the input in the symbolic form.

Why did it do that? What can I do in order to compute the full integral?

• You may put Mathematica code in your question. Besides, mma may not able to calculate it, I guess. – wuyudi Jan 2 at 19:26
• Have you tried using NIntegrate? – MarcoB Jan 2 at 19:37
• @MarcoB NIntegrate just returns multiple errors, It does not work – user10764803 Jan 2 at 20:02
• NIntegrate[ Sqrt[((37) - ((45*37*x^2)/(74*150))^2)* Sin[t]^2 - ((37) - ((27*37*x^2)/(16*150))^2)*Cos[t]^2], {t, 0, Pi}, {x, 0, 10}] produces 268.756 + 35.8662 I and a warning about the slow convergence. – user64494 Jan 2 at 20:08
• The integrand in your Mathematica code is different than that in the TeX form. Which one are you going to integrate? – Artes Jan 2 at 20:16

This is an interesting example where new improvements in version Mathematica 12.2 of elliptic functions handling appear important to get a correct result.

TraditionalForm[
intd[x_] = FullSimplify[
Integrate[ Sqrt[(37 - (45 37 x^2)/(74 150))^2 Sin[t]^2
- (40 - (27 37 x^2)/(16 150))^2 Cos[t]^2],
{t, 0, Pi}, Assumptions -> #], #] &[0 <= x <= 10]] while in version 12.1 this yields intdX:

intdX[x_]=  1/10 (740-3x^2) EllipticE[1 + (32000-333 x^2)^2/(1600 (740-3x^2)^2)]


Let's compare the integrands in 12.2 and in the former version

GraphicsRow[
Plot[ ReIm @ #[x], {x, 0, 10}, PlotStyle -> Thick, Evaluated -> True,
PlotLabels -> Placed[{"Re", "Im"}, Above]] & /@ {intd, intdX}] If the system returns the "unevaluated" formula it means that there is no simpler expression in terms of the known (to the system) functions. This is why we use numerical integration:

NIntegrate[ intd[x], {x, 0, 10}]

 433.168


while

NIntegrate[ intdX[x], {x, 0, 10}]

 433.168 + 293.062 I


12.2.0 for Mac OS X x86 (64-bit) (December 12, 2020)

gives these results using antiderivate with integration limits 0 and Pi:

Plot[{Re[NIntegrate[Sqrt[(37 - 45*37*(x^2/(74*150)))^2*Sin[t]^2 -
(40 - 27*37*(x^2/(16*150)))^2*Cos[t]^2], {t, 0, Pi},
WorkingPrecision -> 50]],
Im[(1/400)*(32000 - 333*x^2)*
EllipticE[(1900160000 - 28416000*x^2 + 125289*x^4)/
(32000 - 333*x^2)^2]]}, {x, 0, 8},
PlotStyle -> {Blue, Dashed}]

Plot[{Im[NIntegrate[Sqrt[(37 - 45*37*(x^2/(74*150)))^2*Sin[t]^2 -
(40 - 27*37*(x^2/(16*150)))^2*Cos[t]^2], {t, 0, Pi}]],
Re[(1/400)*(32000 - 333*x^2)*
EllipticE[(1900160000 - 28416000*x^2 + 125289*x^4)/
(32000 - 333*x^2)^2]]}, {x, 0, 8},
PlotStyle -> {Blue, Dashed}]

• Interestingly the Hypergeometric function appears, if the range of x is extended to 10... – Andreas Jan 3 at 11:42
• 40 - (333*x^2)/800 changes sign at x about 9.8 – Andreas Jan 3 at 11:59