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:

Built-in operators:

Built-in functions:

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 or self-consistent way. That's not true. Tullio Levi-Civita defined the Levi-Civita numbers around 1900, so it's been known for over a century that there were rigorously definable number systems that included infinities. Great mathematicians like Newton, Gauss, and Euler used infinitesimals, and now that modern mathematicians have put them on a more rigorous footing, there's no reason to shy away from them. To learn more about the application of infinitesimals to 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-Civita numbers used by Inf are not the full hyperreal number system referred to in the book. They are a subset of them, in the same way that the rational numbers are a subset of the real numbers. This is why certain calculations give an error in 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 of infinitesimals, but all of them are expressed in terms of the basic building block d, which is a positive infinitesimal that we arbitrarily single out and give a name.

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

The expression 1/0 comes up as undefined, not an infinite number. This is because one of the elementary axioms 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 symbol built in to the calculator to represent one particular infinitesimal number.

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

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

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 part of the quotient dy/dx, meaning its leading term that has no d in it.

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

To amplify on statement 2 above, the infinitesimal d doesn't have any special properties that would allow it to be picked out from among all the other positive infinitesimals. We just assume it can be picked arbitrarily from the set of positive infinitesimals. The arbitrariness of this choice can be understood by analogy with the 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 case of 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 find many other solutions as we like. Out of all the solutions, 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-Civita numbers. However, the hyperreals cannot be conveniently represented on a computer.

Fancy features

More special variables:

More built-in operators:

More built-in functions:

User-defined functions:

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 Crowell and 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 separate modules pointed to from the html source code, but you can view those through your browser as well by pointing it at each URL. Alternatively, you can access it via a web browser or git, at via github.

This link runs a test suite in your browser.