# Is there a formula to extract the real part of a complex number?

I was pondering the topic of complex numbers and how we just look at the them and extract the real and imaginary parts because it's easy given that we write it like 4+2i. I was wondering if there was some mathematical formula, in which we could put any complex number, and it would output the real (or imaginary) part of that number.

EDIT: as fleablood pointed out in the comment of this post

Which maybe seems circular as $\overline z==Re(z)−iIm(z)$. There's also $Re(z)=cos(arg(z))$ where $arg(z)$ is the argument angle of the complex number. Note: all of these take it as given that a complex number determined/defined by two factors and find $Re(z)$ is always a matter of taking the factor or manipulating a factor that was given.

What I'm asking is, whether there's an equation or set of operations in which you could take an imaginary number and put it through some that equation (not defined by $Re(z)$ or $Im(z)$) and have it return either the real or imaginary part. Sorry for any confusion and/or ignorance on my part.

• Sure $Re(z)$ is the real part of complex number $z.$ A bit of a cop-out, isn't it? – Doug M May 19 '17 at 20:19
• Yes, it's fz=(a+bi) = a. You just see it and pull it out. That is a formula. We call it Re(z). – fleablood May 19 '17 at 20:19
• D'oh. I forgot the obvious sws1710 answer. Which maybe seems circular as $\overline z = Re(z) - i Im(z)$. There's also $Re(z) = cos (arg (z))$ where arg(z) is the argument angle of the complex number. Note: all of these take it as given that a complex number determined/defined by two factors and find Re(z) is always a matter of taking the factor or manipulating a factor that was given. – fleablood May 19 '17 at 20:23

## 2 Answers

Let $z\in\Bbb C$. Then the real part is $\dfrac{z+\bar{z}}{2}$ and the imaginary part is $\dfrac{z-\bar{z}}{2i}$.

If you have access to the argument $\arg(z)$ and absolute value $|z|$ then you can do a Taylor expansion of exponential function on the matrix

$$Z_{polar} = \left[\begin{array}{rr} \log(|z|)&\arg(z)\\ -\arg(z)&\log(|z|) \end{array}\right]$$

You can basically just stuff this $Z$ into the calculus formula:

$$\exp(x) = \sum_{k=0}^N \frac{{x}^k}{k!}$$ For some suitable large $N$. This series converges really fast so you probably don't need very many terms.

The answer for the real part will end up all along the diagonal according to the matrix representation for complex numbers:

$$z = a+bi \Rightarrow M_z = \left[\begin{array}{rr}a&b\\-b&a\end{array}\right]$$

Actually this answer can maybe be used as a motivation for the definition of the complex logarithm.