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

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?

• I'm voting to close this question as off-topic because I misunderstood the [maple] tag - this question is about using the software specifically. I guess I don't understand why this tag exists at all if you can't ask questions like this, but in any case, I think my question should be closed. Apr 2, 2019 at 14:07

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

• Ah of course - something stupid, Perfect and thanks! Apr 2, 2019 at 1:04