1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Calculator operations and value of i.

  1. Apr 12, 2012 #1
    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. jcsd
  3. Apr 12, 2012 #2
    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)
  4. Apr 12, 2012 #3
    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?
  5. Apr 12, 2012 #4
    @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.

    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
  6. Apr 12, 2012 #5


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    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.
  7. Apr 12, 2012 #6
    Don't worry, I got that. I was just asking you where your confusion comes from. :smile:

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


    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


    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 [itex]e^w=z[/itex]. In fact there are multiple such numbers (for example [itex]e^{2\pi i}=1=e^0[/itex]). 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) [itex]e^w=z[/itex]
    2) The imaginary part of w is in [itex]]-\pi,\pi][/itex].

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

    Note that the complex logarithm is annoying. It does NOT satisfy identities like [itex]Ln(xy)=Ln(x)+Ln(y)[/itex] anymore!!
    Last edited: Apr 12, 2012
  8. Apr 12, 2012 #7
    Huh?? Why would that be??

    For example: [itex]e^1=e[/itex] and [itex]ln(1)=0[/itex], but e is not zero.
    It is certainly not true that [itex]e^x=ln(x)[/itex].
  9. Apr 12, 2012 #8
    Ahhhh you're right. :blushing: 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. :)
  10. Apr 12, 2012 #9
    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)
  11. Apr 12, 2012 #10


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Depending on what precisely you mean, either:

    • The answer is 'i'.
    • 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.
  12. Apr 12, 2012 #11
    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?
  13. Apr 12, 2012 #12
    Well, [itex](a,b)*(c,d)=(a+ib)*(c+id)=ac+ibc+iad+i^2bd=(ac-bd) + i(bc+ad)=(ac-bd,bc+ad)[/itex], where [itex]a,b,c,d \in \mathbb{R}[/itex]
  14. Apr 12, 2012 #13
    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?"
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook