I was trying to get Mathematica to simplify some moderately ugly sums and I ran into some pretty weird behaviour, which I tracked down to the following example. I'm working with Christoffel-Darboux-type sums of Hermite polynomials, which are known to simplify nicely, a fact of which Mathematica is aware:
Sum[(HermiteH[k, x] HermiteH[k, y])/(2^k k!), {k, 0, n}]
Out[1]= (2^(-1 - n) (HermiteH[n, y] HermiteH[1 + n, x] -
HermiteH[n, x] HermiteH[1 + n, y]))/((x - y) n!)
So far so good. However, even simple changes to the above expression make Mathematica output a far more complex answer which is not what I'm looking for in general and which in this case is evidently rather wrong:
Sum[(HermiteH[k, -x] HermiteH[k, y])/(2^k k!), {k, 0, n}]
The problem is somewhat related to this question on Simplify
, but I can't see why Mathematica would think the code above is in any way simpler than just
-(2^(-1 - n) (HermiteH[n, y] HermiteH[1 + n, -x] -
HermiteH[n, -x] HermiteH[1 + n, y]))/((x + y) n!)
Can anyone share some insight? or is this some kind of bug?