# difficult complex integral $\int_\gamma \frac{1}{z^2+i}dz$

We are asked to calculate $\int_\gamma \frac{1}{z^2+i}dz$ where $\gamma$ is the straight line from $i$ to $-i$ in that direction.

My parametrization is simple, I chose $z(t)=i-2it$. Notice that indeed $z(0)=i$ and $z(1)=-i$, and $dz=-2idt$, so the integral becomes

$\int_\gamma \frac{1}{z^2+i}dz=\int_{0}^{1}\frac{-2i}{(i-2it)^2+i}dt$ and here I'm stuck. I don't know how to integrate $\frac{1}{(i-2it)^2+i}$ and would appreciate any guidance I can get.

Thank you.

Edit: A good idea may be to use a variable change $v=i-2it$, and then we need to integrate $\int \frac{1}{v^2+i}dv$

• A partial fraction decomposition of the integrand might prove fruitful. – Daniel Fischer Dec 21 '14 at 19:38
• Note that $(i - 2it)^2 = -1 + 2t - 4t^2$ This is a real polinomial function. – user6565190 Dec 21 '14 at 19:39
• Partial fraction is a good idea. then the integral would be the natural logarithm...thats not bad. – Oria Gruber Dec 21 '14 at 19:40
• With regards to the comments above, that might be true, but I don't see the advantage over just integrating $z\mapsto \dfrac 1{z^2+i}$ from the get-go. – Git Gud Dec 21 '14 at 19:40
• Is there a reason not to workin with the parameterization $z(t) = it$ with $t: 1\to -1$? I tried working this out but I keep getting 0 ($\not =$ WolframAlpha's solution) – dietervdf Dec 21 '14 at 19:46

Note $$\frac{1}{(i - 2it)^2 + i} = \frac{1}{i^2(1 - 2t)^2 + i} = \frac{1}{i - (1 - 2t)^2} = \frac{-i - (1 -2t)^2}{1 + (1 - 2t)^4}.$$

So $$\frac{-2i}{(i-2it)^2+i} = \frac{-2 + 2i(1 - 2t)^2}{1 + (1 - 2t)^4}.$$

Using this you can write

$$\int_{\gamma} \frac{dz}{z^2 + i} = -\int_0^1 \frac{2}{1 + (1 - 2t)^4}\, dt + i\int_0^1 \frac{2(1 - 2t)^2}{1 + (1 - 2t)^4}\, dt.$$

Now we evaluate each integral on the right separately. Using the $u$-substitution $u = 1 - 2t$, we have

$$\int_0^1 \frac{2}{1 + (1 - 2t)^4}\, dt = \int_{-1}^1 \frac{1}{1 + u^4}\, du = 2 \int_0^1 \frac{1}{1 + u^4}\, du.$$

Note

\begin{align}\frac{1}{1 + u^4} &= \frac{1}{(1 + u^2)^2 - (u\sqrt{2})^2}\\ &= \frac{1}{(1 -u\sqrt{2} + u^2)(1 + u\sqrt{2} + u^2)}\\ &= \frac{1}{2u\sqrt{2}}\cdot \left\{\frac{1}{1 - u\sqrt{2} + u^2} - \frac{1}{1 + u\sqrt{2} + u^2}\right\}. \end{align}

Thus

\begin{align} &\int_0^1 \frac{2}{1 + u^4}\, du\\ &=\int_0^1 \left[\frac{1}{u\sqrt{2}(1 - u\sqrt{2} + u^2)} - \frac{1}{u\sqrt{2}(1 + u\sqrt{2} + u^2)}\right]\, du\\ &= \int_0^{\sqrt{2}} \left[\frac{1}{v\left(1 - v +\frac{v^2}{2}\right)} - \frac{1}{v\left(1 + v + \frac{v^2}{2}\right)}\right]\, \frac{dv}{\sqrt{2}} \quad (\text{letting $v = u\sqrt{2}$})\\ &= \int_0^{\sqrt{2}} \left[\frac{2}{v(2 - 2v + v^2)} - \frac{2}{v(2 + 2v + v^2)}\right]\, \frac{dv}{\sqrt{2}}\\ &= \int_0^{\sqrt{2}} \left[\left(\frac{1}{v} - \frac{v - 2}{2 - 2v + v^2}\right) - \left(\frac{1}{v} - \frac{v + 2}{2 + 2v + v^2}\right)\right]\, \frac{dv}{\sqrt{2}} \\ &= \int_0^{\sqrt{2}} \left(\frac{v + 2}{2 + 2v + v^2} - \frac{v - 2}{2 - 2v + v^2}\right)\, \frac{dv}{\sqrt{2}}\\ &= \int_0^{\sqrt{2}} \left[\left(\frac{2v + 2}{2(2 + 2v + v^2)} + \frac{1}{2 + 2v + v^2}\right) - \left(\frac{2v - 2}{2(2-2v+v^2)} - \frac{1}{2-2v+v^2}\right)\right]\, \frac{dv}{\sqrt{2}}\\ &=\int_0^{\sqrt{2}} \left[\frac{2v+2}{2(2+2v+v^2)} - \frac{2v-2}{2(2-2v+v^2)} + \frac{1}{1+(v+1)^2} + \frac{1}{1 + (v-1)^2}\right]\, \frac{dv}{\sqrt{2}}\\ &=\frac{1}{2\sqrt{2}}\left\{\log\left|\frac{2+2v+v^2}{2-2v+v^2}\right| + 2\tan^{-1}(v+1) + 2\tan^{-1}(v-1)\right\}\bigg|_{v = 0}^{v=\sqrt{2}}\\ &=\frac{1}{2\sqrt{2}}\left\{\log\left(\frac{4+2\sqrt{2}}{4-2\sqrt{2}}\right) + 2[\tan^{-1}(\sqrt{2} + 1) +\tan^{-1}(\sqrt{2}-1)]\right\}\\ &= \frac{1}{2\sqrt{2}}\left\{\log\left(\frac{4\sqrt{2}+4}{4\sqrt{2} - 4}\right) + 2\left(\frac{\pi}{2}\right)\right\}\\ &= \frac{1}{2\sqrt{2}}\left\{\log\left(\frac{\sqrt{2}+1}{\sqrt{2}-1}\right) + \pi\right\}\\ &= \frac{\pi + 2\coth^{-1}(\sqrt{2})}{2\sqrt{2}}. \end{align}

By a similar process, we find

\begin{align} &\int_0^1 \frac{2(1 - 2t)^2}{1 + (1 - 2t)^4}\, dt\\ &= \int_0^1 \frac{2u^2}{1 + u^4}\, du\\ &= \int_0^1 \frac{2u^2}{2u\sqrt{2}}\left(\frac{1}{1-u\sqrt{2}+u^2} - \frac{1}{1-u\sqrt{2}+u^2}\right)\, du\\ &= \frac{1}{\sqrt{2}}\int_0^1 \left(\frac{u}{1-u\sqrt{2}+u^2} - \frac{u}{1+u\sqrt{2}+u^2}\right)\, du\\ &= \int_0^{\sqrt{2}} \left(\frac{v}{2-2v+v^2} - \frac{v}{2+2v+v^2}\right)\, \frac{dv}{\sqrt{2}}\\ &= \frac{1}{\sqrt{2}}\int_0^{\sqrt{2}} \left(\frac{2v-2}{2(2-2v+v^2)} - \frac{2v+2}{2(2+2v+v^2)} + \frac{1}{2-2v+v^2} + \frac{1}{2+2v+v^2}\right)\, dv\\ &= \frac{1}{2\sqrt{2}}\left\{\log\left|\frac{2-2v+v^2}{2+2v+v^2}\right| + 2\tan^{-1}(v-1) + 2\tan^{-1}(v+1)\right\}\bigg|_{v=0}^{v=\sqrt{2}}\\ &= \frac{\pi - 2\coth^{-1}(\sqrt{2})}{2\sqrt{2}}. \end{align}

Hence $$\int_{\gamma} \frac{dz}{z^2 + i} = -\frac{\pi + 2\coth^{-1}(\sqrt{2})}{2\sqrt{2}} + \frac{\pi-2\coth^{-1}(\sqrt{2})}{2\sqrt{2}}i.$$

Using parameterization $z(t) = it \quad (t: 1 \to -1)$.

$$\int_\gamma f(z) \operatorname d z = \int_1^{-1} \frac{i}{i-t^2} \operatorname d t$$

$$= i \int_1^{-1} \frac{1}{(e^{i\frac{\pi}{4}} -t)(e^{i\frac{\pi}{4}} +t)} \operatorname d t$$ $$= i \frac{1}{2e^{i\frac{\pi}{4}}}\int_1^{-1} \left(\frac{1}{e^{i\frac{\pi}{4}} -t} +\frac{1}{e^{i\frac{\pi}{4}} +t} \right) \operatorname d t$$

$$= \frac{i}{2}\left[-\ln (e^{i\frac{\pi}{4}}-t) + \ln(e^{i\frac{\pi}{4}}+t) \right]^{-1}_1$$

$$= \frac{i}{2}\left[\ln(e^{i\frac{\pi}{4}}-1) - \ln(e^{i\frac{\pi}{4}}+1)\right]$$

I think it's looking good, but Wolfram Alpha does not agree.

Solution should be $-1.739\ldots + 0.487\ldots i$.