# Different results solving the same integral?

**URL:** <https://community.wolfram.com/t/different-results-solving-the-same-integral/12468>\
**Category:** Questions\
**Tags:** mathematica, calculus\
**Created:** [May 14, 2018, 1:52pm UTC](https://community.wolfram.com/t/different-results-solving-the-same-integral/12468 "2018-05-14T13:52:45Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![enrodrig](https://avatars.discourse-cdn.com/v4/letter/e/9fc348/32.png) [@enrodrig](https://community.wolfram.com/u/enrodrig)\
**Post date:** [May 14, 2018, 1:52pm UTC](https://community.wolfram.com/t/different-results-solving-the-same-integral/12468/1 "2018-05-14T13:52:45Z")

</div>

I need to evaluate an integral as in the attached file, for general parameters a, b and c. I obtain a conditional 0 as result using the Integrate function.

However, when I evaluate the integral again (numerically and analitically) substituing the parameters a,b and c by numbers (which fulfill the conditions obtained before), the result is not zero.

Should I trust the result 0 for general parameters a, b and c, or not? What could be happening?

Thanks so much

---

<div class="post-metadata">

**Author:** ![trounev](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/trounev/32/7405_2.png) [@trounev](https://community.wolfram.com/u/trounev)\
**Post date:** [May 14, 2018, 3:38pm UTC](https://community.wolfram.com/t/different-results-solving-the-same-integral/12468/2 "2018-05-14T15:38:06Z")

</div>

We need to make an assumption for the integral. For example,

```
In[41]:= Integrate[
 1/Sqrt[(w^2 + a)]/((b - I*w)*(c + I*(w + ww))), {w, -Infinity, 
  Infinity}, Assumptions -> {a > 0, c > 0, b > 0, ww > 0}]

Out[41]= (I (MeijerG[{{1/2, 1, 1}, {}}, {{1/2, 1/2, 1}, {}}, -((
     I Sqrt[a])/b), 1/2] - 
   MeijerG[{{1/2, 1, 1}, {}}, {{1/2, 1/2, 1}, {}}, (I Sqrt[a])/b, 1/
    2]))/(2 Sqrt[a] \[Pi]^(3/2) (b + c + I ww))

```

---

<div class="post-metadata">

**Author:** ![mariuszi28cg](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mariuszi28cg/32/308_2.png) [@mariuszi28cg](https://community.wolfram.com/u/mariuszi28cg)\
**Post date:** [May 14, 2018, 4:13pm UTC](https://community.wolfram.com/t/different-results-solving-the-same-integral/12468/3 "2018-05-14T16:13:52Z")

</div>

Mathematica gives incorrect answer( **A bug !!!** ), is singular,a MMA has problems to calculate.

```
  (I (MeijerG[{{1/2, 1, 1}, {}}, {{1/2, 1/2, 1}, {}}, -((I Sqrt[a])/b), 
       1/2] - MeijerG[{{1/2, 1, 1}, {}}, {{1/2, 1/2, 
         1}, {}}, (I Sqrt[a])/b, 1/2]))/(2 Sqrt[
     a] \[Pi]^(3/2) (b + c + I ww)) /. a -> 1 /. b -> 1 /. 
  c -> 1 /. ww -> 1 // N

(* (0.0179587 + 0.0359174 I) ((-11.1367 - 11.1367 I) + 
   MeijerG[{{0.5, 1., 1.}, {}}, {{0.5, 0.5, 1.}, {}}, 0. - 1. I, 0.5])*)

```

Output gives no numeric answer.

```
   intsymbolic = (I (MeijerG[{{1/2, 1, 1}, {}}, {{1/2, 1/2, 
              1}, {}}, -((I Sqrt[a])/b), 1/2] - 
           MeijerG[{{1/2, 1, 1}, {}}, {{1/2, 1/2, 1}, {}}, (I Sqrt[a])/b,
             1/2]))/(2 Sqrt[a] \[Pi]^(3/2) (b + c + I ww)) /. {a -> 1, 
       b -> b, c -> 1, ww -> 1};
      Plot[Evaluate@ReIm[intsymbolic], {b, 9/10, 11/10}, PlotLegends -> "Expressions"] // Quiet

```

 ![ploteee.png](https://global.discourse-cdn.com/wolfram/original/2X/b/b1a79e407243867f91946680860d2e62813e91de.png)

As we can see here on the plot gives incorrect result 0.8 - 0.4 I. A correct answer is:1.395872 - 0.983636 I.

Solution by **Maple 2018.**

 ![5966Bez tytułu.png](https://global.discourse-cdn.com/wolfram/original/3X/8/3/83f71cbd30367dfd91861a76ed168e994a8baa4e.png)

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [May 14, 2018, 4:19pm UTC](https://community.wolfram.com/t/different-results-solving-the-same-integral/12468/4 "2018-05-14T16:19:16Z")

</div>

You may have hit a singular point. With the values `{ww -> 1., a -> 2., b -> 1., c -> 1.}` we get a numerical value.

---

<div class="post-metadata">

**Author:** ![trounev](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/trounev/32/7405_2.png) [@trounev](https://community.wolfram.com/u/trounev)\
**Post date:** [May 14, 2018, 4:42pm UTC](https://community.wolfram.com/t/different-results-solving-the-same-integral/12468/5 "2018-05-14T16:42:09Z")

</div>

In[2]:= (I (MeijerG[{{1/2, 1, 1}, {}}, {{1/2, 1/2, 1}, {}}, -((  
I Sqrt[a])/b), 1/2] -  
MeijerG[{{1/2, 1, 1}, {}}, {{1/2, 1/2, 1}, {}}, (I Sqrt[a])/b, 1/  
2]))/(2 Sqrt[a] [Pi]^(3/2) (b + c + I ww)) /. {a → 1.1,  
b → 0.5, c → 0.5, ww → 1.1}

```
Out[2]= 1.05409 - 1.1595 I

```

---

<div class="post-metadata">

**Author:** ![mariuszi28cg](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mariuszi28cg/32/308_2.png) [@mariuszi28cg](https://community.wolfram.com/u/mariuszi28cg)\
**Post date:** [May 16, 2018, 8:18am UTC](https://community.wolfram.com/t/different-results-solving-the-same-integral/12468/6 "2018-05-16T08:18:13Z")

</div>

I send e-mail to **WRI** support with this issue and they gave me the answer:

```
  Hello,
  
  Thank you for contacting Wolfram Technical Support. I understand that the following is not returning the correct result when 
  compared with the NIntegrate result. 
  
  Integrate[1/(Sqrt[1+w^2] ((1+I)+w+w^2)),{w,-Infinity,Infinity}]
  
  The fundamental problem seems to be with the following term in the Integrate result:
  
  MeijerG[{{1/2,1,1},{}},{{1/2,1/2,1},{}},-I,1/2]
  
  For some reason, Mathematica is not able to evaluate this numerically. It just returns unevaluated. Also, if you try to evaluate 
  this using arbitrary-precision, you get a bunch of errors. I have filed a report with our developers regarding this behavior. Thank 
  you for bringing this to our attention. 
  
  Regards,
  
  Luke Titus
  Wolfram Technical Support
  Wolfram Research Inc.
  http://support.wolfram.com

```

---

<div class="post-metadata">

**Author:** ![trounev](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/trounev/32/7405_2.png) [@trounev](https://community.wolfram.com/u/trounev)\
**Post date:** [May 16, 2018, 2:29pm UTC](https://community.wolfram.com/t/different-results-solving-the-same-integral/12468/7 "2018-05-16T14:29:03Z")

</div>

This is a challenge, we need to get around this obstacle.

---

<div class="post-metadata">

**Author:** ![mariuszi28cg](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mariuszi28cg/32/308_2.png) [@mariuszi28cg](https://community.wolfram.com/u/mariuszi28cg)\
**Post date:** [May 16, 2018, 5:33pm UTC](https://community.wolfram.com/t/different-results-solving-the-same-integral/12468/8 "2018-05-16T17:33:56Z")

</div>

Hi

I found a simple workaround to your problem see attched file.

Regards,MI

---

<div class="post-metadata">

**Author:** ![mariuszi28cg](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mariuszi28cg/32/308_2.png) [@mariuszi28cg](https://community.wolfram.com/u/mariuszi28cg)\
**Post date:** [May 16, 2018, 5:35pm UTC](https://community.wolfram.com/t/different-results-solving-the-same-integral/12468/9 "2018-05-16T17:35:56Z")

</div>

Challenge accomplished. See my attached file **Support v2.nb**

Regards, MI.

---

<div class="post-metadata">

**Author:** ![trounev](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/trounev/32/7405_2.png) [@trounev](https://community.wolfram.com/u/trounev)\
**Post date:** [May 17, 2018, 2:42am UTC](https://community.wolfram.com/t/different-results-solving-the-same-integral/12468/10 "2018-05-17T02:42:24Z")

</div>

Thank you Mariusz. It’s very good. I know that Mathematica contains the solution to any problem.
