About a hypergeometric functions (2F1).

Click For Summary

Discussion Overview

The discussion centers around the evaluation of the hypergeometric function (2F1) using different software tools, specifically Mathematica and Matlab. Participants explore discrepancies in the results produced by these tools, particularly regarding the imaginary components of the outputs. The conversation touches on the implications of evaluating power series outside their radius of convergence and the multi-valued nature of the hypergeometric function.

Discussion Character

  • Debate/contested
  • Technical explanation

Main Points Raised

  • One participant reports differing results from Mathematica and Matlab for the hypergeometric function 2F1, noting the sign of the imaginary part as a point of confusion.
  • Another participant questions the evaluation of power series outside their radius of convergence and suggests that the choice of branch for multi-valued functions may affect the results.
  • A participant mentions that Maple agrees with Mathematica's results and discusses the implications of using complex numbers for evaluating arctanh at specific values.
  • Multiple participants confirm that the hypergeometric function is multi-valued and that without specifying a branch, there can be multiple correct values.
  • One participant shares their experience using the symbolic math toolbox in Matlab, which produces results consistent with Mathematica and Maple, while another participant notes a different result from an earlier version of Matlab.
  • There is acknowledgment that the series representation of the hypergeometric function converges only for certain arguments, but integral representations can provide analytic continuation outside the unit circle.

Areas of Agreement / Disagreement

Participants generally agree that the hypergeometric function is multi-valued and that different software may yield different results based on branch choices. However, there is no consensus on which result is more accurate or preferable, as opinions vary regarding the seriousness of the results from Mathematica versus Matlab.

Contextual Notes

Participants note that the series representation of the hypergeometric function converges for arguments with magnitude less than one, and that analytic continuation may be possible through integral representations, depending on the chosen branch.

xylai
Messages
58
Reaction score
0
Today, I use two softwares to calculate the value of a hypergeometric functions (2F1). One is Mathematica and another is Matlab. But they give me different results.
For examples:
(1) 2F1(0.5, 1., 1.5, 5) (Pay an attention to the sign of the image part.)

Mathematica's result: 0.21520 - 0.70248 i
Matlab's result: 0.2152 + 0.7025 i


(2) 2F1(2,3,4,5)

Mathematica's result: 0.156542+ 0.150796 i
Matlab's result: 0.1565 + 0.1508 i

Now, I am confused.
 
Physics news on Phys.org
First you need to answer a question. When you evaluate a power series outside its radius of convergence, what is it you want to do? Once you answer that, you can investigate what the two softwares have chosen to do.

Maple says
<br /> {{}_2{\rm F}_1(1/2,1;\,3/2;\,z)}={\frac {{\rm arctanh} \left( \sqrt {z}<br /> \right) }{\sqrt {z}}}<br />
The function tanh(z) has values between -1 and 1 for real z, so you need complex numbers to evaluate arctanh at z=\sqrt{5}. And arctanh is multi-valued as a complex function, so you need some convention of whch branch to choose. Maple agrees with Mathematica on this.
But Matlab's value is also "a value" of this multi-valued function.
 
I'm wondering how you are doing this in matlab. Are you using the symbolic math toolbox or some third-party code, or am I just not aware of another option?

I am running MATLAB 2009b, and with the symbolic math toolbox I get:

>> z=hypergeom([.5, 1], 3/2, 5)

z =

0.215204470482002 - 0.702481473104073iwhich agrees with mathematica and maple.

Of course, g_edgar is right, that the function is multivalued and thus without specifying a branch there are multiple values that are correct. The fact that the series representation only converges for arguments with magnitude less than one doesn't bother me - there are integral representations that provide an analytic continuation outside the unit circle, with the caveat that you have to chose a branch and cut ...

jason

EDIT: I just realized that it is only the series about 0 that only converges for |z|<1. series about other points can also provide analytic continuation outside the unit circle.
 
Last edited:
jasonRF said:
I'm wondering how you are doing this in matlab. Are you using the symbolic math toolbox or some third-party code, or am I just not aware of another option?

I am running MATLAB 2009b, and with the symbolic math toolbox I get:

>> z=hypergeom([.5, 1], 3/2, 5)

z =

0.215204470482002 - 0.702481473104073i


which agrees with mathematica and maple.

Of course, g_edgar is right, that the function is multivalued and thus without specifying a branch there are multiple values that are correct. The fact that the series representation only converges for arguments with magnitude less than one doesn't bother me - there are integral representations that provide an analytic continuation outside the unit circle, with the caveat that you have to chose a branch and cut ...

jason

EDIT: I just realized that it is only the series about 0 that only converges for |z|<1. series about other points can also provide analytic continuation outside the unit circle.

Yes, you're right that hypergeometric function is multivalued. I think the result of Mathematica is more serious.


Just now, I ran MATLAB R2007a:
>> z=hypergeom([.5, 1], 3/2, 5)

z =

0.2152 + 0.7025i
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 7 ·
Replies
7
Views
6K