2
$\begingroup$

When I try to simplify this hypergeometric function

FullSimplify[HypergeometricPFQ[{1/2 - n/2}, {-(1/2) - n/2}, -a^2]]

Mathematica 10.0.1.0 returns

(Exp[-a^2] (1 + n + 2 a^2))/(1 + n)

but if I compare the two expressions for different integer values of n,

Table[(Exp[-a^2] (1 + 2 a^2 + n))/(1 + n) ==
      HypergeometricPFQ[{1/2 - n/2}, {-(1/2) - n/2}, -a^2], {n, 0, 6}]

they are different for odd n

{True, 1/2 (2 + 2 a^2) E^-a^2 == 1, True, 1/4 (4 + 2 a^2) E^-a^2 == 1 - a^2/2,
 True, 1/6 (6 + 2 a^2) E^-a^2 == 1 - (2 a^2)/3 + a^4/6, True}

What's going on?

(This behavior persists if I use FunctionExpand[] in place of FullSimplify[], since the latter calls the former.)

$\endgroup$
  • 1
    $\begingroup$ Simply put: Hypergeometric1F1[] degenerates to a polynomial if its upper parameter is a nonpositive integer. Unfortunately, the generic solution returned by FunctionExpand[]/FullSimplify[] does not take this into account. $\endgroup$ – J. M. is in limbo Oct 14 '15 at 16:17
  • $\begingroup$ Are you saying that the result returned by FunctionExpand[] is false when the upper parameter is a nonpositive integer? $\endgroup$ – Jess Riedel Oct 14 '15 at 16:23
  • 1
    $\begingroup$ Pretty much, yes, due to the exponential factor not being taken care of. If you're interested, I can write a solution detailing how to derive the correct result in that special case. $\endgroup$ – J. M. is in limbo Oct 14 '15 at 16:25
  • $\begingroup$ Terrifying. Yes, I would be very grateful for a solution. The hypergeometric function is a series coefficient in a Taylor expansion I am working with, for which I really need a simple expression that I can further operate on. $\endgroup$ – Jess Riedel Oct 14 '15 at 16:28
5
$\begingroup$

To recap, the result returned by FunctionExpand[Hypergeometric1F1[1/2 - n/2, -(1/2) - n/2, -a^2]] is a generic solution, which is intended to be correct in most cases. Unfortunately, the case of odd n is not part of those cases:

Table[Hypergeometric1F1[1/2 - n/2, -(1/2) - n/2, -a^2] == 
      Exp[-a^2] (1 + 2 a^2 + n)/(1 + n) // FullSimplify // TrueQ, {n, 10}]
   {False, True, False, True, False, True, False, True, False, True}

To handle the odd n case, we first do a preliminary transformation:

Hypergeometric1F1[1/2 - n/2, -(1/2) - n/2, -a^2] /. n -> 2 k + 1 // Simplify
   Hypergeometric1F1[-k, -1 - k, -a^2]

which shows the source of the failure: the case of odd n results in a Kummer function with a nonpositive numerator parameter, which is precisely the degenerate polynomial case. To explicitly deal with this, we go back to the defining series for ${}_1 F_1$:

$${}_1 F_1\left({{a}\atop{b}}\mid z\right)=\sum_{j=0}^\infty \frac{(a)_j}{(b)_j}\frac{z^j}{j!}$$

For the special case under consideration, we have

$${}_1 F_1\left({{-k}\atop{-1-k}}\mid -a^2\right)=\sum_{j=0}^\infty \frac{(-k)_j}{(-1-k)_j}\frac{\left(-a^2\right)^j}{j!}$$

Since $(-k)_j=0$ if $j>k$, the series terminates:

$${}_1 F_1\left({{-k}\atop{-1-k}}\mid -a^2\right)=\sum_{j=0}^k \frac{(-k)_j}{(-1-k)_j}\frac{\left(-a^2\right)^j}{j!}$$

Using

FullSimplify[Pochhammer[-k, j]/Pochhammer[-1 - k, j]]
   1 - j/(1 + k)

we thus have

Sum[(1 - j/(1 + k)) (-a^2)^j/j!, {j, 0, k}] // FullSimplify
   ((-a)^k a^(4 + k) E^a^2 + (1 + a^2 + k) Gamma[2 + k, -a^2])/
   (E^a^2 (1 + k)*Gamma[2 + k])

We can now undo the earlier substitution:

s[n_] = % /. k -> (n - 1)/2 // FullSimplify
   (2 ((-a)^((-1 + n)/2) a^((7 + n)/2) E^a^2 + ((1 + 2 a^2 + n)
    Gamma[(3 + n)/2, -a^2])/2))/(E^a^2 (1 + n) Gamma[(3 + n)/2])

The rather complicated closed form gives no indication that it is in fact a polynomial. Nevertheless,

Table[Hypergeometric1F1[1/2 - n/2, -(1/2) - n/2, -a^2] == s[n] // 
      FullSimplify, {n, 1, 11, 2}]
   {True, True, True, True, True, True}

s[7] // FullSimplify
   (24 - 18*a^2 + 6*a^4 - a^6)/24
$\endgroup$
  • $\begingroup$ Tremendously helpful. Am I crazy in calling this a bug, since the hypergeometric function was returned by SeriesCoefficient[], which is expected to use integers? Is there any way to avoid incorrect simplifications by FullSimplify[] in the future that doesn't require detailed knowledge of the relevant special function? $\endgroup$ – Jess Riedel Oct 14 '15 at 17:15
  • $\begingroup$ Again, by design, the results obtained by simplification functions are only generically correct. It is entirely possible to have a result that is not valid for a countable set of values. Thus, it is always in your best interest to perform sanity checks on whatever results you get, whether in Mathematica or a different CAS. $\endgroup$ – J. M. is in limbo Oct 14 '15 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.