$u$ and $v$ are real and imaginary part of a complex function $f(z)$ find $\oint udy+vdx$ over $C$

Can we write $$ \oint f(z)\;dz = \oint (u+iv)(dx+idy) = \oint \left(u\;dx - v\;dy \right) + i \left(u\;dy+v\;dx\right) $$ so that we are computing the imaginary part of $\oint f(z)\;dz$. And that is easy using the residues of $f$.


I assume that you don't know the residue theorem which is the convenient way of dealing with this kind of problem.

Hint for a direct calculation. We have that $z^2-6z+8=(z-2)(z-4)$ and therefore $$\frac{1}{z^2-6z+8}=\frac{1/2}{z-2}-\frac{1/2}{z-4}.$$ Now split the integral and note that if $z=x+iy$ and $a\in \mathbb{R}$ then $$\frac{1}{z-a}=\frac{\overline{z}-a}{|z-a|^2}=\frac{(x-a)-iy}{(x-a)^2+y^2}.$$