Calculating Hypergeometric Function 2F1 for |z|>1

Click For Summary
SUMMARY

This discussion focuses on calculating the hypergeometric function 2F1 for values of |z| > 1, specifically in the context of integrating the function A/(1+B^2x^2)^{(C+1)/2}. The user encountered limitations with the GNU Scientific Library (GSL) which only supports |z| < 1. A solution was found using the transformation equation from a thesis, allowing for the calculation of 2F1 through analytic continuation. The provided C code demonstrates how to implement this solution effectively.

PREREQUISITES
  • Understanding of hypergeometric functions, specifically 2F1
  • Familiarity with the GNU Scientific Library (GSL) and its functions
  • Basic knowledge of C programming for implementing mathematical functions
  • Concept of analytic continuation in complex analysis
NEXT STEPS
  • Study the transformation equations for hypergeometric functions in detail
  • Learn about analytic continuation techniques in complex analysis
  • Explore the GNU Scientific Library documentation for advanced hypergeometric functions
  • Implement and test the provided C code for various values of z
USEFUL FOR

Mathematicians, physicists, and software developers involved in numerical analysis or computational mathematics, particularly those working with hypergeometric functions and integration techniques.

mudkip9001
Messages
19
Reaction score
0
I posted this in the Advanced Physics forum as well, but it occurred to me that this might be a more appropriate place. I'd delete it in Advanced Physics, but I can't see where to do that.

Homework Statement



I'm need to integrate the function

\frac{A}{(1+B^2x^2)^{\frac{C+1}{2}}}

which using wolfram alpha gives a function of the 'hypergeometric function' _2F_1(a,b;c;z)

Ax_2F_1(\frac{1}{2},\frac{C+1}{2};\frac{3}{2};-B^2x^2)

I'm writing a program to calculate the integral at diffent values of x. The problem is that for most of my data, x gives values of \left|B^2x^2\right|&gt; 1 and it seems that calculating it at http://en.wikipedia.org/wiki/Gaussian_hypergeometric_series#The_hypergeometric_series" becomes much more complicated, beyond my mathematical capabilities.

The Attempt at a Solution



messing about with wolfram it seems that as long as z<0 the solution is a real number, so it should be possible to calculate it in my program. However the http://www.gnu.org/software/gsl/manual/html_node/Hypergeometric-Functions.html" library is only capable of calculating it for |z|<1.
 
Last edited by a moderator:
Physics news on Phys.org
Your question boils down to "How can I calculate the hypergeometric function 2F1(z) at values of z where this must be done by analytic continuation?".

In my encounter with hypergeometric functions, I received only a glancing blow and never had to think about this. I hesitate to report a result from a simple Google search. However, this PDF is very much on target. http://www.google.com/url?sa=t&sour...1azbCg&usg=AFQjCNGKqrt-yoMydrnxxp916Lh0p9mF8w It's a thesis about computing hypergeometric functions. Sections 4.6 and 4.7 deal with computing 2F1 by analytic continuation.

Perhaps you can contact the author of this thesis and get some code to do the job.
 
Stephen Tashi said:
Your question boils down to "How can I calculate the hypergeometric function 2F1(z) at values of z where this must be done by analytic continuation?".

In my encounter with hypergeometric functions, I received only a glancing blow and never had to think about this. I hesitate to report a result from a simple Google search. However, this PDF is very much on target. http://www.google.com/url?sa=t&sour...1azbCg&usg=AFQjCNGKqrt-yoMydrnxxp916Lh0p9mF8w It's a thesis about computing hypergeometric functions. Sections 4.6 and 4.7 deal with computing 2F1 by analytic continuation.

Perhaps you can contact the author of this thesis and get some code to do the job.

Thank you! I think I found the solution in the pdf. If I've understood correctly it's quite simple because I'm only dealing with real numbers. All I have to do is use the transformation equation 4.16:

_2F_1(a,b;c;z)=(1-z)^{-a}\frac{\Gamma(c)\Gamma(b-a)}{\Gamma(b)\Gamma(c-a)} {_2}F_1\left( a,c-b;a-b+1;\frac{1}{1-z}\right)
+(1-z)^{-b}\frac{\Gamma(c)\Gamma(a-b)}{\Gamma(a)\Gamma(c-b)} {_2}F_1\left( b,c-a;b-a+1;\frac{1}{1-z}\right)



EDIT: For future refernce in case anyone ever encouters the same problem, I'll put the C code I wrote here.. I checked it against wolframs results and it worked perfectly. Instead of using the gsl_sf_hyperg_2F1 function in Gnu Scientific Library, use this function:

Code:
double hyperg_z_GT1 (double a, double b, double c, double z) {	
	//calculates 2F1 for z < -1
	
	double coef1,coef2;
	
	coef1=gamma(c)*gamma(b-a)*pow(1-z,-a)/(gamma(b)*gamma(c-a));
	coef2=gamma(c)*gamma(a-b)*pow(1-z,-b)/(gamma(a)*gamma(c-b));
	
	return coef1*gsl_sf_hyperg_2F1(a,c-b,a-b+1,1/(1-z))+coef2*gsl_sf_hyperg_2F1(b,c-a,b-a+1,1/(1-z));

}
 
Last edited:

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
8
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K