0
$\begingroup$

I'm trying to estimate this integrate: enter image description here

Here Θ is the Heaviside theta function. And I can use

PR[k_] := 2.1*10^-9 (k/0.05)^.04

I want to solve this integral for a set of "k" from 0.05 to 10^20.

For beginning I tried to solve this just for "k==10^5" But after 2 hours running nothing happened.

I used this simple command:

enter image description here

1/12 Integrate[((4 v^2 - (1 + v^2 - u^2)^2)/(4 v u))^2 (3/(
4 u^3 v^3))^2 (u^2 + v^2 - 
 3)^2 ((-4 u v + (u^2 + v^2 - 3) Log[(3 - (u + v)^2)/(
     3 - (u - v)^2)])^2 + \[Pi]^2 (u^2 + v^2 - 
    3)^2 HeavisideTheta[v + u - Sqrt[3]]) PR[k u] PR[k v], {u, Abs[1 - v], Abs[1 + v]}, {v, 0, Infinity}]

Is this happen because of my weak system or I have some mistakes?

Thanks for your helps

$\endgroup$
9
  • 2
    $\begingroup$ Are you looking for an analytical answer? Have you tried NIntegrate instead? $\endgroup$
    – MarcoB
    Commented May 27, 2020 at 13:01
  • 1
    $\begingroup$ And if you're looking for a closed-form analytical answer, do you have reason to believe that one exists? $\endgroup$ Commented May 27, 2020 at 13:05
  • 1
    $\begingroup$ @MarcoB NInegrate does not support Abs[x] in the limit of integrations. For example NIntegrate[Sin[x], {x, Abs[1 - x], Abs[1 + x]}] gives error. I never seen integral with such limits myself before. $\endgroup$
    – Nasser
    Commented May 27, 2020 at 13:06
  • 1
    $\begingroup$ You are going to have hard time getting this to integrate. Even the indefinite integral seems to hang. And when using Integrate it is not a good idea to use non-exact numbers. ` 2.1*10^-9 (k/0.05)^.04` you can change these to exact numbers. $\endgroup$
    – Nasser
    Commented May 27, 2020 at 13:08
  • 2
    $\begingroup$ @Nasser It would support such limits of integration with Abs if they become numerical: see e.g. NIntegrate[Sin[x y], {x, -10, 10}, {y, Abs[1 - x], Abs[1 + x]}], which works fine. Your example does not work because the limits of integration are non-numerical, not because they contain Abs. $\endgroup$
    – MarcoB
    Commented May 27, 2020 at 13:13

1 Answer 1

6
$\begingroup$

As I noted in the comments, it seems unlikely that an analytic closed-form solution to this integral exists. However, if all you need is a numerical integral, then you can use the Region method to specify the region of integration.

PR[k_] := 2.1*10^-9 (k/0.05)^.04
k = 10^5;
1/12 NIntegrate[((4 v^2 - (1 + v^2 - u^2)^2)/(4 v u))^2 (3/( 4 u^3 v^3))^2 (u^2 + v^2 - 3)^2 ((-4 u v + (u^2 + v^2 - 3) Log[(3 - (u + v)^2)/(3 - (u - v)^2)])^2 + \[Pi]^2 (u^2 + v^2 - 3)^2 HeavisideTheta[v + u - Sqrt[3]]) PR[k u] PR[k v],
  {u, v} \[Element] ImplicitRegion[Abs[1 - v] < u < Abs[1 + v], {u, v}]]

The method of specifying ranges of integration for u and v does not work in this case because the bounds with respect to u depend on the value of v, and NIntegrate does not allow the bounds of integration to depend on other variables when specified in this form. The use of ImplicitRegion gets around this restriction.

Alternately, if one defines $x = u + v$ and $y = u - v$, then the region of integration becomes $x \geq 1$ and $-1\leq y \leq 1$. Under the appropriate substitutions in the integrand, one could easily integrate this over the range {x, 1, Infinity} and {y, -1, 1}. Note that you will have to insert a Jacobian into the integral to account for the different volume element in these coordinates (I believe it works out to be 1/2 in this case.)

This said, I suspect that your integral may have an error. Specifically, the logarithm function looks strange; there are points in your range of integration for which its argument is positive, but also points for which its argument is negative. This yields a complex result in the end, and Mathematica is not confident in its results due to the resulting divergence of the integrand. Perhaps you need an absolute value on the argument?

$\endgroup$
7
  • $\begingroup$ Dear @MichaelSeifert, I don't want an analytical answer but as you said NIntegrate isn't suitable for this problem. I tried to use your answer but the problem still exist. $\endgroup$
    – milad
    Commented May 27, 2020 at 15:39
  • $\begingroup$ @milad: Sorry, I made a slight error. I meant my code to use NIntegrate rather than Integrate. I've edited it appropriately; you might want to try it again. $\endgroup$ Commented May 27, 2020 at 17:29
  • $\begingroup$ I noticed the typo and use NIntegrate. I let to code run for 30min but as I said the problem still exist. Also I'm not sure about changing integration sequence in this special inregral. did you run this command? $\endgroup$
    – milad
    Commented May 27, 2020 at 17:36
  • $\begingroup$ Running the code as I've posted it above on a fresh kernel leads to a result on my machine within about 5 seconds. What version of Mathematica are you using? $\endgroup$ Commented May 27, 2020 at 17:41
  • 1
    $\begingroup$ @milad: There's also a possible technique using change of variables, if you're not sure about the use of ImplicitRegion. See my edited answer. $\endgroup$ Commented May 27, 2020 at 18:26

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.