Ask Your Question
1

Incorrect result for integral of (cos z) / z

asked 2021-06-21 15:09:34 +0100

ripple_carry gravatar image

I am confused by the following result: I'd like to integrate cos(z) / z on a circle around the origin. I tried:

var('z,t')

f = (cos(z))/z

show(f)

gamma = e^(i * t) 

dg = gamma.diff(t)

h = f(z=gamma) * dg
print(h)
show(h.integrate(t, 0, 2 * pi))

and I get:

I*cos(e^(I*t))
0

If I put the same integral into WolframAlpha, I get the result I was expecting (2 pi i).

Is this a bug, or have I specified the problem incorrectly?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2021-06-21 15:39:12 +0100

FrédéricC gravatar image

Which version of sage do you use ? Mine gives

sage: h.integrate(t,algorithm='maxima')                                         
1/2*Ei(I*e^(I*t)) + 1/2*Ei(-I*e^(I*t))
sage: h.integrate(t,algorithm='giac')                                           
cos_integral(e^(I*t))
sage: h.integrate(t,algorithm='sympy')                                          
cos_integral(e^(I*t))

So one problem is that maxima is not using the correct primitive.

But well, at least one of our integrator gives a correct result in sage 9.4.beta2 :

sage: h.integrate(t,0,2*π,algorithm='maxima')                                   
0
sage: h.integrate(t,0,2*π,algorithm='giac')                                     
2*I*pi
sage: h.integrate(t,0,2*π,algorithm='sympy')                                    
0
edit flag offensive delete link more

Comments

My About tab says:

┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.1, Release Date: 2020-05-20                     │
│ Using Python 3.7.3. Type "help()" for help.                        │
└────────────────────────────────────────────────────────────────────┘
ripple_carry gravatar imageripple_carry ( 2021-06-21 15:44:23 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-06-21 15:09:34 +0100

Seen: 218 times

Last updated: Jun 21 '21