# Generalized hypergeometric function 1F2 , special values

I have two hypergeometric functions $\ _{1}\mathcal{F}_{2}[\frac{1}{2}+q;\frac{1}{2},\frac{3}{2}+q;-X^{2}]$ and $\ _{1}\mathcal{F}_{2}[1+2q;\frac{3}{2},2+2q;-X^{2}]$. For fixed integer positive $q$ Mathematica gives me some trigonometric polynomials. How does Mathematica compute them?

-

Note: $$u(X) = {}_2F_1\Biggl(\biggl[\frac{1}{2},\frac{1}{2} + q\biggr],\biggl[\frac{3}{2} + q\biggr],-X^{2}\Biggr) = \biggl(\frac{1}{2} + q\biggr) \sum_{k = 0}^{\infty} \frac{2 {-1/2\choose k} X^{2 k}}{2 k + 1 + 2 q}$$ so we get a differential equation $$\frac{d}{d X} \left[u(X) X^{1 + 2 q}\right] = \frac{(1 + 2 q) X^{2 q}}{\sqrt{X^{2} + 1}}$$ with solution $$u(X) = \frac{\int_{X} \frac{(1 + 2 q) X^{2 q}}{\sqrt{X^{2} + 1}} d X + C}{X^{1 + 2 q}}$$ Now the general form of that integral may be hypergeometric. But for $q$ a positive integer we can integrate by parts and end up with some trig, right?

-

There are many different formulas for hypergeometric functions and mathematica knows them. Actually I've read somewhere that the engine behind it uses hypergeometric functions in internal calculations (even if the input does not contain them) and then convert results to elementary and special functions if possible. No wonder it works since most of functions arising in computations are particular cases of generalized hypergeometric function. Elementary ones, cylinder functions etc. The exception is perhaps the gamma function and associated with it.

From Wolfram:

Hundreds of thousands of mathematical results derived at Wolfram Research give Mathematica unprecedented strength in the transformation and simplification of hypergeometric functions. This allows hypergeometric functions for the first time to take their place as a practical nexus between many special functions—and makes possible a major new level of algorithmic calculus.

-