When I do this contour integral, facing a extreme predicament, I have some difference about the residue part.
Here is my step:
To make it simple, I want to know the extra form of $\log^2 (-1+i)-\log^2 (-1-i)$.
Then it is apparently a form of differences of squares, so I factorize it and get $$[\log (-1+i)+\log (-1-i) ][\log (-1+i)-\log (-1-i) ] = \log ((-1+i) (-1-i)) \log (\frac{-1+i}{-1-i}) = \log 2 \log -i = -\frac{\pi}{2} log 2$$.
But the correct answer gives:
$$\log^2 (-1+i) = \left(\frac{1}{4}\log^2 2 - \frac{9}{16} \pi^2 + \frac{3}{4}\log 2 \times i\pi\right)\tag{1}$$ and $$\log^2 (-1-i) =\left(\frac{1}{4}\log^2 2 - \frac{25}{16} \pi^2 + \frac{5}{4}\log 2 \times i\pi\right)\tag{2}$$ From $(1)-(2)$, $\log^2 (-1+i) -\log^2 (-1-i) = \left(\pi^2 - \frac{1}{2}i\pi \log 2\right)$
I use wolframalpha and its result is mine but obviously, mine is not correct because with that I continued my calculation finally got a different answer.
Can someone help me? I really struggle with this different. Any help, I will thank.
Here $log^2(x) \text{ equals } log(x) \times \ log(x)$
$\quad\log^2(-1-i)$
$=[(\log(-1-i))]^2$
$=[(\log(\sqrt2e^{5i\pi/4})]^2$
$=[\frac12\log(2)+5i\pi/4 \ +\ 2ni\pi]^2$
Because complex $\log$ is multi-valued.
If we take $n=0$, we would get $\log^2 (-1-i) =\left(\frac{1}{4}\log^2 2 - \frac{25}{16} \pi^2 + \frac{5}{4}\log 2 \times i\pi\right)$, same as the "correct answer" you referenced.
If we take $n=-1$, we would get $\log^2 (-1-i) =\left(\frac{1}{4}\log^2 2 - \frac{9}{16} \pi^2 - \frac{3}{4}\log 2 \times i\pi\right)$, which would produce your answer.
So, which one should we take?
Notice that in the answer you linked to, it is said that "[w]e use the branch of the logarithm with the cut along the positive real axis and returning an argument from zero to $2π$."
Which means, we should make the complex part of the logarithm between $0$ (inclusive) and $2\pi$ (exclusive).
Which means, we should take $n=0$ instead of $n=-1$.