Calculating Hypergeometric Function 2F1 for |z|>1

Click For Summary
The discussion focuses on calculating the hypergeometric function 2F1 for values where |z| > 1, which presents challenges due to limitations in existing libraries like GSL. The user found that analytic continuation can be used to compute the function by applying a transformation equation from a relevant thesis. They successfully implemented a solution in C code that matches results from Wolfram Alpha. The transformation allows for the calculation of 2F1 using real numbers, simplifying the process. This approach provides a viable method for integrating the specified function in their program.
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|> 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:
Question: A clock's minute hand has length 4 and its hour hand has length 3. What is the distance between the tips at the moment when it is increasing most rapidly?(Putnam Exam Question) Answer: Making assumption that both the hands moves at constant angular velocities, the answer is ## \sqrt{7} .## But don't you think this assumption is somewhat doubtful and wrong?

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · 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