# Using complex numbers for evaluating integrals

1. Oct 16, 2012

### genjix

How can I use complex numbers to evaluate an integral? For instance I'm reading a book on complex numbers and it says that to evaluate the integral from 0 to pi { e^2x cos 4x dx }, I must take the real part of the integral from 0 to pi { e^((2 + 4i)x) dx}.

It totally skips how you do that. I don't see how taking the real part of the second integral relates to the first one. If I try to integrate e^((2 + 4i)x) and then take the real part, I eventually get:

Re(z) = 1/5 e^2x (1/2 cos 4x + sin 4x)

But I don't see any relation whatsoever, or how they did this.

2. Oct 16, 2012

### tiny-tim

welcome to pf!

hi genjix! welcome to pf!

(try using the X2 button just above the Reply box )
show us how you did this

3. Oct 16, 2012

### genjix

Well I went onto #math on Freenode and someone gave me the missing puzzle piece. Basically that Re(integral f(x)) = integral Re(f(x)). With that in hand, everything is obvious:

Take the real part of e^2x e^4ix
Re(e^2x e^4ix) = e^2x (cos 4x + i sin 4x) ... from de moivre and because the Re(integral f(x)) = integral Re(f(x)), we can say that Re(integral e^2x e^4ix) = integral Re(e^2x e^4ix) = integral Re(e^2x (cos 4x + i sin 4x)) = integral e^2x cos 4x

now the integral e^2x e^4ix = integral e^(2 + 4i)x and to integrate exponentials we have the usual integral e^cx = 1/c e^cx

so we get:
1/(2 + 4i) e^{(2 + 4i)x}
http://mathbin.net/110072 [Broken] (multiply top and bottom of fraction by (2 - 4i) on first line)
now we have the bottom line to be evaluated from 0 to +pi (as per the original integral)
cos 4pi = cos 0 = 1
sin 4pi = sin 0 = 0

so we get the final line as being:
1/5 e^2pi (1/2 cos 4pi + sin 4 pi) - 1/5 e^0 (1/2 cos 0 + sin 0) = 1/10 (e^2 - 1)

Last edited by a moderator: May 6, 2017
4. Oct 16, 2012

### genjix

I just did, but my post isn't showing up? I try to click back in my browser and submit it, but it is saying I've made a duplicate post strangely.

I found someone on #math in Freenode who told me that the Re(integral f(x)) = integral Re(f(x)) which is the missing puzzle piece I needed to work everything out. The post I've tried to make here shows all my working out for others to see how it is done.

5. Oct 17, 2012

### tiny-tim

hi genjix!

(just got up :zzz:)
yes, that's right

(if you're still unsure, try submitting your proof again)