# Contour integration around a square

## Homework Statement

I am trying to calculate the contour integral of the complex conjugate of z around a square with sides of length 2 centred on the origin in the complex plane

## Homework Equations

∫ f(z) dz = ∫ f(t) (dz/dt) dt . It looks like the integral signs won't appear here but they should be at the front of each side of the equation

## The Attempt at a Solution

I already know the answer is 2π I and calculate this answer using polar form but when I calculate it around the square I get the answer to be 4 x 2i. Each of the sides contributes 2i. I can't get π to appear anywhere in my answer.
If I take the right hand vertical side , I parametrise it as z = 1 + i(t-1) so dz/dt = i and the complex conjugate of z is 1-i(t-1) so I get the integral with limits 2 and 0 of i+1-t which gives 2i.
What am I doing wrong and how do I get π to appear ?
Thanks

Related Calculus and Beyond Homework Help News on Phys.org
Ray Vickson
Homework Helper
Dearly Missed

## Homework Statement

I am trying to calculate the contour integral of the complex conjugate of z around a square with sides of length 2 centred on the origin in the complex plane

## Homework Equations

∫ f(z) dz = ∫ f(t) (dz/dt) dt . It looks like the integral signs won't appear here but they should be at the front of each side of the equation

## The Attempt at a Solution

I already know the answer is 2π I and calculate this answer using polar form but when I calculate it around the square I get the answer to be 4 x 2i. Each of the sides contributes 2i. I can't get π to appear anywhere in my answer.
If I take the right hand vertical side , I parametrise it as z = 1 + i(t-1) so dz/dt = i and the complex conjugate of z is 1-i(t-1) so I get the integral with limits 2 and 0 of i+1-t which gives 2i.
What am I doing wrong and how do I get π to appear ?
Thanks
There should not be any $\pi$s in the answer, because there are no $\pi$s needed anywhere in describing the square or in expressing the complex conjugate function $\bar{z}.$

However, if $C$ happened to be a circle centered at $0$, then $\oint_C \bar{z} \, dz$ would, in fact, involve $\pi$.

So, the integral of $\bar{z}$ around a contour $C$ surrounding the origin can be different for different contours $C$. Can you see why that happens?

I know the integral of 1/z and z(conjugate) around the unit circle centred on the origin is 2π.i
I know both these functions are not analytic within the circle.
I know the contour integral of 1/z over the square I have described is 2π.i
I thought the integral over a closed curve of a non-analytic function was 2π.i for any shape of closed curve ?
.

Ray Vickson
Homework Helper
Dearly Missed
I know the integral of 1/z and z(conjugate) around the unit circle centred on the origin is 2π.i
I know both these functions are not analytic within the circle.
I know the contour integral of 1/z over the square I have described is 2π.i
I thought the integral over a closed curve of a non-analytic function was 2π.i for any shape of closed curve ?
.
NO: you have it backwards. The integral of an analytic function $f(z)$ around a closed curve is 0, so a line integral of the form $\int_A^B f(z) \, dz$ is independent of the path between A and B. The integral of a non-analytic function $g(z)$ can be anything, and can vary with the path.

dyn
fresh_42
Mentor
In contrast to the standard example of $\int_{S^1} \frac{1}{z}\,dz$ where all numbers are of norm one, we here have $\overline{z}=\frac{||z||^2}{z}$ which gives us a correction (residue) of $\frac{\text{ area square }}{\text{ area unit circle }} = \frac{4}{\pi}$ and thus $\frac{1}{2\pi \,i}\int_{\boxdot} f(z)\,dz=\sum_{a=\{0\}} 1\cdot \frac{4}{\pi}$

Last edited:
So for the case of 1/z integrated over a unit circle and the square of sides 2 ; its just a coincidence that the answer is 2π.i in both cases and this is in no way a general result ?

fresh_42
Mentor
So for the case of 1/z integrated over a unit circle and the square of sides 2 ; its just a coincidence that the answer is 2π.i in both cases and this is in no way a general result ?
What do you mean? $\int_{circle} \overline{z}\,dz = \int_{circle}\dfrac{1}{z}\,dz = 2\pi \,i$ by the residue theorem. But here on the square $f(z)=\overline{z}=\dfrac{||z||^2}{z}$ and $||z||^2\neq 1$ so we cannot parameterize the integration path by norm $1$ numbers. Instead we get $\int_{square} \overline{z}\,dz = 8i$ and the residue theorem says its $\int_{square} \overline{z}\,dz = 2\pi \,i \sum_{z=0} \operatorname{ind}_{square}(0) \operatorname{Res}_0(f(z)) = 2\pi\,i \cdot 1 \cdot \operatorname{Res}_0(f(z))$ and thus $\operatorname{Res}_0(f(z)) = \dfrac{4}{\pi}$.

I'm not quite sure how this is related to the variation of $||z||^2$ along the square, but it is exactly the quotient of the different areas, which I think is not by chance, as those areas are themselves integrals of distances, one uniformly $1$ and the other varying between $1$ and $\sqrt{2}$ in a sine curve. So the difference between $8i$ and $2\pi\,i$ is due to the different paths which are differently far away from the pole and thus covering different areas.

Or in formulas: Take the integral over the unit circle and deform this path such that it covers the square. This gives an additional factor under the integral (product rule) and the result should be $8i$ but you integrate over an angle.

I meant that the contour integral of the reciprocal of z over the unit circle and over the square of sides 2 is 2π.i in both cases .
Obviously these 2 paths are different , so in this case is it just a coincidence that both answers are the same ? Because as stated in a previous post "the integral of a non-analytic function can vary with the path"

fresh_42
Mentor
They are not the same. Over the square it's $8i$ and over the circle it's $2\pi\,i$, differing by a factor $\dfrac{4}{\pi}$ due to the different areas.

You already calculated the $8i$ probably in Cartesian coordinates. Now you can calculate it in polar coordinates with a varying radius. E.g. in the first eighth from $0$ to $\frac{\pi}{4}$ we have $\dfrac{1}{\cos \theta} e^{-i\theta}$ as integrand.

Last edited:
nrqed
Homework Helper
Gold Member
They are not the same. Over the square it's $8i$ and over the circle it's $2\pi\,i$, differing by a factor $\dfrac{4}{\pi}$ due to the different areas.

You already calculated the $8i$ probably in Cartesian coordinates. Now you can calculate it in polar coordinates with a varying radius. E.g. in the first eighth from $0$ to $\frac{\pi}{4}$ we have $\dfrac{1}{\cos \theta} e^{-i\theta}$ as integrand.
In post 8, dyn talks about integrating 1/z along a circle or along a square surrounding the origin. You are saying that these two calculation give different results?

fresh_42
Mentor
In post 8, dyn talks about integrating 1/z along a circle or along a square surrounding the origin. You are saying that these two calculation give different results?
If I didn't make a mistake, yes. They have a different parameterization around its pole and thus a different derivative of the path. Or I'm stuck with the same problem @dyn has and miss a crucial point.

nrqed
Homework Helper
Gold Member
If I didn't make a mistake, yes. They have a different parameterization around its pole and thus a different derivative of the path. Or I'm stuck with the same problem @dyn has and miss a crucial point.
Why would the residue theorem not be applicable here?

fresh_42
Mentor
Why would the residue theorem not be applicable here?
I haven't said this, the question is, what is the residue. I simply calculated $\int_{square} \overline{\gamma(t)}\,\dot{\gamma}(t) \,dt$ and got $2i$ along each side. I thought this is due to the fact that we have a varying distance to the pole by a factor $||z||^2$ which leads to a difference in factor $\operatorname{Res}_0(\overline{z}) = \frac{4}{\pi}$ which confirms
The integral of a non-analytic function $g(z)$ can be anything, and can vary with the path.
But I cannot rule out that my thinking is too $\mathbb{R}^2$, however, I don't see a mistake, except that I expected a residue of $1$ as for the circle.

vela
Staff Emeritus
Homework Helper
I meant that the contour integral of the reciprocal of z over the unit circle and over the square of sides 2 is 2π.i in both cases. Obviously these 2 paths are different, so in this case is it just a coincidence that both answers are the same? Because as stated in a previous post "the integral of a non-analytic function can vary with the path"
No, it's not a coincidence. The residue theorem says you'll get the same result.

I think the reason you get different results for the two paths when you integrate $\bar z$ is because the residue theorem applies to functions of $z$, not functions of $\bar z$. I'm sure if I'm wrong, someone will point out the correct reasoning.

nrqed
Homework Helper
Gold Member
I haven't said this, the question is, what is the residue. I simply calculated $\int_{square} \overline{\gamma(t)}\,\dot{\gamma}(t) \,dt$ and got $2i$ along each side. I thought this is due to the fact that we have a varying distance to the pole by a factor $||z||^2$ which leads to a difference in factor $\operatorname{Res}_0(\overline{z}) = \frac{4}{\pi}$ which confirms

But I cannot rule out that my thinking is too $\mathbb{R}^2$, however, I don't see a mistake, except that I expected a residue of $1$ as for the circle.
The residue of 1/z is 1, independently of the path taken around the pole. So the integral gives $2 \pi i$ for both contours. I am not quite following your derivation because I don't quite understand this "z hat" and the introduction of a norm, the integral is simply the integral of 1/z.

fresh_42
Mentor
The residue of 1/z is 1, independently of the path taken around the pole. So the integral gives $2 \pi i$ for both contours. I am not quite following your derivation because I don't quite understand this "z hat" and the introduction of a norm, the integral is simply the integral of 1/z.
No, the function is the conjugate, which I denoted with an overline and the norm with a double line. Whatever you want to write them, tell me.
With those we have $f(z)=\overline{z} = ||z||^2\cdot \dfrac{1}{z}$ which is not simply $\dfrac{1}{z}$ as on the unit circle. We have a varying stretch here.

fresh_42
Mentor
No, it's not a coincidence. The residue theorem says you'll get the same result.

I think the reason you get different results for the two paths when you integrate $\bar z$ is because the residue theorem applies to functions of $z$, not functions of $\bar z$. I'm sure if I'm wrong, someone will point out the correct reasoning.
I still try to figure out. $\bar z$ is the function on $z$. The question is, why should $\int_0^{\frac{1}{4}} \overline{1+(8t-1)i} \cdot 8i \, dt = \int_0^{\frac{1}{4}} 1-(8t-1)i \cdot 8i \,dt = 2i$ be wrong?

nrqed
Homework Helper
Gold Member
I still try to figure out. $\bar z$ is the function on $z$. The question is, why should $\int_0^{\frac{1}{4}} \overline{1+(8t-1)i} \cdot 8i \, dt = \int_0^{\frac{1}{4}} 1-(8t-1)i \cdot 8i \,dt = 2i$ be wrong?
I was discussing post 8, where dyn talks about integrating 1/z (as I said in my post 10). In post 8 dyn was asking about integrating 1/z along a circle or a square

fresh_42
Mentor
I was discussing post 8, where dyn talks about integrating 1/z (as I said in my post 10). In post 8 dyn was asking about integrating 1/z along a circle or a square
Sorry, I thought we were still on the original problem.

nrqed
Homework Helper
Gold Member
Sorry, I thought we were still on the original problem.
No problem! I just did not want the OP to get confused. Starting in post 6, he or she was asking about the case of 1/z and I wanted to emphasize that yes, in that case the two results are the same and are given by $2 \pi i$. Now, $1/\bar{z}$ is not analytic even away from the origin, so in that case things are more subtle.

vela
Staff Emeritus
Homework Helper
I still try to figure out. $\bar z$ is the function on $z$. The question is, why should $\int_0^{\frac{1}{4}} \overline{1+(8t-1)i} \cdot 8i \, dt = \int_0^{\frac{1}{4}} 1-(8t-1)i \cdot 8i \,dt = 2i$ be wrong?
I don't think it's wrong. Why do you think it's wrong?

fresh_42
Mentor
I don't think it's wrong. Why do you think it's wrong?
I have written this as I thought the discussion is still about path independence for non-analytic functions. Could be deleted.

Ray Vickson
Homework Helper
Dearly Missed
I meant that the contour integral of the reciprocal of z over the unit circle and over the square of sides 2 is 2π.i in both cases .
Obviously these 2 paths are different , so in this case is it just a coincidence that both answers are the same ? Because as stated in a previous post "the integral of a non-analytic function can vary with the path"
The function $1/z$ is analytic in the open plane ${\mathcal C} = \{ |z| > 0 \}$ (the complex plane with a hole punched in it at the origin). Both paths $|z| = 1$ and the square surrounding the origin lie completely in ${\mathcal C}$, so that is why the integrals are the same. It is a fundamental property of complex-function theory, not a coincidence.

The function $\bar{z} = \text{conjugate of } z$ is not analytic in $\mathcal C$, so that is why the two integrals are different.

Thanks for your replies. The conjugate of z is nowhere analytic within the unit circle or the square so the 2 integrals are different.
But the reciprocal of z is also not analytic within the circle or square as it is not differentiable at z=o so why in this case are both integrals the same ?

nrqed
The residue theorem does not demand that the function must be analytic everywhere. If the function is analytic everywhere except at a set of points $p_1, p_2 \ldots$, the the residue theorem still applies. It might be useful to go back and study the derivation of the residue theorem.