MathWorld Headline News
Mathematica 5 Released
by Eric W. Weisstein
June 23, 2003--Today, Champaign Illinois-based Wolfram Research, Inc. announced the release of a major new version of its powerful mathematical computation system Mathematica. Mathematica 5 features many new mathematical and programming functions, as well as a complete overhaul of its numerics engine, producing impressive speed gains in arbitrary-precision arithmetic as well as lightning fast numeric linear algebra. While sporting impressive speed and functional enhancements, Mathematica 5 builds on the solid technology of previous versions that has been used by millions of people worldwide over the last 15 years.
June 23 is an especially appropriate release date for such a major new release since it also marks the 15th year anniversary of the founding of Wolfram Research. As indicated in the time line of the company's history, Mathematica 5 has been four years in the making, with the previous point oh release occurring in March of 1999.
Readers of MathWorld will benefit greatly from the new and enhanced capabilities of Mathematica 5, which has been used extensively in the computations and derivations appearing on the site and in the downloadable Mathematica notebooks provided for more than 1000 individual entries. The following examples only scratch the surface of the new functionality available in Mathematica 5. A more detailed enumeration can be found on Wolfram Research's "What's New in Version 5" page.
Built-In Statistical Functions
In version 5, common statistical functions such as Mean, Variance, and Median are now built in to the kernel and no longer require loading via packages. In addition, the convenient new function Total can now be used to efficiently add lists of numbers.
SeedRandom[1234]; data = Table[Random[Integer, {1, 10}], {10}] {1, 4, 5, 5, 1, 9, 8, 4, 5, 9} Total[data] 51 Median[data] 5 Mean[data] 51/10 Variance[data] 749/90
Built-In Vector and Matrix Norms
In Mathematica 5, vector and matrix norms are now built in. The new function Norm therefore provides a convenient way to compute a variety of mathematical norms. The same command also can be used to compute complex norms.
Norm[Range[4], #]& /@ {1, 2, Infinity} {10, Sqrt[30], 4} Norm[Partition[Range[9], 3], #]& /@ {1, 2, Frobenius, Infinity} {18, Sqrt[(3*(95 + Sqrt[8881]))/2], Sqrt[285], 24} Norm[1 + 2I] Sqrt[5]
Enhanced Integration Capabilities
Mathematica's Integrate capabilities have been streamlined, improved, and systematically extended in version 5. In particular, condition-generation has been dramatically improved for parameters with arbitrary complex values in definite integration. When combined with Mathematica 5's enhanced Assumptions and new Assuming technologies, this provides a solid framework for computing difficult integrals, even those with complicated parameters, with unprecedented accuracy and rigor.
Integrate[D[x Sqrt[Sin[x]], x], x] x*Sqrt[Sin[x]] Integrate[Sqrt[(x - y)^2], {x, 0, 1}, {y, 0, 1}] 1/3 Integrate[Abs[x - y], {x, 0, 1}, {y, 0, 1}] 1/3 Integrate[Sqrt[(x1 - x2)^2 + (y1 - y2)^2], {x1, 0, 1}, {x2, 0, 1}, {y1, 0, 1}, {y2, 0, 1}] (2 + Sqrt[2] + 5*ArcSinh[1])/15 Integrate[Log[x], {x, a, b}, Assumptions -> 0< a <b] a - b - a*Log[a] + b*Log[b] << Statistics`MultinormalDistribution`; p = PDF[MultinormalDistribution[{0, 0}, {{1, rho}, {rho, 1}}], {x1, x2}]; Integrate[p, {x1, -Infinity, 0}, {x2, -Infinity, 0}, Assumptions -> 0 < rho < 1] (Pi + 2*ArcSin[rho])/(4*Pi)
Revamped Recurrence Equation Solver
The command RSolve has been completely rewritten for Mathematica 5 and promoted to a kernel function. It contains a state-of-the art solver and can solve large classes of common recurrence equations. For example, RSolve can now find solutions to the three exactly solvable cases of the logistic equation
x_{n+1} = x_{n}(1-x_{n}). | (1) |
RSolve[{x[n+1] == # x[n](1-x[n]), x[0] == x0}, x[n], n]& /@ {-2, 2, 4} {{{x[n] -> (1 + 2*Cos[2^n*ArcCos[(-1 + 2*x0)/2]])/2}}, {{x[n] -> (1 - (1 - 2*x0)^2^n)/2}}, {{x[n] -> (1 - Cos[2^n*ArcCos[1 - 2*x0]])/2}}}
Solving the Pell Equation with Reduce
The Pell equation is a simple example of a quadratic Diophantine equation. The Pell equation is
x^{2} - d y^{2} = 1, | (2) |
As a result of Mathematica 5's powerful new Reduce syntax, the general solution to this equation over the integers can be easily found using the following command.
Reduce[x^2 - 61y^2 == 1, {x, y}, Integers] C[1] \[Element] Integers && C[1] >= 0 && x == (-(1766319049 - 226153980*Sqrt[61])^C[1] - (1766319049 + 226153980*Sqrt[61])^C[1])/2 && y == -((1766319049 - 226153980*Sqrt[61])^C[1] - (1766319049 + 226153980*Sqrt[61])^C[1])/(2*Sqrt[61]) || C[1] \[Element] Integers && C[1] >= 0 && x == (-(1766319049 - 226153980*Sqrt[61])^C[1] - (1766319049 + 226153980*Sqrt[61])^C[1])/2 && y == ((1766319049 - 226153980*Sqrt[61])^C[1] - (1766319049 + 226153980*Sqrt[61])^C[1])/(2*Sqrt[61]) || C[1] \[Element] Integers && C[1] >= 0 && x == ((1766319049 - 226153980*Sqrt[61])^C[1] + (1766319049 + 226153980*Sqrt[61])^C[1])/2 && y == -((1766319049 - 226153980*Sqrt[61])^C[1] - (1766319049 + 226153980*Sqrt[61])^C[1])/(2*Sqrt[61]) || C[1] \[Element] Integers && C[1] >= 0 && x == ((1766319049 - 226153980*Sqrt[61])^C[1] + (1766319049 + 226153980*Sqrt[61])^C[1])/2 && y == ((1766319049 - 226153980*Sqrt[61])^C[1] - (1766319049 + 226153980*Sqrt[61])^C[1])/(2*Sqrt[61])
This is the generic solution, giving a complete parametrization of all possible solutions to this equation over the specified domain (the integers). To get only solutions up to some limit, you can use the following syntax.
Reduce[x^2 - 61y^2 == 1 && x > 0 && 0 < y < 10^9, {x, y}, Integers] x == 1766319049 && y == 226153980
Geometric Proofs with Resolve
Mathematica 5 can now rigorously proove many geometric identities and inequalities using quantifier elimination. For example, a beautiful identity from triangle geometry states that the inradius r and circumradius R of a triangle with side lengths a, b, and c with corresponding angles A, B, and C are related by
1 + r/R = cos A + cos B + cos C. | (3) |
Demonstrating this by hand is a good exercise for a student of geometry, but not something that a computer is well suited for. However, the identity can be rigorously shown to hold by formulating the problem as a logical expression "For all a, b, and c that correspond to sides of a triangle, the identity (3) holds," and then evaluating to see if the result is True (the proposition is correct) or False (the proposition is incorrect). Noting that the condition for three numbers to be side lengths of a triangle is given by
a, b, c > 0, a + b > c, b + c > a, a + c > b. | (4) |
This can then be written up in Mathematica as follows.
Resolve[ForAll[{a, b, c}, a > 0 && b > 0 && c > 0 && a + b > c && b + c > a && a + c > b, Cos[A] + Cos[B] + Cos[C] == r/R + 1 /.{ r -> Sqrt[(b + c - a)(c + a - b)(a + b - c)/(a + b + c)]/2, R -> a b c/Sqrt[(a + b + c)(b + c - a)(c + a - b)(a + b - c)], Sequence @@ Thread[{A, B, C} -> (ArcCos[(-#1^2 + #2^2 + #3^2)/(2#2#3)]&@@@NestList[RotateLeft, {a, b, c}, 2])] }]]True
Since the result is True, the proposition has been proved.
ReferencesWolfram Research, Inc. "Mathematica 5." http://www.wolfram.com/mathematica/
Wolfram Research, Inc. "What's New in Version 5." http://www.wolfram.com/mathematica/newin5/