Opened 10 years ago

Closed 9 years ago

# sum(1/(1+k^2), k, -oo, oo) returns 0

Reported by: Owned by: mvngu burcin major sage-4.6.1 symbolics N/A

### Description

From sage-support:

```But I want to make a comment, also from this documentation. It says
sum(1/(1+k^2), k, -oo, oo, algorithm = 'mathematica')     # optional
-- requires mathematica

OK, I understand that sage do not kown how to evaluate
sum(1/(1+k^2), k, -oo, oo)

But it answer     0      , that is wrong!!!
```

### comment:1 Changed 9 years ago by kcrisman

This seems to be fixed in Maxima 5.21.1 or so:

```(%i2) load(simplify_sum);
(%o2) /Users/.../maxima/share/contrib/solve_rec/simplif\
y_sum.mac
(%i5) display2d:false;

(%o5) false
(%i6) simplify_sum(sum(1/(1+k^2),k,-inf,inf));

(%o6) -%i*(psi(%i+1)+%gamma)/2-%i*(psi(%i)+%gamma)/2
+%i*(psi(-%i)+%gamma)/2
+%i*(psi(1-%i)+%gamma)/2
```

Which uses the digamma function quite a bit. We don't get the (perhaps) simpler answer `pi coth(pi)`.

### comment:2 Changed 9 years ago by kcrisman

This should hopefully be resolved by #8731.

### comment:3 Changed 9 years ago by mvngu

• Resolution set to fixed
• Status changed from new to closed

This is fixed at ticket #10187 by upgrading to Maxima 5.22.1:

```[mvngu@sage sage-4.6.1.alpha3]\$ ./sage
----------------------------------------------------------------------
| Sage Version 4.6.1.alpha3, Release Date: 2010-12-05                |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
**********************************************************************
*                                                                    *
* Warning: this is a prerelease version, and it may be unstable.     *
*                                                                    *
**********************************************************************
sage: k = var("k")
sage: sum(1/(1+k^2), k, -oo, oo)
1/2*I*psi(-I) - 1/2*I*psi(I) + 1/2*I*psi(-I + 1) - 1/2*I*psi(I + 1)
sage: %maxima

--> Switching to Maxima <--

''
"/dev/shm/mvngu/sage-4.6.1.alpha3/local/share/maxima/5.22.1/share/contrib/solve_rec/simplify_sum.mac"
maxima: display2d:false;
false
maxima:
maxima: simplify_sum(sum(1/(1+k^2),k,-inf,inf));
-%i*(psi(%i+1)+%gamma)/2-%i*(psi(%i)+%gamma)/2+%i*(psi(-%i)+%gamma)/2+%i*(psi(1-%i)+%gamma)/2
```

So I'm closing this ticket as fixed.

### comment:4 follow-up: ↓ 5 Changed 9 years ago by kcrisman

Is that doctested in the patches for #10187?