Inf -- a calculator that can handle infinite and infinitesimal numbers (2024)

Inf is a calculator that can handle infinite and infinitesimal numbers.Type an expression at the : prompt and hit Enter. For more documentation, scroll down.

About Inf

Basic use

Inf is a calculator that can handle infinite and infinitesimal numbers.

Special constants and variables:

  • d -- an infinitesimally small positive number
  • pi -- the ratio of a circle's circumference to its diameter
  • i -- the square root of -1

Built-in operators:

  • +, -, *, / -- arithmetic
  • ^ -- exponentiation
  • <, >, == -- comparisons (note the double equals sign to test for equality)
  • ()[]{} -- All three styles of parentheses can be used.

Built-in functions:

  • sin, cos, tan
  • asin, acos, atan
  • sqrt, abs
  • exp, ln

Inf represents infinite and infinitesimal quantities as Levi-Civita numbers.Calculus students often get the impression that the notion of an infinite or infinitesimal number can never be defined in any rigorous orself-consistent way. That's not true. Tullio Levi-Civita defined the Levi-Civita numbers around 1900, so it's been known for over acentury that there were rigorously definable number systems that included infinities. Great mathematicians like Newton, Gauss, and Euler usedinfinitesimals, and now that modern mathematicians have put them on a more rigorous footing, there'sno reason to shy away from them.To learn more about the application of infinitesimalsto calculus, see my free calculus book.(If you've ended up here because the calculus book tells you about the calculator, one thing you should realize is that the Levi-Civitanumbers used by Inf are not the full hyperreal number system referred to in the book. They are a subset of them, in the same waythat the rational numbers are a subset of the real numbers. This is why certain calculations give an errorin the calculator, even though they are well defined in the hyperreals.)

There are two basic things to understand about this system:

  1. The Levi-Civita numbers obey all the same elementary axioms of arithmetic as the real numbers.
  2. The system contains many different sizes of infinite numbers, and many sizes ofinfinitesimals, but all of them are expressed in terms of the basic building block d, which is a positive infinitesimal that we arbitrarilysingle out and give a name.

Here are some examples you can try in the calculator to get a feeling for how all this works:

  • d>0 ... true, because although d is infinitesimal, it's still greater than zero
  • d<10^-10 ... true, because d is smaller than any positive real number
  • 1/0 ... undefined

The expression 1/0 comes up as undefined, not an infinite number. This is because one of the elementaryaxioms of arithmetic is that division by zero is undefined. To get an infinite result, you could do something like 1/d, where d is the symbolbuilt in to the calculator to represent one particular infinitesimal number.

  • 1/d ... doesn't cause an error like 1/0 did
  • 1/d>1000000 ... true, because 1/d is infinite
  • d^2<d ... true, showing that we have different sizes of infinitesimals
  • sqrt(d)>d ... true

To see why there have to be many different sizes of infinities, and of infinitesimals, consider the following example. We canprove from the elementary axioms of arithmetic is that if x is greater than zero, then 2x is greater than x. This applies toLevi-Civita numbers as well, so infinite and infinitesimal numbers have to come in different sizes. In particular, there isn'tanything in the Levi-Civita system that plays the role of ∞, which is usually used as a generic symbol for infinity.

  • d^2>0 ... true, because even though d^2 is infinitesimally small compared to d, it's still not zero

This shows that the traditional practice of neglecting the square of an infinitesimal can't be formalized in the Levi-Civita system simply byequating it to zero. We can, however, say that neglecting a d2 term compared to a d is an infinitely good approximation. Here is an exampleof numerical calculus, in which we calculate the derivative of x4, evaluated at x=2:

  • [(2+d)^4-2^4]/d

The result is 32+(24)d+8d2+d3, corresponding to the fact that the derivative is 32.The right way to handle this is not to say that the trailing terms are zero, but simply to define the derivative as the standard partof the quotient dy/dx, meaning its leading term that has no d in it.

  • 1/(1-d) ... is calculated using the geometric series, up to a certain level of precision
  • exp(d) ... is calculated using a Taylor series
  • (1-cos d)/d ... gives an infinitesimal result, which is equivalent to the statement that limx→0[(1-cos d)/d]=0, as can be verified by L'Hôpital's rule

For convenience in the following, let's define an infinite variable h.

  • h=1/d
  • h ... spits back its representation in terms of the basic building block d
  • 2*h>h ... true, because 2h is a bigger infinity than h
  • 2*h+1>2*h ... and an even bigger infinity
  • sqrt(h+1)-sqrt(h-1) ... shows that this expression is (perhaps counterintuitively) infinitesimal
  • exp(h) ... is undefined in the Levi-Civita system

To amplify on statement 2 above, the infinitesimald doesn't have any special properties that would allow it to be picked out from among all the other positive infinitesimals. We just assumeit can be picked arbitrarily from the set of positive infinitesimals. The arbitrariness of this choice can be understood by analogy withthe complex numbers. To construct the complex numbers, we start by assuming that a solution to the equation x2+1=0 exists.It follows from the axioms of algebra that there are two such solutions with opposite signs, since the sign of x doesn't affect the value of x2.We call one of these i, and the other -i. Note that it makes absolutely no difference which one is i and which is -i. Similarly in the caseof the Levi-Civita numbers, we assume that a positive solution exists to the infinite set of simultaneous equations {x<1, x<1/2, x<1/3, ...}.Assuming such a solution, which is interpreted as an infinitesimal number, it follows that we can findmany other solutions as we like. Out of all thesolutions, we arbitrarily pick one and call it d.

The undefined result for exp(1/d) is an example of how the Levi-Civita numbers are a smaller system than the hyperreals,which were defined by Abraham Robinson around 1960. The hyperreals match the properties of the real numbers even better than the Levi-Civita numbers do.For example, the exponential function can take a positive infinite argument in the hyperreal system, but that doesn't work in the Levi-Civitanumbers. However, the hyperreals cannot be conveniently represented on a computer.

Fancy features

More special variables:

  • levi_civita_n -- sets the number of terms to maintain in series expansions of Levi-Civita numbers
  • precision -- sets the number of digits of precision to print in output

More built-in operators:

  • ; -- separates multiple statements on the same line
  • , -- builds arrays, e.g., (1,2)
  • = -- assigns the expression on the right to the variable named on the left-hand side

More built-in functions:

  • floor, ceil -- round down or up to an integer
  • array -- converts a Levi-Civita number, complex number, or rational number to a representation in terms of an array

User-defined functions:

  • f x = x^2

In Firefox, you can use up-arrow and down-arrow to get back lines you've typed in previously. Depending on your browser,it may also be possible to accomplish this using control-P and control-N.

Open source

Inf is open source software by Ben Crowelland Mustafa Khafateh. It's under the GPL v. 2 license. Since it's all written in client-side javascript,you can see the source code simply by doing "view source" in your browser; actually most of the code is in separatemodules pointed to from the html source code, but you can view those through your browser as well by pointing it at eachURL. Alternatively, you can access it via a web browser or git, at via github.

This link runs a test suite in your browser.

Inf -- a calculator that can handle infinite and infinitesimal numbers (2024)
Top Articles
Latest Posts
Article information

Author: Lilliana Bartoletti

Last Updated:

Views: 6027

Rating: 4.2 / 5 (53 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Lilliana Bartoletti

Birthday: 1999-11-18

Address: 58866 Tricia Spurs, North Melvinberg, HI 91346-3774

Phone: +50616620367928

Job: Real-Estate Liaison

Hobby: Graffiti, Astronomy, Handball, Magic, Origami, Fashion, Foreign language learning

Introduction: My name is Lilliana Bartoletti, I am a adventurous, pleasant, shiny, beautiful, handsome, zealous, tasty person who loves writing and wants to share my knowledge and understanding with you.