MathSource Reviews

Mathematica-Driven Interactive World Wide Web Sites

Edited by Matthew M. Thomas

In this MathSource Review, we again take our review fodder from that larger MathSource – the World Wide Web. We probe two web sites in which one submits inputs for Mathematica processing, and gets HTML-dressed Mathematica output for his or her efforts. Both sites adroitly show off the symbolic/numerical algebra/calculus capabilities of the motherware, but one does so to a much greater extent than its counterpart. Ironically, the handlers of said counterpart are by far in the best position to do the most exhibiting, as will become evident. 

This Review can be regarded as an adjunct to the "CyberSites" write-up in issue 5(3) of this journal. That write-up discussed the gaining of access to Mathematica through the Web, but the discussion was a general one. Specific examples of gaining such access were not offered. Such examples are offered here. The URLs for the web sites to be cited were operative as of mid-September 1997. Since web contents are more volatile than MathSourcecontents, the chance exists that these URLs may no longer be valid when your eyes alight upon these words. That such might happen is a fear, not a hope (especially among freshman calculus students.)

Site One: THE INTEGRATOR

Our first entry hails from Wolfram Research Inc., which gave us Mathematica a decade ago, but had to wait until the World Wide Web got around to being "created" before it could make Mathematica operations available through that medium. In the interim, WRI created and enhanced MathLink – a prescient move, in retrospect, given the concurrent Internet advances. Today, WRI offers THE INTEGRATOR, its Mathematica-powered web site whose URL has been www.integrals.com. The Summer 1997 issue of WRI's MathUser (on p. 5) introduced THE INTEGRATOR to the Mathematica customer base, noting that Artificial Intelligence pioneers considered successful chess-playing and symbolic integration as pointers to the nebulous "computer intelligence" concept. Today, IBM's Deep Blue plays chess well enough to defeat reigning chess champion Garry Kasparov, while WRI's Mathematica and other packages achieve symbolic integration. The MathUser item notes that, while few will ever play Deep Blue in chess, many more will do symbolic integration using Mathematica via THE INTEGRATOR. It remains to be seen whether IBM will take MathUser's implicit hint, by making chess games vs. Deep Blue available through the web. 

With its name proclaimed in brazen, italicized capital letters, THE INTEGRATOR has the subtitle "The Power To Do Integrals As The World Has Never Seen Before." We shall grant the WRI web content developers their moment of exuberance. Four links from the home page lead to pages on 1) the uses of integration, 2) the entry of an integral, 3) the history of integration, and 4) the internal workings of THE INTEGRATOR. Cited integration uses are area/length/volume/mass computation, launching spacecraft, and population growth; prose more inclusive would be in order. The page on the entry of an integral is vital for newcomers to Mathematica: This page offers links to pages on basic arithmetic, mathematical constants, trigonometric/exponential functions, and higher mathematical functions. By the time the newcomer works through these last four pages, he or she will have been exposed to the very broad range of mathematical operations and functions in the Mathematica vernacular. The page on higher mathematical functions alone covers functions from combinatorial and orthogonal polynomials through hypergeometric functions to Mathieu and related functions. Lured initially by integration, the newcomer now sees all that Mathematica can do irrespective of integration, and he or she is likely to be impressed. 

Another link from the home pages involves the history of integration. The history of integration page is a listing of condensed biographies from Archimedes, through Leibniz and Newton, to R. H. Risch. Pictures of the integrators line the left margin of the page; the biographies are to the right. Each biography comprises but a few sentences, so as to fit the whole of said history into one view from your Netscape Navigator or Microsoft Internet Explorer browser. The last biography on this page is that of Mathematica (1987- ); one can already hear the plaintive wails arising from those for whom marketeer and historian should not be one and the same. But be that as it may, this integration history page would make an excellent poster, and the student assigned a paper on integration could do worse than to start with the august names cited on this page. 

The final topical link from the home page leads to a discussion of THE INTEGRATOR's internal workings. To wit: THE INTEGRATOR offers a web interface to Mathematica version 3.0, which runs on a Dual Pentium Pro 2000 server under the Linux operating system. The Mathematica "SymbolicHTML" package is what swaddles the integrated function in Hyper-Text Markup Language tags, therein creating the output web page. The Integrate function performs the actual integration, and this last page devotes a paragraph each to the Integrate function, Mathematica typesetting, and the workings of MathLink.

Running THE INTEGRATOR

The "Enter Any Integral" invitation from the home page allows you to choose a randomly selected function for integration, or to enter your own function for integration. A related "button" is labeled "How to type in your own integral;" clicking it gives you the same "entry of an integral" tutorial page cited above. The "Here's Your Answer" section of the home page returns the integrated function upon its calculation. The "Change Your Output" section lets you view that integrated function in text, ASCII, standard form, or traditional form format, using a small, medium, or large font. Of the four formats, text format is the most primitive, using Mathematica notation such as Sqrt[ ] to represent a function, and fitting the entire function (numerator, denominator, exponents, etc.) within a single line. The ASCII format retains the Mathematica notation, but puts the numerator clearly above the denominator, and places the exponents in superscript position. Standard and traditional form formats are very similar to each other; they are the formats commonly seen in standard mathematics-oriented texts. 

Evaluating the performance of THE INTEGRATOR is akin to evaluating the performance of Mathematica 3.0's Integrate function. Assuming that this function works properly, we find upon submitting a series of simple arguments to THE INTEGRATOR that, yes, THE INTEGRATOR does indeed return the expected integrated arguments. Complex arguments might not have closed-form integrals, and THE INTEGRATOR offers users the opportunity to send email to its webmaster should they disagree with INTEGRATOR output. Any procedure that suffices for assessing Integrate performance should also suffice for assessing THE INTEGRATOR evaluation performance. 

But there is at least one other aspect to INTEGRATOR performance, in addition to evaluation. This aspect is not unique to Wolfram Research's site; rather, it characterizes any web site using Mathematica to evaluate user-supplied input. This aspect involves the speed with which the page form conveys input to and output from Mathematica. THE INTEGRATOR uses the POST (not the GET) method to relay form data; the POST method allows for unlimited query length without fear of client or server query truncation. Use of the POST method does not adversely affect THE INTEGRATORs speed: The site returned integrated functions relatively rapidly, even through a corporate firewall in lunch-hour web traffic that brings stock price and sports score retrieval pages to a midday halt.

Unsanctioned Uses

THE INTEGRATOR does indeed show a World Wide Web audience that Mathematica can perform symbolic evaluation of integrals, thus addressing one of the two aforementioned points from the Artificial Intelligence pioneers. But to limit THE INTEGRATOR to symbolic indefinite integration seems a bit ... stingy. If THE INTEGRATOR is to be limited to integration, might it at least do more than indefinite integration? Can the user trick THE INTEGRATOR into going beyond its charter? 

The answers again depend upon what one can do with the Integrate function. Fortunately, this function is malleable. With just a bit of cleverness, one can trick THE INTEGRATOR into performing differentiation, definite integration, and higher function evaluation. For differentiation, the user need only recognize that the first derivative of a function is but the indefinite integral of the second derivative of said function. Accordingly, if foo is a function of x, then submitting D[foo, {x, 2}] toTHE INTEGRATOR will produce the first derivative of foo with respect to x. Related chicanery will produce the second, third, … , nth derivatives of foo. 

As for definite integration, let foo be a fraction of x, b be an upper limit of integration, a be a lower limit of integration, and ind be the indefinite integral of foo with respect to x. Submitting Integrate[foo, {x, a, b}] to THE INTEGRATOR produces x(i  n  d (b) - i  n  d (a)). Drop the x, and you have the evaluated definite integral i  n  d (b) - i  n  d (a). Similarly, one can trick THE INTEGRATOR into performing higher function evaluation. For example: Mathematica, given LegendreP[2, 2], will return 11/2. Submitting LegendreP[2, 2] to THE INTEGRATOR produces x(11/2); drop the x, and you have the numerical value you requested. Such impishness does extend the usefulness of THE INTEGRATOR, but it would be nice were such impishness unnecessary. It is unnecessary when working with the following site.

Site Two: The MathServ Calculus Toolkit

We go now from WRI in Champaign, IL, to Vanderbilt University in Nashville, TN. The Vanderbilt Department of Mathematics [Philip S. Crooke, Steven Tschantz] and Owen Graduate School of Management [Luke M. Froeb] have collaborated to create the MathServ Calculus Toolkit, as part of a wider-ranging MathServ Project. The URL for the Toolkit has been math.vanderbilt.edu/pscrooke/toolkit.shtml; given the transient nature of tilde-laced URLs, one hopes that this URL is still valid upon your reading these words. What THE INTEGRATOR does for indefinite integration, the Toolkit does for algebra and calculus. 
In a short introduction to the Toolkit, the user is informed that a knowledge of Mathematica is helpful but not required for Toolkit use. A Mathematica-savvy user, for example, would know to enter If[x>0, 1, 0] to represent the Heaviside unit step function in features to be described. Conversely, the Toolkit has mercy on the Mathematica neophyte, allowing expressions such as exp(x), e^x, and E^x as acceptable surrogates for the standard Exp[x] as Toolkit input arguments. 

The Toolkit home page comprises two parts: a 5×3 grid of Mathematica-driven operations, and a set of subsequent links to other operations. The Toolkit mimics THE INTEGRATOR in using the POST method to relay user input to a remote Mathematica kernel. Toolkit operations echo user input on the kernel-generated output page. The echoed input is thus of value to the user, who need then not stare at the output with a Did-I-enter-the-input-correctly? expression. Unlike THE INTEGRATOR, the Toolkit does not offer detailed information on the server, operating system, and version of Mathematica at work behind the web site. The Toolkit introductory page does, however, note that a Vanderbilt Department of Mathematics server drives the Toolkit operation. And unlike THE INTEGRATOR, the Toolkit also does more than intentional indefinite integration and unintentional definite integration, differentiation, and higher fraction evaluation.

The "5"×"3" Toolkit Grid

The grid on the Toolkit home page offers five rows by three columns of Mathematica operations. The user clicks on one of the fifteen yellow rectangles in the red-bordered grid; the Toolkit conjures the appropriate input page through the Map tags of the home page HTML. Perhaps the best way to describe the grid operations is to outline each, with comments where appropriate. The web page files for each of these operations have been in the math.vanderbilt.edu/pscrooke/MSS directory; all have "html" subscripts. 

FACTORING POLYNOMIALS (factorpoly.html)—Factors polynomials in the user's choice of real or Gaussian integers. 

PARTIAL FRACTIONS (partialfract.html)—Accepts numerator and denominator polynomials as inputs; supplies the rational function and the partial fraction expansion as the output. 

POLYNOMIAL EQUATIONS (solvepoly.html)—Provides solutions to p(x) = q(x), where p(x) and q(x) are polynomials. The user is given the option of receiving output as symbolic and numerical solutions, or as numerical solutions only. A useful graph of p(x) - q(x) vs. x accompanies the solutions. 

GRAPHS OF FUNCTIONS (plotseveral.html)—Accepts up to five functions of x, as well as upper and lower limits of independent variable x for each function. The resulting plot uses a different color of a solid line for each function; the lines are then virtually indistinguishable once printed in black-and-white. A "line-style" or "line-type" option would have been of use. 

GRAPHS OF EQUATIONS (equationplot.html)—The first line of the input page proclaims "Plotting an equation: G(x, y) = 0," but input equations must be written in f(x, y) = g(x, y) form, rather than in the implied G(x, y) = 0 form. The user also enters minimum and maximum values for x and y; the resulting plot of G(x, y) = 0 is in the x  y-plane. 
LIMITS (limit.html)—Inputs are function f(x) and limit point x = a. The user may specify a two-sided, left-sided, or right-sided limit. The user may also request a plot of f(x) vs. x about point x = a. 

DERIVATIVES (derivative.html)—Accepts function f(x) for differentiation, as well as the orders of symbolic differentiation to be computed. Outputs are the first, second, ..., nth order derivatives of f(x) with respect to x. 

ANTIDERIVATIVES (antiderivative.html)—Specify the function and the variable [f(x) for x; f(y) for y; etc.]; get the antiderivative of the function. In terms of computation, the entirety of what THE INTEGRATOR offers fits completely within this single Toolkit operation. 

DEFINITE INTEGRALS (definiteintegral.html)—Accepts a function, a variable of integration, and integration limits as inputs; provides the corresponding numerical value from definite integration as the output. One wonders if this operation might be bug-ridden: A straightforward fourth-order polynomial as input caused a "There was an unexpect [sic] results [sic] in this calculation" message, as well as other Mathematica-generated messages. Tread with care, here. 

INVERSE FUNCTIONS (inversefunction.html) — Provides the inverse of a function (eg., x = 1/ y for y = 1/ x). Also provides the prerequisite warnings about function inverses. 
NEWTONS METHOD (newtonnum.html)—Given a function f(x) and a starting point (Subscript[x, 0]) for Newton's method, this operation returns the specified starting point (Subscript[x, 0]), the incremental intermediate results (Subscript[x, 1]) through (Subscript[x, n]), and the final numerical root. The resulting output page also has offered a link to a short essay on Newton's method, scribed in October 1996 by Vanderbilt's Tschantz. Similar links to similar essays from all the Toolkit operations would be of significant benefit to the student. 

POLYNOMIAL INTERPOLATION (fitpoly.html) — Inputs are a vector of data points \(TraditionalForm
      \`{\((x\_1, y\_1)\), …, \((x\_n, y\_n)\)}\), and an order of fit (an integer value). Outputs are a least-squares generated polynomial of the specified order, and a plot of both the fitted polynomial and the input data points. Again, the error messages that colored the DEFINITE INTEGRALS output also plagued the output from this operation. A correlation coefficient for the fitted polynomial would have complemented the plot. 

GRAPH OF F(x, y) = 0 (equationplot.html)—Same as the GRAPHS OF EQUATIONS operation, as can be seen from the HTML file names for both operations (they are identical). 

PARAMETRIC EQUATIONS (plotparametric2D.html)— Generates a parametric plot from user-supplied parametric equations and upper/lower limits on the pertinent parameter. Useful for students of introductory calculus, who inevitably must conquer parametric equations before they may tackle limits, differentiation, and the rest of it. 

POLAR FUNCTIONS (plotpolar.html)—The user provides function r = f(t), where t is the polar angle, and the upper/lower limits on t; the user gets the corresponding plot in polar coordinates.

Subsequent Toolkit Links

Beneath the 5×3 grid, the Toolkit home page features links labeled Algebra, Functions, Graphing, Limits & Derivatives, Applications of the Derivative, and Integrals. Each of these links leads to pages which in turn contain at least four links, and at most eleven links. A minority of the links are to the Mathematica operation pages already covered by the 5×3 grid; the majority of the links are to hitherto unseen operation pages. The format of these other pages is also uniform: The POST method is used to relay form data; user input is echoed on the output page. The other operation pages deal with concepts such as these: number sequences; symbolic summation; graphical function shifting/scaling; graphical function combinations [f (x) + g (x), for eg.]; plotting composite functions [f (g (x)); g (f (x))]; combining plots of functions with plots of their derivatives; plotting piecewise functions; implicit differentiation; tutorials on limits, differentiation, and integration; tangent line plotting; power series computation; Riemann sum calculation; solids of revolution; midpoint/trapezoid/Simpsons rules; solving separable ordinary differential equations; curve arc length computation; computing the center of mass of a thin plate whose shape is the region enclosed by the graphs of two functions. 
Of these links, the "solids of revolution" operation is especially appealing: One submits functions f (x) and g (x), lines x = a and x = b, the number of angles and points to be used for sampling, and the axis about which to revolve the region bounded by f (x) and g (x) between lines x = a and x = b; after a few minutes, one gets a graph of the bounded region in the x  y-plane, a 3-D solid figure generated by revolving that region about the specified axis, and a cross-sectional view of the solid figure just generated ... all that is missing is the double integral arising from the bounded region in the x  y-plane. Add this missing item, and you have a godsend for the student grappling with shell/plate methods and double integrals.

Summary

Whereas THE INTEGRATOR proved accessible from behind a particular corporate firewall, the MathServ Calculus Toolkit never got past that firewall. The peripheral web pages for THE INTEGRATOR showed a more polished design than those of its Toolkit counterpart. The "how it works" documentation forTHE INTEGRATOR was far better than that for the Toolkit; all we really know about the Toolkit is that it is Mathematica-driven from a Vanderbilt Dept. of Mathematics server. In addition, the Toolkit seemed occasionally to generate warnings and error messages over user input too straightforward to warrant them. 

But for all of these pro-INTEGRATOR observations, all one can say in favor of the Toolkit is that it offers far, far more Mathematica capabilities than its WRI-based counterpart. THE INTEGRATOR intentionally offers only indefinite integration; the Toolkit offers so much more. Affiliations unknown, one could believe the Toolkit site to be the WRI-created site. Granted, WRI purposefully limited the scope of THE INTEGRATOR to integration, and is surely capable of creating a web site with the scope of the Toolkit. For now, however, a calculus student who first encounters the Toolkit has little motivation to seek THE INTEGRATOR. Credit and praise go to Vanderbilt's Crooke, Tschantz, and Froeb for an excellent job on the MathServ Calculus Toolkit. 

Were the Toolkit not Mathematica-driven but Maple- or MACSYMA-driven, WRI would have prime cause for worry. As it happens, however, WRI finds itself in a position similar to that of Swedish telecommunications giant L.M. Ericsson. Ericsson is the international digital cellular telephony market leader in Time Division Multiple Access (TDMA) service. A new but unproven technology – Code Division Multiple Access (CDMA) – may soon mature to the point of challenging TDMA for U.S. market share. Ericsson is undaunted: Secure in the success of its non-U.S. TDMA service, Ericsson is sticking with TDMA technology in the U.S. The rub is that Ericsson apparently also holds key patents in the upstart CDMA technology. So even if CDMA were to best TDMA in the battle for U.S. market share, Ericsson would lose TDMA service revenue but gain CDMA royalties revenue. WRI's Mathematica is tantamount to Ericsson's intellectual property: Even though the non-WRI Toolkit is far more expansive than the WRI INTEGRATOR, WRI benefits from the attention (and future business) brought to it by the Toolkit. 

As noted in last year's "CyberSites" MathSource Review, sites such as the MathServ Calculus Toolkit and THE INTEGRATOR are to Mathematica what MathReader once was: The newest and best way to demonstrate and market Mathematica. It is possible that some potential Mathematica buyers might rethink purchase upon encountering these sites, opting to restrict their Mathematica usage to the operations made available by the sites. It is more likely that Mathematica newcomers will want the power and convenience of their own copies of Mathematica, upon encountering the sites. When the "CyberSites" review appeared, nanodollar technology had yet to establish its niche, and that has not changed. Nonetheless, sites such as the Toolkit and THE INTEGRATOR remain prime candidates for both this technology and web advertising. In addition, the era of sports score and stock price retrieval (table look-up) as "cutting-edge" web technology is waning. Taking its place is an era of truly substantial remote-site computation; early leaders in this era are the Toolkit and THE INTEGRATOR.

About the Author

Matthew M. Thomas completed his doctorate in chemical engineering at Washington University in St. Louis, in December 1995. The composite materials aspects of that work are summarized in the June 1997 issue of Polymer Composites. 

thomas@wuche2.wustl.edu