It is well known that
$$\int \frac{1}{x^2+1} \, dx = \arctan(x)+C,$$
and so I wanted to prove this using partial fraction decomposition as follows:
$\begin{aligned} \int \frac{1}{x^2 +1} \, dx & =\frac{i}{2}\int \frac{1}{x+i} -\frac{1}{x-i} \, dx\\ & =\frac{i}{2}\int \frac{1}{x+i} \, dx-\frac{i}{2}\int \frac{1}{x-i} \, dx\\ & =\frac{i}{2} \ln( x+i) -\frac{i}{2} \ln( x-i)\\ & =\frac{i}{2} \ln\left(\frac{x+i}{x-i}\right)+C \end{aligned}$
but $\arctan(x)$ in logarithmic form is $\frac{i}{2}\ln(\frac{i+x}{i-x})$.
Clearly there's a sign error somewhere, but I can't find it.
I don't think there's any error -- for we have \begin{align} & \frac i2\log\left(\frac{x+i}{x-i}\right) =\frac i2\log\left(-\frac{i+x}{i-x}\right) \\[8pt] = {} &\frac i2\log(-1)+\frac i2\log\left(\frac{i+x}{i-x}\right) \\[8pt] = {} &\frac i2\log\left(\frac{i+x}{i-x}\right)+\text{arbitrary constant}, \end{align} as wanted.