# Calculator operations and value of i.

1. Apr 12, 2012

### Mholnic-

Like many math newbies, complex numbers (or at least the idea of complex numbers) are a source of some confusion... but I've worked with them before and I'm reading through posts on PF that I hope will give me some sense of intuition about them. That said, there is one nagging question that I've never seen addressed -- what value does a calculator use for i?

If e^(i)(pi) is equal to -1, and e^pi is equal to 23.14069263~, it seems (to my inexperienced mind) that there'd have to be a more concrete value to i than some number that, when squared, gives -1 -- at least when it comes to computations done by a programmed machine. Naturally when I tried to solve it with logs, dividing ln(-1) by ln(pi) my calculator said it was a nonreal number... which I was expecting given that I was attempting to solve for i.

Any thoughts? I'm aware that this is probably an incredibly naive question.. I'm just hoping that the answer is something other than "Calculators use some number that, when squared, is equal to -1." xD Calculators are programmed by humans so I'm guessing there should be some value for i programmed into it -- what is the "some number" value used by a calculator when it deals with complex numbers?

2. Apr 12, 2012

### SteveL27

Not saying how actual calculators do it, but in general you evaluate complex exponentials using Euler's formula

e^it = cos(t) + i*sin(t)

3. Apr 12, 2012

### micromass

The complex number i has no concrete value in calculators other than i itself. We can't say (for example) that i=1.235 because it's simply not true.

Why does it seem like that to you?? Can you explain further how these two equalities seem to give you a concrete value to i?

4. Apr 12, 2012

### Mholnic-

@Micromass: Just to be clear I'm not at ALL saying the mainstream is wrong and I'm right. I recognize that I'm wrong and that the way I'm seeing it is incorrect, so I was hoping to have my view corrected. ;) But to elaborate on my confusion, to get from 23.1~ to -1, something is being done.. that "something" is the introduction of i, so the calculator appears (to me) to apply a value to i. There is little doubt that I'm perceiving this incorrectly, hence my question.

I'm trying to find out what that value is, or if there is no value... what it's doing to get the numbers its getting; put another way.. if I asked a calculator (whose only knowledge came from its programming) "What is i?"... what would it tell me? If there was no value for i other than i in the calculator, than I would expect the answer for e^(i)(pi) to be closer to 1.144729886 +1.570796327i (the natural log of pi + natural log of i) instead of -1. Again, my novice view is that to change it from 23.1~ to 1~ something (some value) is being used. Hell the fact that you can even take the natural log of i implies (to me) that it is taking the natural log of SOMETHING other than a variable without a value, otherwise.. well, wouldn't it just say ln i = ln i?

I'm asking my question(s) from a position of ignorance, so don't think for a moment that I think I know what I'm talking about. I don't, and I'm hoping to correct that.

Edit:
Unless I'm screwing up my algebra, e^(i)(pi) is equal to ln (i*pi), which is equal to ln(i)+ln(pi). My calculator simply gives me 1.144729886 +1.570796327i for that answer, instead of -1 like I would have expected. TI-84 Plus Silver.
2nd Edit: Yep. I screwed my up algebra. Not changing anything in the post, just a note to any fellow newbs who might have been following along... I forgot to remove the ln after taking the natural log, it should've just been (i*pi), not ln(i*pi).

Last edited: Apr 12, 2012
5. Apr 12, 2012

### Integral

Staff Emeritus
The calculators I have used required a special number format to do imaginary number operations. So yours understands the symbol "i"?

You may want to explore for information on Complex Analysis.

6. Apr 12, 2012

### micromass

Don't worry, I got that. I was just asking you where your confusion comes from.

I think the confusion comes from the very notion of exponential of a complex number. If x+yi is an arbitrary complex number, then

$$e^{x+iy}=e^x(\cos(y)+i\sin(y))$$

is the value of the exponential. Why did we choose this value?? I can't explain it to you until you have seen Taylor series. But believe me, there are extremely good reasons for choosing it this way.

Anyway, if we put x=0 and y=pi, then we get

$$e^{i\pi}=e^0(\cos(\pi)+i\sin(\pi)=-1$$

This is how the calculator evaluates the complex exponential.

It is quite unclear to me why you would think it would be close to this number.

The confusion here is that you don't know what the logarithm is for complex numbers. It's definition of ln(z) is exactly the number w such that $e^w=z$. In fact there are multiple such numbers (for example $e^{2\pi i}=1=e^0$). We want a unique number w, so we add an extra condition:

Ln(z) is equal to the unique complex number w such that
1) $e^w=z$
2) The imaginary part of w is in $]-\pi,\pi]$.

As you can see, because $e^{i\pi}=-1$, we see that $i\pi$ is the unique number that satisfies the above with $z=-1$. This gives us $Ln(-1)=i\pi$.

Note that the complex logarithm is annoying. It does NOT satisfy identities like $Ln(xy)=Ln(x)+Ln(y)$ anymore!!

Last edited: Apr 12, 2012
7. Apr 12, 2012

### micromass

Huh?? Why would that be??

For example: $e^1=e$ and $ln(1)=0$, but e is not zero.
It is certainly not true that $e^x=ln(x)$.

8. Apr 12, 2012

### Mholnic-

Ahhhh you're right. When I took the natural log I removed the e and left the ln; I forgot to mentally remove the ln after I applied one of the log properties. Fail.

Ah see, I didn't know that. ;)

I suppose I'll have to wait for Calc II then. Hell the whole idea of a complex exponential, or even complex sin/cos/etc confuses me. xD It'll come in time, I'm sure.. I'm just now finishing Trig so I haven't yet entered the calculus sequence. That isn't for another 7~ weeks. (Excited.)

Thanks! I'll try to find a derivation of that concept, and sloooooowly plod my way through it until I understand what is going on. I seem to learn most of my math this way, finding something too advanced for me to understand and working backwards from there while simultaneously working forwards in my courses.

Oh, and...

I'll look into it, thanks. :)

9. Apr 12, 2012

### scurty

Did you know?: Imaginary numbers entered the realm of mathematics not as a tool for solving quadratics, but as a tool to solving cubics. (Dunham, Journey Through Genius p.151)

10. Apr 12, 2012

### Hurkyl

Staff Emeritus
Depending on what precisely you mean, either:

• You should first be asking yourself questions like "what value does a calculator use for 1?"

Typically, computers doing numeric calculations represent a complex number as a pair of representations of real numbers. If the pair is (A,B), and A represents the real number x and B represents the real number y then the pair (A,B) is used to represent the complex number x+iy.

So, i is represented as the pair (Z,I), where Z is a representation of the real number zero, and I is a representation of the real number 1.

11. Apr 12, 2012

### Mholnic-

Aheh, this answer is closer to what I was looking for, although I suspect I should've asked this question on a programming forum rather than a mathematics subforum! Since asking this question I indeed have wondered how the calculator represents real numbers, although I have a conceptual grasp of ℝ so.. I didn't wonder that hard. [pause] Actually this helps more than I thought! It puts into context another answer I saw in a 4-year-old thread I read before making this one.. at the time I didn't know what the guy was talking about, as he seemingly randomly multiplied coordinates together.

I've never seen complex numbers dealt with in that way.. I definitely prefer it! :D Do you by chance know the origin or name of the coordinate-based method of dealing with complex numbers, so that I might investigate it in more detail?

12. Apr 12, 2012

### scurty

Well, $(a,b)*(c,d)=(a+ib)*(c+id)=ac+ibc+iad+i^2bd=(ac-bd) + i(bc+ad)=(ac-bd,bc+ad)$, where $a,b,c,d \in \mathbb{R}$

13. Apr 12, 2012

### Mholnic-

Yeah I reworded that last bit when I realized that I was asking about the rules governing manipulation of complex numbers (which I've covered before in previous courses) instead of the method of treating complex numbers as coordinates rather than a+bi. I'd never seen 'i' treated in that fashion, and even with a brief glance it made a hell of a lot more sense than the way I'd traditionally seen the topic explained. Related to Hurkyl's claim that computers tend to treat complex numbers as pairs of real numbers, I wasn't able to find much (short of a brief reference to the "formal construction" of complex numbers on Wikipedia) about it. It now reads as: "Do you by chance know the origin or name of the coordinate-based method of dealing with complex numbers, so that I might investigate it in more detail?"