Integrating a real-valued function with complex numbers

123 Views Asked by At

I want to integrate $$\int\frac{x}{x^2+4x+5}\;dx$$ and I tried to use partial fractions because $x^2+4x+5=(x+2+i)(x+2-i)$. Therefore: \begin{align} \frac{x}{x^2+4x+5}&=\frac{A}{x+2+i}+\frac{B}{x+2-i}\\ x&=A(x+2-i)+B(x+2+i)\\ &=(A+B)x+(2A+2B-Ai+Bi) \end{align} After solving for $A$ and $B$ using \begin{align} \begin{cases} A+B&=1\\ 2A+2B-Ai+Bi&=0 \end{cases}\Longleftrightarrow A=\frac{i+2}{2i}, B=-\frac{2-i}{2i} \end{align} I plugged the coefficients back into to equation. Hence I got \begin{align} \int\frac{i+2}{2i}\frac{1}{x+2+i}-\frac{2-i}{2i}\frac{1}{x+2-i}\;dx&=\frac{i+2}{2i}\int\frac{1}{x+2+i}\;dx-\frac{2-i}{2i}\int\frac{1}{x+2-i}\;dx\\ &=\frac{i+2}{2i}\ln{(x+2+i)}-\frac{2-i}{2i}\ln{(x+2-i)}+c \end{align} My question: I have never integrated a function with complex numbers before and I am wondering if this approach is valid and correct? Is it also possible to turn this antiderivative back into a function that only contains real values because I know that one can also write this antiderivative like $$\frac{1}{2}\ln{(x^2+4x+5)}-2\arctan{(x+2)}+c$$ Thanks in advance for your answer!

3

There are 3 best solutions below

3
On BEST ANSWER

Starting with the answer of OP, we rearrange it and get $$ \begin{aligned} I= & \frac{1}{2}[\ln (x+2+i)+\ln (x+2-i)] +\frac{1}{i}[\ln (x+2+i)-\ln (x+2-i)]+C \\ = & \frac{1}{2} \ln(x^2+4x+5) +\frac{1}{i} \ln \left|\frac{x+2+i}{x+2-i}\right|+C \end{aligned} $$ $$ \begin{aligned} \frac{1}{i} \ln \left[\frac{\sqrt{x^2+4 x+5} e^{i \tan ^{-1}\left(\frac{1}{x+2}\right)}}{\sqrt{x^2+4 x+5} e^{i \tan ^{-1}\left(\frac{-1}{x+2}\right)}}\right] = & \frac{1}{i} \ln \left[e^{2 i \tan ^{-1}\left(\frac{1}{x+2}\right)}\right] \\ = & \frac{1}{i} \cdot 2 i \tan ^{-1}\left(\frac{1}{x+2}\right) \\ = & -2 \tan ^{-1}(x+2) \end{aligned} $$ where the last step uses the identity : $\tan ^{-1} u+\tan ^{-1} \frac{1}{u}=\frac{\pi}{2}$.

Hence we have$$ I=\frac{1}{2} \ln \left(x^2+4 x+5\right)-2 \tan ^{-1}(x+2)+C $$

0
On

The trick is to note that the real and imaginary parts are independent in some sense for operators like addition, subtraction, scalar multiplication (and thus scalar integration).

Use ${Re}(.)$ i.e. the real part function. It has properties such as:

$ \displaystyle \int Re(f(x)) dx = Re \left (\int f(x) dx \right) $,

$Re(f+g) = Re(f) + Re(g) $, etc.

1
On

Everything you did with just complex rational functions is 100% legitimate.

It's also pretty easy to define integrals of complex valued functions defined on the reals, and the integral of the sum of two functions is still the sum of the separate integrals, so that parts legit too.

But when you say that some of these integrals yield the $\log( )$ function you've got to explain what you mean by the logarithm of complex numbers, and you have to choose branches of the log function and it gets messy.

And if you start applying rules for the logarithm that apply in the real case to the complex logarithm, you might get a valid answer or you might not, as many of them stop working in the complex case.

Personally, I think it's a lot easier to break it up as

$$\frac{x+2}{x^2+4x+5}+\frac{-2}{x^2+4x+5}$$

and the first term yields the log() after a simple u-substitution, with u equal to the denominator, and in the second one you can complete the square and get the classic arctan integral, all without worrying about complex logarithms.