Problem: Let $\gamma :[0,1]\to \mathbb{C} $ be any piecewise smooth path joining $0$ to $1 + 3 \iota $. Compute the integral \[ \int _\gamma \left( z^3 + 2 \right) \mathrm{d} z. \]
Solution: Since the function $f(z) = z^3 + 2$ is an analytic function and hence, the integral will be independent of paths. So the integral will be same along any path.
Therefore, \begin{align*} \int _\gamma \left( z^3 + 1 \right) \mathrm{d} z & = \int _0^{1+3\iota} \left( z^3 + 1 \right) \mathrm{d} z \\ & = \left[ \frac{z^4}{4} + z \right]_0 ^{1+3\iota } \\ & = \left[ \frac{(1+3\iota )^4}{4} + (1+3\iota ) - 0 \right] \\ & = \frac{28-96\iota}{4}+ 1+3\iota \\ & = 7 - 24\iota + 1 + 3\iota \\ & = 8 - 21\iota . \end{align*} Hence, \[ \int _\gamma \left( z^3 + 1 \right) \mathrm{d} z = 8 - 21\iota . \]