Doing contour integration of sin^z/(z-a)^4 in Maple

844 Views Asked by At

This is example 11.4.3 in Arfkin, Weber, and Harris: Calculate the following integral around a contour encircling $z=a$:

$$I=\oint_C \frac{\sin ^2(z)dz}{(z-a)^4}$$

The answer is $-\frac{8\pi i}{3}\sin(a)\cos(a)$. In the book they use a derivative formula, but I want to get the same result using Maple.

My attempt is as follows (I am very new to Maple, but this same approach has worked for me on other complex integrals):

f := sin^2*z/(z - a)^4;
                                  2   
                               sin  z 
                         f := --------
                                     4
                              (z - a) 
poles := [a];
                          poles := [a]
C := z -> is(abs(z - a) < 1);
(2*Pi)*I*add(residue(f, z = a), a = select(C, poles));
                               0

Any thoughts for what Maple is doing and how I can get it to evaluate this integral correctly?

1

There are 1 best solutions below

1
On BEST ANSWER

Syntax matters. Your original above has the numerator sin^2*z which doesn't parse to what you expect.

If you were originally using 2D Input mode in the Maple GUI, then I strongly suggest you stop doing that, and change GUI preferences globally to 1D (plaintext) Maple Notation input, and Worksheet instead of Document.

restart;
f := sin(z)^2/(z - a)^4;

                                2 
                          sin(z)  
                     f := --------
                                 4
                          (z - a) 

poles := [a]:
C := z -> is(abs(z - a) < 1):

(2*Pi)*I*add(residue(f, z = a), a = select(C, poles));

                  8                   
                 -- I Pi cos(a) sin(a)
                  3