2

I have a pretty simple sum to solve:

\sum_{k=1}^\infty p^k/k! * 1/(k + h)

Wolfram Alpha does it. I tried to get there with sympy, but failed miserably.

from sympy import *
h, k, lam, p = symbols('h k lambda p')
exprInner = Sum(p**k/factorial(k) * 1/(h+k), (k, 1, oo))
solve(exprInner)

If I print exprInner, it looks okay - but it will just respond with [] to any solve request. Given that Wolfram Alpha takes seconds to solve this, it should be doable with sympy, I'd suppose? How should I approach this?

FooBar
  • 15,724
  • 19
  • 82
  • 171
  • 3
    If by "solving the sum", you mean finding a closed form representation, this is done by `exprInner.doit()`. It turns out that `doit()` fails to find a closed form in this case and returns the input series, However, I doubt that the closed form provided by Wolfram Alpha, using a generalized incomplete Gamma function, is of much help anyway. – Stelios Sep 17 '16 at 17:20
  • 1
    While I'd hold off on judgements on how useful the closed form solution is, it's definitely not "pretty simple". At any rate, it seems SymPy is not able to solve it. – asmeurer Sep 21 '16 at 17:01

0 Answers0