# Representing Elementary Functions in a CAS

I've looked through several books about computer algebra. They are surprisingly scarce about how to actually represent elementary functions.

Basically, as far as I understood elementary functions are roughly

$$\textbf{Quot}\left(\mathbb K[x, \exp x, \exp x^2 \log x, \ldots] \right)$$

that is rational functions over field $\mathbb K$, with variables (or kernels) $x$, $\exp x$, $\exp x^2$, $\log x$ and so on. Other function can be added.

However it doesn't seem possible to have a finite set of kernels to represent what is meant by elementary functions. For example it should contain all kernels of the form $\exp x^n$ or $\exp \exp \ldots \exp x$. And no way you can just enumerate an infinite set within a CAS.

Apparently the algebraic treatment of elementary functions lacks the notion of composition of functions.

How is composition introduced?

What is the algebraic treatment of elementary functions that can be fed to a computer?

-
Regarding your third paragraph, consider this: "It doesn't seem possible to a finite set of bitstrings to represent what is meant by a number. For example, it should contain all numbers of the form $0, 1, 2, \ldots$. And there is no way you can just enumerate an infinite set within a computer." – Zhen Lin Apr 30 '12 at 19:50
@ZhenLin Enumerate in the sense it is not an enumerated type. If you add generators (constructors) for kernels virtually you will have function composition. – Yrogirg Apr 30 '12 at 20:08
Represent the infinite set using a finite grammar. Also, to know the best representation for your set on a computer, you have to know first what exactly you want to do with the set or elements of the set. For instance, if you wanted to store a collection of elements (say 32-bit integers), and that's all you wanted to do, then simply use an array (a very basic data structure used by computer programs). But if you want to search for an element in your collection, you should use a sorted array, or search tree, or hash table, and so on. The same will inevitably apply to representing your set. – Enjoys Math May 1 '12 at 22:37