# Did I do this (complex) integration correctly?

## Homework Statement

Given C is the unit circle, evaluate $$\int_C \frac{1}{z^2 + 4} dz$$

## Homework Equations

unit circle: $z = e^{iθ}$
The problem doesn't specify how many times to go around the unit circle or which way, so I'm going to assume once and counterclockwise.

## The Attempt at a Solution

$$z = e^{iθ} \ \ , \ θ \in [0, 2\pi]$$
$$dz = ie^{iθ}dθ$$

$$\int_C \frac{1}{z^2 + 4} dz = \int_0^{2\pi} \frac{1}{(e^{iθ})^2 + 4} ie^{iθ}dθ$$

$$= \frac{1}{2} \arctan{\left(\frac{e^{iθ}}{2}\right)} \Big|_0^{2\pi}$$
$$= \frac{1}{2} \arctan{\left(\frac{e^{0i}}{2}\right)} - \frac{1}{2} \arctan{\left(\frac{e^{2\pi i}}{2}\right)}$$
$$= \frac{1}{2} \arctan{\left(\frac{1}{2}\right)} - \frac{1}{2} \arctan{\left(\frac{1}{2}\right)} = 0$$

I'm pretty confident about it, but I'm always wary of numerical problems that turn out so nicely. Is this correct, or did I royally screw it up?

Dick
Homework Helper
Suppose the problem were integrate 1/z around the unit circle. The antiderivative is log(z). So the result must be log(e^(2*pi*i)-log(e^(0))=log(1)-log(1)=0. Would you believe me? You shouldn't. Because it's wrong. That's what you are doing. In this case you got the right answer. But the method is unsound. There's a much easier way of evaluating that integral with less risk. Any idea what it might be?

Wait, if the problem was f(z) = 1/z, then I'd do the same as I did above and get,

$$\int_c \frac{1}{z} dz= \int_0^{2\pi} \frac{1}{e^{iθ}} ie^{iθ} dθ = \int_0^{2\pi}i dθ= i \int_0^{2\pi}dθ = (i) θ\bigg|_0^{2 \pi} = i(2\pi - 0) = 2\pi i$$

Should I be doing some substitutions, or finding the inverse and using inverse function integration?

Dick
Homework Helper
Wait, if the problem was f(z) = 1/z, then I'd do the same as I did above and get,

$$\int_c \frac{1}{z} = \int_0^{2\pi} \frac{1}{e^{iθ}} ie^{iθ} dθ = \int_0^{2\pi}i dθ= i \int_0^{2\pi}dθ = (i) θ\bigg|_0^{2 \pi} = i(2\pi - 0) = 2\pi i$$

Should I be doing some substitutions, or finding the inverse and using inverse function integration?
You did that correctly by reducing the integral to a real integral where you can safely use the antiderivative. So you'll agree using log(e^(2*pi*i))-log(1) is wrong for 1/z? That was my point. I'm not sure where you are in complex variables, but 1/(z^2+4) is analytic inside the unit circle. It doesn't have any poles or singularities there. Does that suggest anything? You don't even need an antiderivative.

Last edited:
Can I just use Cauchy's Theorem to say that since C is simple, closed, and rectifiable and f(z) is holomorphic in and on C the $\int_c f(z) dz = 0$?

The book we use is very old and uses a lot of out of date terms...

Dick
Homework Helper
Can I just use Cauchy's Theorem to say that since C is simple, closed, and rectifiable and f(z) is holomorphic in and on C the $\int_c f(z) dz = 0$?

The book we use is very old and uses a lot of out of date terms...
That's exactly what you should say. The poles are at +/-2*i. They are outside of the unit circle. No need for an arctan or anything. Nor any need to say which way around the unit circle or how many times. It's still zero.

Okay, that makes enough sense. Though I have a few other integration problems, namely ones from a section in the book before Cauchy's thm is mentioned. I guess if I did it incorrectly above, then I did all of the other ones wrong. Is there a method to actually calculate the integral?

Dick
Homework Helper
Okay, that makes enough sense. Though I have a few other integration problems, namely ones from a section in the book before Cauchy's thm is mentioned. I guess if I did it incorrectly above, then I did all of the other ones wrong. Is there a method to actually calculate the integral?
There's always what did you did the 1/z problem. Just saying log(e^(2*pi*i))-log(1)=0 is wrong suggests just saying arctan(e^(2*pi*i))-arctan(1)=0 might also be wrong. Try and reduce the problem to real integrals where you know what you are doing. The problem with the log thing is that log in complex variables is multivalued. arctan probably is as well.

$$\int_C \frac{1}{z^2 + 4} dz = \int_0^{2\pi} \frac{1}{(e^{iθ})^2 + 4} ie^{iθ}dθ$$
Let θ = ∏t => dθ = ∏dt

$$\int_0^{2\pi} \frac{1}{(e^{iθ})^2 + 4} ie^{iθ}dθ = \frac{1}{\pi}\int_0^{2} \frac{1}{(e^{i\pi t})^2 + 4} ie^{i\pi t}dt$$

$$= \frac{i}{\pi}\int_0^{2} \frac{1}{1 + 4} e^{i\pi t}dt = \frac{i}{5\pi}\int_0^{2} e^{i\pi t}dt = \frac{i}{5\pi}\int_0^{2} [cos{(\pi t)} + isin{(\pi t)}]dt \ , \ \ etc.$$

Is this valid? Though I could stop with the second to last part and integrate e^(∏ti) as in the real case.

Dick
Homework Helper
$$\int_C \frac{1}{z^2 + 4} dz = \int_0^{2\pi} \frac{1}{(e^{iθ})^2 + 4} ie^{iθ}dθ$$
Let θ = ∏t => dθ = ∏dt

$$\int_0^{2\pi} \frac{1}{(e^{iθ})^2 + 4} ie^{iθ}dθ = \frac{1}{\pi}\int_0^{2} \frac{1}{(e^{i\pi t})^2 + 4} ie^{i\pi t}dt$$

$$= \frac{i}{\pi}\int_0^{2} \frac{1}{1 + 4} e^{i\pi t}dt = \frac{i}{5\pi}\int_0^{2} e^{i\pi t}dt = \frac{i}{5\pi}\int_0^{2} [cos{(\pi t)} + isin{(\pi t)}]dt \ , \ \ etc.$$

Is this valid? Though I could stop with the second to last part and integrate e^(∏ti) as in the real case.
No, replacing exp(2*pi*i*t) by 1 doesn't work. It's not the same as exp(2*pi*i)^t. Actually, I've got another suggestion if you don't want to use Cauchy's theorem. Use partial fractions to write 1/(z^2+4)=A/(z+2i)+B/(z-2i). Find A and B and then integrate.