# Confused by $\Re(z)$ and closed contours, why isn't it the integral 0?

Let the contour $\gamma$ be the triangle with vertices $\ 0, 1, 1+i$, taken anticlockwise.

As this is a closed contour and I understand $$\oint_\gamma z\ dz = 0$$ as it is analytic inside the contour (and everywhere else).

However, how are you meant to evaluate $$\oint \Re(z) \ dz$$

As it's not analytic inside the contour, I split the triangle into three parametrised lines:

$$\gamma_1: t\quad 0\le t\le 1 \\ \gamma_2: 1+it\quad 0\le t\le 1 \\ \gamma_3: 1+i -(1+i)t\quad 0\le t\le 1$$

When you find the derivatives and substitute, then integrate, my final answer is $\not1$, but the answers say $\frac12 i$

Have I made a calculation error, or am I approaching the question the wrong way?

Edit my working, answer is still wrong now right.. :

$$\oint_\gamma \Re(z) = \int_0^1 \Re(t)\ dt + i\int_0^1\Re(1+i)\ dt - (1+i) \int_0^1 \Re(1+i - t(1+i))\ dt \\= \int_0^1 \not1 t\ dt + i \int_0^1 1\ dt - (1+i)\int_0^1(1 - t) \ dt \\= \not 1\frac12 + i - \frac{(1+i)}{2} \\ = \frac12 i$$

Final edit: Made a error on second line, was a calculation error.

-
Small tip: if you want us to tell you if there's anything wrong with your calculations, include them in the question. – Javier Jun 13 '13 at 1:47
@Javier: Not necessarily, because $dz$ is complex. You can only take the real part inside if you're integrating along the real axis. For instance, compute the integral from $0$ to $i$ of $z$ and its real part. – Sharkos Jun 13 '13 at 2:01
Sorry, I'm new to Tex. There's my working out – tgun926 Jun 13 '13 at 2:05
@Sharkos: Yes, I realized that after I posted the comment. – Javier Jun 13 '13 at 10:08

$\gamma_1$ gives rise to $1/2\times 1$.

$\gamma_2$ gives rise to $1\times i$. This is from $\int 1 d(1+it)=\int 1 dt\times i$.

$\gamma_3$ gives rise to $(1-1/2)\times(-(1+i))$.

Summing gives $1/2+i-(1+i)/2=i/2$.

Edit: Your current error is that the real part of $t$ is not 1 but $t$ in the first integral.

-
I JUST realised that and was correcting myself when you answered. Thank you! At least my methodology was correct, even though my calculations aren't too great. – tgun926 Jun 13 '13 at 2:16
No problem! Just strong at each term one at a time from line to line is the best way to spot these. Ignore the bit of you that can't be bothered because it's too easy to have made a mistake on! – Sharkos Jun 13 '13 at 2:21