# Complex contour integral

Let

$$\int_\gamma z(e^{z^2}+1)dz,$$

where $\displaystyle \gamma(t)=e^{it},t \in \left[0,\frac{\pi}{2}\right]$.

In order to apply Cauchy's integral formula, I'll set $f(z)=z^2\left(e^{z^2}+1\right)$ and rewrite

$$\int_\gamma z(e^{z^2}+1)dz=\int_\gamma \frac{f(z)}{z} dz.$$

$f(0)=0$, so we would have $$\int_\gamma z(e^{z^2}+1)dz=0$$

Unfortunately, this seems to be wrong, because another evaluation from the source, where I've taken this integral yields $\displaystyle \frac{e^{-1}-e}{2}-1$. Where did I make a mistake?

-
How would you apply Cauchy's Integral Formula if the integration path isn't closed? – DonAntonio Jul 23 '12 at 21:35
Could you elaborate your question, I am not sure in which direction you are pointing... – Chris Jul 23 '12 at 21:37
Well, [CIF][1] requires the integration path to be closed (and simple, piecewise smooth and stuff), so it cannot apply to this case as we only have one quarter of a circumference...not a closed path. [1]:en.wikipedia.org/wiki/Cauchy%27s_integral_formula – DonAntonio Jul 23 '12 at 21:41
BTW, I get almost what you got, but with $\,-1/2\,$ instead of $\,-1\,$: $\,-\sinh 1-1/2\,$... – DonAntonio Jul 23 '12 at 21:42
Yes, because of that. – DonAntonio Jul 23 '12 at 22:23

The only thing you need Cauchy for in this problem is to tell you that you're allowed to integrate over a different path with the same endpoints. For instance, consider the change of variable $u=z^2$. Then $$\int_{\gamma}z\left(e^{z^2}+1\right)dz=\frac{1}{2}\int_{\gamma'}\left(e^u+1\right)du,$$ where $\gamma'(t)=e^{it}$, $t\in[0,\pi]$. The integrand has no poles, so you can integrate over any contour with the same endpoints ($+1$ and $-1$) without changing the value; in particular you can just evaluate the real integral $$\frac{1}{2}\int_{+1}^{-1}\left(e^u+1\right)du = -\frac{1}{2}\left(e^u + u\right)\Big\vert_{-1}^{+1}=\frac{e^{-1}-e}{2}-1.$$