# Complex integration over contour by definition

Suppose $$\gamma$$ is a line segment between 1 and $$3 + i$$. Calculate $$\int_{\gamma}z^2dz$$ by definition and using the fact that $$\int_{\gamma}f(z)dz = F(b) - F(a)$$.

Now the second task seems almost like integral over reals:

$$\int_{\gamma}z^2dz = \frac{z^3}{3}\Big|_1^{3+i} = \frac{(3+i)^3 - 1}{3}$$

I got stuck on the first part though as I just got introducted to the complex integrals.

$$\int_{\gamma}f(x)dz = \int_a^bf(\gamma(s))\gamma'(s)ds$$

How can I find the $$\gamma$$? Is it the line $$y=\frac{1}{2}x - \frac{1}{2}$$? How can I transfer that into complex numbers?

If you want to find a line segment from $$z_0$$ to $$\zeta_0$$ you can consider $$\gamma:[0,1]\rightarrow \mathbb{C}$$ defined by

$$\gamma(t) = (1-t)z_0+t\zeta_0$$

$$\gamma(t) = (1-t)\cdot 1+t(3+i) = 1+2t+it.$$
$$\gamma'(t) = 2+i$$. Now insert this into your integral...
The line is $$(1-s)(1)+s(3+i)$$. You get $$\int_0^1f(\gamma(s))(2+i)\operatorname ds=(2+i)\int_0^1(2s+1+is)^2\operatorname ds=(2+i)\int_0^1(4s^2+4s+(4s+2)is-s^2+1)\operatorname ds=(2+i)[(3+4i)/3s^3+2s^2+is^2+s]_0^1=(2+i)((3+4i)/3+2 +i+1)=(2+i)(4+7/3i)=17/3+26/3i$$.