The Mathematica Guidebooks

# Programming Volume

## CHAPTER 1 Introduction to Mathematica

### 1.1 Basics of Mathematica as a Programming Language

#### 1.1.1 General Background

• In and Out Numbering
• General Naming, Spelling, and Capitalization Conventions for Symbols
• Options and Option Settings
• Messages

#### 1.1.2 Elementary Syntax

• Common Shortcuts
• Parentheses, Braces, and Brackets
• Font Usage
• Referring to Outputs
• Functional Programming Style
• "Ideal" Formatting

### 1.2 Introductory Examples

#### 1.2.1 Numerical Computations

• Periodic Continued Fractions
• Pisot Numbers
• Fast Integer Arithmetic
• Digit Sums
• Numerical Integration
• Numerical ODE Solving
• Burridge-Knopoff Earthquake Model
• Trajectories in a Random Two-Dimensional Potential
• Numerical PDE Solving
• Benney PDE
• Sierpinski Triangle-Generating PDE
• Monitoring Numerical Algorithms
• Hilbert Matrices
• Distances between Matrix Eigenvalues
• Special Functions of Mathematical Physics
• Sums and Products
• Computing a High-Precision Value for Euler's Constant γ
• Numerical Root-Finding
• Roots of Polynomials
• Jensen Disks
• De Rham's Function
• Logistic Map
• Built-in Pseudo-Compiler
• Forest Fire Model
• Iterated Digit Sums
• Modeling a Sinai Billiard

#### 1.2.2 Graphics

• Gibbs Phenomena
• Fourier Series of Products of Discontinuous Functions
• Dirichlet Function
• Counting Digits
• Apollonius Circles
• Generalized Weierstrass Function
• 3D Plots
• Plotting Parametrized Surfaces
• Plotting Implicitly Defined Surfaces
• Graphics-Objects as Mathematica Expressions
• Kepler Tiling
• Fractal Post Sign
• Polyhedral Flowers
• Gauss Map Animation
• Random Polyehdra

#### 1.2.3 Symbolic Calculations

• Differentiation
• Integration
• Symbolic Solutions of ODEs
• Vandermonde Matrix
• LU Decomposition of a Vandermonde Matrix
• Redheffer Matrix
• Symbolic Representations of Polynomial Roots
• Solving Systems of Polynomials
• Eliminating Variables from Polynomial Systems
• Series Expansions
• L'Ho^spital's Rule
• Radical Expressions of Trigonometric Function Values
• Prime Factorizations
• Symbolic Summation
• Proving Legendre's Elliptic Integral Identity
• Geometric Theorem Proofs Using Gröbner Bases
• Medial Parallelograms
• Inequality Solving
• Symbolic Description of a Thickened Lissajous Curve
• Simplifications under Assumptions
• Numbers with Identical Digits in the Decimal and Continued Fraction Expansions
• Conformal Map of a Square to the Unit Disk
• Vortex Motion in a Rectangle
• Magnetic Field of a Magnet with Air Gap
• Localized Propagating Solution of the Maxwell Equation
• Customized Notations
• Schmidt Decomposition of a Two-Particle State

#### 1.2.4 Programming

• Large Calculations
• Partitioning Integers
• Binary Splitting-Based Fast Factorial
• Bolyai Expansion in Nested Radicals
• Defining Pfaffians
• Structure of Larger Programs
• Making Platonic Solids from Tori
• Equipotential Surfaces of a Charged Icosahedral Wireframe
• Tube along a 3D Hilbert Curve

### 1.3 What Computer Algebra and Mathematica 5.1 Can and Cannot Do

• What Mathematica Does Well
• What Mathematica Does Reasonably Well
• What Mathematica Cannot Do
• Package Proposals
• What Mathematica Is and What Mathematica Not Is
• Impacts of Computer Algebra
• Relevant Quotes
• Computer Algebra and Human Creativity
• New Opportunities Opened by Computer Algebra
• Computer Mathematics--The Joy Now and the Joy to Come

### Exercises

• Computing Wishes and Proposals
• Computer Algebra Systems

### Solutions

• 100 Proposals for Problems to Tackle
• Sources of Interesting and Challenging Problems
• ISSAC Challenge Problems
• 100\$-100-Digit Challenge

## CHAPTER 2 Structure of Mathematica Expressions

### 2.1 Expressions

• Everything Is an Expression
• Hierarchical Structure of Symbolic Expressions
• Formatting Possibilities
• Traditional Mathematics Notation versus Computer Mathematics Notation
• Typeset Forms
• Symbols
• Input Form and the Formatting of Programs

### 2.2 Simple Expressions

#### 2.2.1 Numbers and Strings

• Formatting Fractions
• Integers
• Autosimplifications
• Rational Numbers
• Approximate Numbers
• Real Numbers
• Complex Numbers
• Autonumericalization of Expressions
• Strings
• High-Precision Numbers
• Inputting Approximate Numbers
• Inputting High-Precision Numbers
• Approximate Zeros

#### 2.2.2 Simplest Arithmetic Expressions and Functions

• Basic Arithmetic Operations
• Reordering Summands and Factors
• Precedences of Simple Operators
• Algebraic Numbers
• Domains of Numeric Functions
• Autoevaluations of Sums, Differences, Products, Quotients, and Powers

#### 2.2.3 Elementary Transcendental Functions

• Exponential and Logarithmic Functions
• Trigonometric and Hyperbolic Functions
• Exponential Singularities
• Picard's Theorem
• Secants Iterations
• Exact and Approximate Arguments
• Postfix Notation
• Infix Notation

#### 2.2.4 Mathematical Constants

• Imaginary Unit
• pi
• Autoevaluations of Trigonometric Functions
• Base of the Natural Logarithm
• Golden Ratio
• Euler's Constant γ
• Directed and Undirected Infinities
• Indeterminate Expressions

#### 2.2.5 Inverse Trigonometric and Hyperbolic Functions

• Multivalued Functions
• Inverse Trigonometric Functions
• Inverse Hyperbolic Functions
• Complex Number Characteristics
• Real and Imaginary Parts of Symbolic Expressions
• Branch Points and Branch Cuts

#### 2.2.6 Do Not Be Disappointed

• Real versus Complex Arguments
• Seemingly Missing Simplifications
• Principal Sheets of Multivalued Functions

#### 2.2.7 Exact and Approximate Numbers

• Symbols and Constants
• Numericalization to Any Number of Digits
• Precision of Real Numbers
• Precision of Complex Numbers

### 2.3 Nested Expressions

#### 2.3.1 An Example

• Constructing Nested Expressions
• Canonical Order
• Displaying Outlines of Expressions
• Displaying Nested Expressions

#### 2.3.2 Analysis of a Nested Expression

• A Large Expression
• Parts of Expressions
• Recursive Part Extraction
• Depths of Expressions
• Extracting Multiple Parts
• Extracting Parts Hierarchically
• Locating Subexpressions in Expressions
• Level Specifications
• Length of Expressions
• Leaves of Expressions

### 2.4 Manipulating Numbers

#### 2.4.1 Parts of Fractions and Complex Numbers

• Rational Numbers as Raw Objects
• Numerators and Denominators
• Complex Numbers as Raw Objects
• Real and Imaginary Parts

#### 2.4.2 Digits of Numbers

• Digits of Integers
• Digits of Real Numbers
• Writing Numbers in Any Base
• Counting Digits of Numbers
• Fibonacci Chain Map Animation

### Exercises

• Analyzing the Levels of an Expression
• Branch Cuts of Nested Algebraic Functions
• Analyzing the Branch Cut Structure of Inverse Hyperbolic Functions
• "Strange" Analytic Functions

### Solutions

• Principal Roots
• Analyzing a Large Expression
• Levels Counted from Top and Bottom
• Branch Cuts of (z^4)^1/4
• Branch Cuts of sqrt(z+1/z)sqrt(z-1/z)
• Riemann Surface of arctan(tan(z/2)/2)
• Repeated Mappings of Singularities

## CHAPTER 3 Definitions and Properties of Functions

### 3.1 Defining and Clearing Simple Functions

#### 3.1.1 Defining Functions

• Immediate and Delayed Function Definitions
• Expansion and Factorization of Polynomials
• Expansion and Factorization of Trigonometric Expressions
• Patterns
• Nested Patterns
• Patterns in Function Definitions
• Recursive Definitions
• Indefinite Integration
• Matching Patterns
• Definitions for Special Values
• Functions with Several Arguments
• Ordering of Definitions

#### 3.1.2 Clearing Functions and Values

• Clearing Symbol Values
• Clearing Function Definitions
• Clearing Specific Definitions
• Removing Symbols
• Matching Names by Name Fragments
• Metacharacters in Strings

#### 3.1.3 Applying Functions

• Univariate and Multivariate Functions
• Prefix Notation
• Postfix Notation
• Infix Notation

### 3.2 Options and Defaults

• Meaning and Usage of Options
• Lists as Universal Containers
• Options of Functions
• Plotting Simple Functions
• Extracting Option Values
• Setting Option Values

### 3.3 Attributes of Functions

• Meaning and Usage of Attributes
• Assigning Attributes to Functions
• Commutative Functions
• Associative Functions
• Functions Operating Naturally on Lists
• Numerical Functions
• Differentiation of Functions
• Protected Functions
• Preventing the Evaluation of Expressions
• Forcing the Evaluation of Expressions

### 3.4 Downvalues and Upvalues

• Function Definitions Associated with Heads
• Function Definitions Associated with Specific Arguments
• Downvalues and Upvalues
• Timing for Adding and Removing Definitions
• Caching
• Values of Symbols
• Numerical Values of Symbols

### 3.5 Functions that Remember Their Values

• Caching Function Values
• Multiple Assignments
• Simplification of Expressions
• Timings of Computations
• Takeuchi Function

### 3.6 Functions in the λ-Calculus

• λ-Calculus
• Functions as Mappings
• Functions without Named Arguments
• Self-Reproducing Functions
• Splicing of Arguments
• Sequences of Arguments
• Pure Functions with Attributes
• Nested Pure Functions

### 3.7 Repeated Application of Functions

• Applying Functions Repeatedly
• Iterative Maps
• Solving an ODE by Iterated Integration
• Iterated Logarithm in the Complex Plane
• Fixed Points of Maps
• Fixed Point Iterations
• Newton's Method for Square Root Extraction
• Basins of Attractions
• Cantor Series

### 3.8 Functions of Functions

• Compositions of Functions
• Inverse Functions
• Differentiation of Inverse Functions

### Exercises

• Predicting Results of Inputs
• Nice Polynomial Expansions
• Laguerre Polynomials
• Puzzles
• Unexpected Outputs
• Power Tower
• Cayley Multiplication

### Solutions

• Matching Unevaluated Arguments
• Equality of Pure Functions
• Invalid Patterns
• Counting Function Applications

## CHAPTER 4 Meta-Mathematica

### 4.1 Information on Commands

#### 4.1.1 Information on a Single Command

• Built-in Function Definitions as Outputs
• Listing of All Built-in Commands
• Messages
• Printing Text and Cells
• Warnings and Error Messages
• Wrong and "Unexpected" Inputs
• Suppressing Messages
• Carrying out Multiple Calculations in One Input

#### 4.1.2 A Program that Reports on Functions

• Converting Strings to Expressions
• Converting Expressions to Strings
• String Form of Typeset Expressions

### 4.2 Control over Running Calculations and Resources

#### 4.2.1 Intermezzo on Iterators

• Do Loops
• Multiple Iterators
• Possible Iterator Constructions
• Iterator Step Sizes

#### 4.2.2 Control over Running Calculations and Resources

• Aborting Calculations
• Protecting Calculations from Aborts
• Interrupting and Continuing Calculations
• Collecting Data on the Fly
• Time-Constrained Calculations
• Memory-Constrained Calculations
• Time and Memory Usage in a Session
• Expressions Sharing Memory
• Memory Usage of Expressions

### 4.3 The \$-Commands

#### 4.3.1 System-Related Commands

• Mathematica Versions
• The Date Function
• Smallest and Largest Machine Real Numbers

#### 4.3.2 Session-Related Commands

• In and Out Numbering
• Input History
• Collecting Messages
• Display of Graphics
• Controlling Recursions and Iterations
• Deep Recursions
• Ackermann Function

### 4.4 Communication and Interaction with the Outside

#### 4.4.1 Writing to Files

• Extracting Function Definitions
• Writing Data and Definitions to Files
• Reading Data and Definitions from Files
• File Manipulations

#### 4.4.2 Simple String Manipulations

• Concatenating Strings
• Replacing Substrings
• General String Manipulations
• Case Sensitivity and Metacharacters
• A Program that Prints Itself

#### 4.4.3 Importing and Exporting Data and Graphics

• Importing and Exporting Files
• Importing Web Pages
• Importing From and To Strings
• Making Low-Resolution JPEGs

### 4.5 Debugging

• Displaying Steps of Calculations
• Evaluation Histories as Expressions
• Recursion versus Iteration
• Interactive Inputs

### 4.6 Localization of Variable Names

#### 4.6.1 Localization of Variables in Iterator Constructions

• Sums and Products
• Scoping of Iterator Variables

#### 4.6.2 Localization of Variables in Subprograms

• Scoping Constructs
• Lexical Scoping
• Dynamic Scoping
• Local Constants
• Temporary Variables
• Variable Scoping in Pure Functions
• Creating Unique Variables
• Nonlocal Program Flow

#### 4.6.3 Comparison of Scoping Constructs

• Delayed Assignments in Scoping Constructs
• Temporarily Changing Built-in Functions
• Variable Localization in Iterators
• Scoping in Nested Pure Functions
• Nesting Various Scoping Constructs
• Timing Comparisons of Scoping Constructs

#### 4.6.4 Localization of Variables in Contexts

• Contexts
• Variables in Contexts
• Searching through Contexts
• Manipulating Contexts
• Beginning and Ending Contexts

#### 4.6.5 Contexts and Packages

• General Structure of Packages
• Private Contexts
• Analyzing Context Changes

#### 4.6.6 Special Contexts and Packages

• Developer Functions
• Special Simplifiers
• Bit Operations
• Experimental Functions
• Standard Packages

### 4.7 The Process of Evaluation

• Details of Evaluating an Expression
• Analyzing Evaluation Examples
• Standard Evaluation Order
• Nonstandard Evaluations
• Held Arguments

### Exercises

• Frequently Seen Messages
• Unevaluated Arguments
• Predicting Results of Inputs
• Analyzing Context Changes
• Evaluated versus Unevaluated Expressions

### Solutions

• Shortcuts for Functions
• Functions with Zero Arguments
• Small Expressions that Are Large
• Localization of Iterator Variables
• Dynamical Context Changes
• Local Values

## CHAPTER 5 Restricted Patterns and Replacement Rules

### 5.1 Boolean and Related Functions

#### 5.1.1 Boolean Functions for Numbers

• Truth Values
• Predicates
• Functions Ending with Q
• Numbers and Numeric Quantities
• Integer and Real Numbers
• Compound Numeric Quantities
• Exact and Inexact Numbers
• Primality
• Gaussian Primes
• Stating Symbolic and Verifying Numeric Inequalities
• Comparisons of Numbers
• Ordering Relations
• Positivity

#### 5.1.2 Boolean Functions for General Expressions

• Testing Expressions for Being a Polynomial
• Vectors and Matrices
• Mathematical Equality
• Equality and Equations
• Structural Equality
• Identity of Expressions
• Equality versus Identity
• Canonical Order
• Membership Tests

#### 5.1.3 Logical Operations

• Boolean Operations
• And, Or, Not, and Xor
• Rewriting Logical Expressions
• Precedences of Logical Operators

#### 5.1.4 Control Structures

• Branching Constructs
• The If Statement
• Undecidable Conditions
• While and For Loops
• Prime Numbers in Arithmetic Progression

#### 5.1.5 Piecewise Functions

• Piecewise Defined Functions
• Canonicalization of Piecewise Functions
• Composition of Piecewise Functions
• Interpreting Functions as Piecewise Functions
• Specifying Geometric Regions
• Endpoint Distance Distribution of Random Flights

### 5.2 Patterns

#### 5.2.1 Patterns for Arbitrary Variable Sequences

• Simple Patterns
• Patterns for Multiple Arguments
• Testing Patterns
• Named Patterns
• Trace of Products of Gamma Matrices
• Shortcuts for Patterns
• Avoiding Evaluation in Patterns
• Literal Patterns

#### 5.2.2 Patterns with Special Properties

• Optional Arguments
• Default Values for Optional Arguments
• Repeated Arguments
• Excluding Certain Patterns
• Alternative Arguments
• Restricted Patterns
• Pattern Tests
• Conditional Patterns
• Recursive Definitions
• Pattern-Based Evaluation of Elliptic Integrals
• Generating Tables
• Selecting Elements from Lists
• All Syntactically Correct Shortcuts

#### 5.2.3 Attributes of Functions and Pattern Matching

• Pattern Matching in Commutative and Associative Functions
• Arguments in Any Order
• Nested Functions
• Automatic Use of Defaults
• Analyzing Matchings and Recursions in Pattern and Attribute Combinations

### 5.3 Replacement Rules

#### 5.3.1 Replacement Rules for Patterns

• Immediate and Delayed Rules
• One-Time and Repeated Replacements
• Unevaluated Replacements
• Common Pattern Matching Pitfalls
• Finding All Possible Replacements
• Scoping in Rules
• Replacements and Attributes
• Modeling Function Definitions
• Options and Rules
• Replacing Position-Specified Parts of Expressions

#### 5.3.2 Large Numbers of Replacement Rules

• Optimized Rule Application
• Complexity of Optimized Rule Application

#### 5.3.3 Programming with Rules

• Examples of Rule-Based Programs
• Splitting Lists
• Cycles of Permutations
• Sorting of Complex Numbers
• Cumulative Maxima
• Dividing Lists
• House of the Nikolaus
• Polypaths
• Rule-Based versus Other Programming Styles

### 5.4 String Patterns

• Strings with Pattern Elements
• Patterns for Character Sequences
• String-Membership Tests
• Shortest and Longest Possible Matches
• Overlapping Matches
• Counting Characters
• Replacing Characters
• All Possible Replacements
• Analyzing the Online Documentation
• Cumulative Letter Frequencies

### Exercises

• Rule-Based Expansion of Polynomials
• All Possible Patterns from a Given Set of Shortcuts
• Extending Built-in Functions
• General Finite Difference Weights
• Zeta Function Derivatives
• Operator Products
• q-Binomial Theorem
• q-Derivative
• Ordered Derivatives
• Differentiating Parametrized Matrices
• Ferrer Conjugates
• Hermite Polynomial Recursions
• Peakons
• Puzzles
• Catching Arguments and Their Head in Calculations
• Nested Scoping

### Solutions

• Modeling Noncommutative Operations
• Campbell-Baker-Hausdorff Formula
• Counting Function Calls Using Side Effects
• q-Deformed Pascal Triangle
• Ordered Derivative
• Avoiding Infinite Recursions in Pattern Matchings
• Dynamically Generated Definitions

## CHAPTER 6 Operations on Lists, and Linear Algebra

### 6.0 Remarks

• Prevalence of List Manipulations
• Building Polyhedra by Reflecting Polygons Iteratively
• Animating the Folding Process Based on Iterated Reflections

### 6.1 Creating Lists

#### 6.1.1 Creating General Lists

• Lists and Nested Lists as Arrays, Tables, Vectors, and Matrices
• Timings of Creating Nested Lists
• Summing Elements of Lists

#### 6.1.2 Creating Special Lists

• Kronecker Symbol and Identity Matrix
• Levi-Civita Symbol and Antisymmetric Tensors
• Creating Multiple Iterators
• Stirling Numbers
• Subsets and Tuples

### 6.2 Representation of Lists

• 2D Formatting of Tables and Matrices
• Aligning Rows and Columns
• Formatting Higher-Dimensional Tensors
• Tensors and Arrays

### 6.3 Manipulations on Single Lists

#### 6.3.1 Shortening Lists

• Extracting Elements from Lists
• Deleting Elements by Specifying Position, Pattern, or Property
• Prime Sieving

#### 6.3.2 Extending Lists

• Prepending, Appending, and Inserting List Elements
• Working with Named Lists

#### 6.3.3 Sorting and Manipulating Elements

• Rotating Lists Cyclically
• Sorting Lists
• Sorting Criteria
• Analyzing the Built-in Sorting Algorithm
• Splitting Lists
• Mapping Functions over Lists
• Listable Functions
• Mapping Functions to Expressions and Parts of Expressions
• Extracting Common Subexpressions
• Optimized Expressions

#### 6.3.4 Arithmetical Properties of Lists

• Average Value of a List
• Sum of a List
• Variance of a List
• Quantiles of a List

### 6.4 Operations with Several Lists or with Nested Lists

#### 6.4.1 Simple Operations

• Transposing Tensors
• Permutations
• Using Side Effects for Monitoring List Algorithms
• Joining Lists
• Intersections and Complements of Lists
• Finding Approximately Identical Elements

#### 6.4.2 List of All System Commands

• Working with Unevaluated Expressions
• Options and Attributes of All Built-in Functions
• Analyzing All Built-in Function Names
• Dependencies of Definitions

#### 6.4.3 More General Operations

• Contractions and Kronecker Products--Inner and Outer Products
• Rotations in 3D
• Cross Products

#### 6.4.4 Constructing a Crossword Puzzle

• A Large, List-Based Calculation
• Example Construction
• Manipulating Function Definitions through Downvalues
• Crossword Array of All Built-in Functions
• Crossword Array of All Package Functions
• Crossword Array of All Named Characters

### 6.5 Mathematical Operations with Matrices

#### 6.5.1 Linear Algebra

• Inverse Matrices
• Determinants
• Timing Comparisons for Various Element Types
• Traces of Matrices
• Modeling Trace Calculations
• Eigenvalues and Eigenvectors
• Pauli Matrices
• Properties of Eigenprojectors
• Power Method for Finding the Largest Eigenvalue
• Generalized Eigenvalue Problem
• Solving Systems of Linear Equations
• Siamese Sisters
• Lorentz Transformations in Matrix Form
• Moore-Penrose Inverse
• Best Solutions to Overdetermined Linear Systems
• Algorithms of Linear Algebra
• Quantum Cellular Automata
• Extending Linear Algebra Functions

#### 6.5.2 Constructing and Solving Magic Squares

• Underdetermined Linear Systems
• Integer Solutions of Linear Systems
• Decoding and Encoding Magic Squares
• Finding All Solutions of a Magic Square

#### 6.5.3 Powers and Exponents of Matrices

• Integer and Fractional Powers of Matrices
• Exponential Function of a Matrix
• Trigonometric Functions of Matrices
• Fractional Powers and Matrix Spectral Decompositions
• Matrix Evolution Equations
• Time-Development of a Linear Chain
• Cayley-Hamilton Theorem
• Characteristic Polynomials

### 6.6 The Top Ten Built-in Commands

• Finding Filenames
• Working with Unevaluated Expressions
• Counting Function Uses
• Zipf's Law
• Analyzing Notebooks, Cell Types, References, Typeset Structures, and Text

### Exercises

• Benford's Rule
• Timing Comparisons for List Operations
• Sum-Free Sets
• Generating an Index for This Book
• Consistency of References
• Line Length Distribution
• Spacing Check
• Moessner's Process
• Ducci's Iterations
• Stieltjes Iterations
• Pseudorandom trees
• Levi-Civita Tensor Contractions
• Dirac Matrices Products
• Determinants of Multidimensional Arrays
• Mediants
• d'Hondt Voting
• Identifying Approximate Vectors Efficiently
• Unsorted Complements
• All Arithmetic Expressions
• Ideal Formatting
• Functions with Method Options
• Functions with Level Specifications
• Changing Formatting by Programs
• Pattern Instances
• Matrix Identities
• Amitsur-Levitzky Identity
• Frobenius Formula for Block Matrices
• Iterative Matrix Square Root
• Differential Matrix Identities
• Matrix Derivatives
• Precedences of All Operators
• One-Liners
• Changing \$1
• Meissel Formula
• Binary Bracketing
• Kolakoski Sequence
• Puzzles
• Cloning Functions
• Hash Values
• Permutation Digit Sets

### Solutions

• Chemical Element Data
• Population Data of US Cities and Villages
• Caching versus List-Lookup
• Electronic Publication Growth
• Statistics of Author Initials
• Analyzing Bracket Frequencies
• Word Neighbor Statistics
• Weakly Decreasing Sequences
• Finding All Built-in Symbols with Values
• Automated Custom Code Formatting
• Making Dynamically Formatted Inputs
• Working with Symbolic Matrices
• Determining Precedence Automatically
• Permutation Polynomials
• Working with Virtual Matrices

# Graphics Volume

## CHAPTER 1 Two-Dimensional Graphics

### 1.0 Remarks

• Role of Visualization in and of Mathematics

### 1.1 Fundamentals

#### 1.1.1 Graphics Primitives

• Points, Lines, and Polygons
• Text in Graphics
• Creating and Displaying Graphics
• Complex Cantor Sets
• Dimension Transitions Animation
• Tree of Pythagoras
• Generalized Pythagoras Theorem
• 2D Graphics Sampler with 100 Examples
• Constructing a Caustic
• Pedal Curve
• Projection into 2D
• Pentagon Tree
• Meyer Quasicrystal
• Poincaré Model of the Hyperbolic Plane
• Böttcher Function of the Quadratic Map
• Complex Continued Fractions
• From Graphics to Animations
• Phyllotaxis Spiral
• Julia Sets
• Farey Tree
• Deposition Modeling
• Rauzy Tessellations
• Islamic Wicker

#### 1.1.2 Directives for Graphics Primitives

• Absolute and Relative Sizes of Points and Lines
• Color Schemes and Color Values
• Circles Rolling on Circles
• An Optical Illusion: The Bezold Effect

#### 1.1.3 Options for 2D Graphics

• Max Bill's Picture of Nested n-gons
• Influence of Each Options
• Aspect Ratios
• Labeling Axes
• Fonts and Typeset Expressions in Graphics
• Framing Graphics
• Overlaying Graphics
• Specifying Tick Marks
• Repeatedly Displaying Graphics

#### 1.1.4 A First Graphics Application: Voderberg Nonagon

• Polygons that Enclose Each Other
• Reinhardt's Conjecture
• Finding Matching Polygons

### 1.2 Plots of Functions

#### 1.2.1 Plots of Functions Given Analytically

• The Process of Making a Plot
• Controlling Smoothness and Resolutions of Plots
• Iterated Trigonometric Functions
• Plotting Multiple Functions
• Absolute Value Approximation
• Distribution of Bend Angles
• Fooling the Plotting Function
• Visualizing High-Order Taylor Series
• Plotting Parametrized Curves
• Lissajous Figures
• Hedgehogs of Curve Families
• Astroid

#### 1.2.2 Plots of Functions Defined Only at Discrete Points

• Digit Distributions in Various Bases
• Nowhere Differentiable Continuous Functions
• Riemann's Continuous Nondifferentiable Function
• Minkowski's Function
• Periodic Continued Fractions Made Continuous

### 1.3 Combining Several Images

#### 1.3.1 Arrays of Graphics

• Spirals
• Arrays of Graphics
• Inverting Graphics
• Polyspirals
• Inscribing Graphics into Rectangles
• Graphing a Mouse
• Manipulating Given Graphics
• Puzzles Made from Subdivided Graphics
• Clipping Polygons
• Absolute Size of Text

#### 1.3.2 Animations

• Vibrating Linear Chain
• Perron Tree Construction
• Circles on Circles
• Microscopic Moiré Pattern
• Tangential Circles in Regular Polygons
• Julia Set Evolution from Pullbacks of the Quadratic Map
• Lattice Interpolations
• Po'lya's Orchard Problem
• Dragon Generation Animation

### 1.4 Packages

• Graphics Packages
• Visualizing Graphs
• Hypercube Wireframe
• Graphing Implicit Curves
• Graphing Vector Fields

### 1.5 Graphics of Iterative Mappings

#### 1.5.1 Sierpinski Triangle

• Iteratively Subdividing Triangles
• Overlaying Graphics
• Inverted Sierpinski Triangle
• Applying Nonlinear Transformations

#### 1.5.2 Peano Curves

• Space-Filling Curves
• Filling a Triangle with a Curve
• Connecting Subdivided Triangles

#### 1.5.3 Lebesgue's Mapping of the Cantor Set

• Curves Based on Digit Expansions
• Filling Fractal Curves
• General Digit Expansions

#### 1.5.4 Subdivision of an L-Shaped Domain

• Aperiodic Tilings
• Applying Transformations to Graphics
• Triangle Subdivisions

#### 1.5.5 Penrose and Substitution Tilings

• Tilings Using Rhombii
• Coloring and Painting Tilings
• Tilings Based on Kites and Darts
• Manipulating Existing Graphics
• Fractal Tilings
• Cut-and-Project Method

#### 1.5.6 Barnsley's Fern, Mazes, and Other Random Images

• Random Numbers
• Random Number Generators
• Generating Random Expressions
• Law of the Iterated Logarithm
• Random Sums
• Random Replacements
• Bak-Sneppen Model
• Samples of 2D Graphics that Contain Randomness
• Eigenvalues of Random Matrices
• Making Concave Polygons Convex
• Strange Nonchaotic Attractors
• Random Circle Segment Patterns
• Kaleidoscopes
• Mazes
• Square and Hexagonal Truchet Images
• Randomly Bent Ropes
• Iterated Function Systems
• Barnsley's Fern
• Searching for Iterated Function Systems
• Bahar Systems

#### 1.5.7 Koch Curves

• Koch Curve Generator
• Random and Deterministic Koch Curves
• Filling Koch Curves
• Manipulating Koch Curves

#### 1.5.8 Honeycombs and Escher Drawings

• Constructing and Coloring Hexagon Lattices
• Interlocking Lizards
• Hyperbolic Triangles and Hyperbolic Tilings
• Inversion on a Circle

#### 1.5.9 Lindenmayer Systems, Monster Curves, Grasses, and Herbs

• L-System Syntax: Axioms and Replacement Rules
• Examples of L-Systems
• Space Filling Curves
• Filled Gosper Curve
• L-Systems with Branching
• L-Systems that Model Plants
• Random L-Systems

### 1.6 Coloring Closed Curves

• Coloring Plots
• Finding Curve Intersections
• Sorting 2D Line Segments
• Loop Construction
• Constructing the Clusters
• Checkerboard Coloring
• Some Examples
• Checking if Polygons are Disjoint

### Exercises

• Game of Life
• Langton's Ant
• Brillouin Zones
• Maxwell-Helmholtz Color Triangle
• Conformal Maps
• Cornet Isogons
• Jarni'k Polygons
• Light Ray Reflections in a Water Drop
• Warped Patterns
• Moiré Patterns
• Triptych Fractal
• Multiple Reflected Pentagons
• Random Lissajous Figures
• Walsh Function
• Sorting Game
• Ball Moves
• Rectangle Packings
• Smoothed L-Systems
• Polygonal Billiards
• Random Walk on a Sierpinski Fractal
• Voronoi Tessellations
• Lévy Flights
• Random Supersymmetric Potential
• Common Plotting Problems
• Clusters on Square Grids
• Aperiodic Triangle Tilings

### Solutions

• Random Cluster Generation
• Leath Clusters
• Midsector Lines
• Analyzing Mathematica Code
• Visualizing Piecewise Linear Approximations
• Cartesian Ray
• Kepler Cubes
• Modulated Sin-Curves
• Superimposed Lattices
• Triptych Fractals
• Two Superimposed Bumps Forming Three Bumps
• Repeatedly Mirrored Decagons
• Smoothly Connected Curves
• Randomly Deformed Graphics
• Random Expressions

## CHAPTER 2 Three-Dimensional Graphics

### 2.1 Fundamentals

#### 2.1.1 Graphics Primitives

• Points, Lines, and Polygons
• Cuboids
• Projecting a Hypercube into 3D
• Nonplanar and Nonconvex Polygons
• Translating 3D Shapes
• Escher's Cube World

#### 2.1.2 Directives for Three-Dimensional Graphics Primitives

• Absolute and Relative Sizes of Points and Lines
• Constructing an Icosahedron from Quadrilaterals
• Coloring Polygons in the Presence of Light Sources
• Diffuse and Specular Reflection
• Edges and Faces of Polygons
• Rotating 3D Shapes
• Random Rotations
• Stacked Tubes
• Text in 3D Graphics

#### 2.1.3 Options for 3D Graphics

• The 34 Options of 3D Graphics
• Relative and Absolute Coordinate Systems
• Space Curves versus Space Tubes

#### 2.1.4 The Structure of Three-Dimensional Graphics

• Resolving Automatic Option Settings
• Nested Primitives and Directives
• Converting 3D Graphics to 2D Graphics

#### 2.1.5 Discussion of Selected Options

• Platonic Solids
• Choosing the Viewpoint
• Simple 3D Shapes
• Light Sources and Colored Polygons
• Cluster of Dodecahedra
• Views on an Octant Filled with Cubes
• Restricting the Plot Range
• The 3D Graphics Enclosing Box
• View Direction
• Sizing Identical Graphics Independently of the Viewpoint
• Rendering All versus Rendering Only Visible Polygons
• Intersecting Polygons
• Colliding Platonic Solids
• A Scale with Platonic Solids
• Diamond Faces
• Rolled Checkered Paper
• Woven Tubes
• Smooth Dodecahedron-Icosahedron Transition
• Platonic Solid Metamorphosis
• Slicing a Cube

### 2.2 Display of Functions

#### 2.2.1 Functions Given Analytically

• Graphing Functions of Two Variables
• Special Plotting Options
• Wireframes
• Showing Multiple Plots
• Parametrized Vector Functions
• Cubed Torus
• Klein Bottle
• Parametrized Surfaces Samples
• Using Symmetries to Construct Graphics
• Constructing a Candelabra
• Surfaces of Revolution
• Emission of an Accelerated Point Charge
• Borromaen Rings
• Spiraling Spiral
• Constructing a Birthday Bow

#### 2.2.2 Functions Given at Data Points

• Visualizing 2D Arrays of Data
• Visualizing Computation Timings
• Time Evolution on a Torus
• 3D Bar Charts
• Randomized Geode

### 2.3 Some More Complicated Three-Dimensional Graphics

#### 2.3.1 3D Graphics of Iterative Mappings

• Rauzy Fractal From a 3D Projection
• 3D Sierpinski Sponge
• Exercising a Sierpinski Sponge
• Kepler Tiling
• 3D Iterated Function System
• Random Clusters of Tetrahedra
• Quaquaversal Tiling
• 3D Truchet Graphics
• 3D Space Fillers

#### 2.3.2 Tubular Curves

• Frenet Frame
• Tangents, Normals, and Binormals of Space Curves
• Tubes around Space Curves
• Knots
• Mapping Textures to Knots
• Tubes around Piecewise Straight Curves
• Biased Random Walk
• Osculating Circles of Curves

#### 2.3.3 Recursively Colored Easter Eggs

• Recursively Subdividing Surfaces
• Deformed Spheres
• Mapping Patterns to Spheres
• Rough Surfaces

#### 2.3.4 Klein Bottles

• Making Surfaces by Gluing the Edges of a Square
• Spine Curves
• Cross Sections of Klein Bottles
• Slicing and Coloring Klein Bottles
• Deformed Klein Bottles
• Cubistic Klein Bottles

#### 2.3.5 A Hypocycloidal Torus

• Rotating Curves to Sweep out Surfaces
• Triangulations
• Surfaces with Holes

#### 2.3.6 The Penrose Tribar

• Constructing a Tribar
• Coordinate System Transformations
• Choosing the Right View Point
• Calculating the Optimal Viewpoint
• An Impossible Crate

#### 2.3.7 Riemann Surfaces of Simple Functions

• Plotting Multivalued Functions
• Riemann Surfaces of Algebraic Functions
• Cutting Surfaces along Branch Cuts
• Surfaces Subdivided Using Tilings
• A Family of Polynomial Riemann Surfaces
• Implicit Parametrizations
• Riemann Surfaces of Nested Logarithms
• Riemann Surfaces over the Riemann Sphere

#### 2.3.8 Interwoven Polygonal Frames

• Planes Intersecting Convex Bodies
• Calculating All Intersections
• Creating Frames
• Interweaving Frames
• Examples of Interwoven Frames

#### 2.3.9 Selfintersecting Origami and 4D Hilbert Curves

• Paper Folding Models
• Goffinet Kite
• Folding Animation
• Hilbert Curves in Higher Dimensions

#### 2.3.10 The Cover Image: Hyperbolic Platonic Bodies

• Triangulating Platonic Solids
• Symmetry Considerations
• Compact Code
• Evolution of the Cover Graphics from Version 2 to Version 5
• Nonplanar Contraction and Expansion of Polyhedra

### 2.4 Brillouin Zones of Cubic Lattices

• Higher Degree Voronoi Regions
• Simple Cubic Lattice
• Bisector Planes
• Intersection of Planes
• Symmetry of a Cube
• Forming Brillouin Zones from Polygons
• Gluing Polygons Together
• Body-Centered Lattice
• Face-Centered Lattice

### Exercises

• 3D Surface Sampler
• Warped, Twisted, and Interlocked Tori
• Dodecahedra Iteratively Reflected on its Faces
• Snail
• Trinomial Theorem Visualization
• Ball Blending Method
• Loop Subdivision
• sqrt(3)-Subdivision Algorithm
• Averaging Closed Curves
• Projective Plane Model
• Counting Surfaces for a Given Genus
• Lattice Pyramids
• Fractal Mountains
• Random Walk on a Sphere
• Projecting onto Polyhedra
• Alexander's Horned Sphere
• Polyhedral Caustic
• Sliced Möbius Strip
• Perspective Modeling
• Displaying Hidden Edges
• Generating Platonic Solid Clusters
• A 4D Platonic Solid--The 120-Cell
• Folding a Dodecahedron
• Continuously Changing Polyhedra
• Inscribing Five Cubes in a Dodecahedron
• Interwoven Bands around a Dodecahedron
• Knot with Escher Tiling
• Gear Chain Animation
• 3D Peano Polygon
• Tetraview Riemann Surface Animation
• Riemann Surface of Kepler Equation
• Sierpinski Plant

### Solutions

• Cayley Cusp
• Boy Surface
• Möbius Strip
• Steiner's Cross Cap
• Henneberg Surface
• Flying Saucer Construction
• Random Parametrized Surfaces
• Dodecahedral Flowers
• Extruded Platonic Solids
• Smoothing through Graph Plotting
• Staggered Trefoil Knots
• Field Lines of Two Charged Spheres
• Random Symmetric Polyhedra
• Graphics of a Screw
• Arranging Worn Stones Tightly
• Random Cones
• Broken Tube
• Weaving a Torus
• Constructing Double and Triple Tori from Torus Pieces
• Massive Wireframes of Platonic Solids
• Smoothing a Cube Wireframe
• Smoothing a Stellated Icosahedron
• Pyramids on Lattices
• Closed Random Walks
• Slicing and Coloring a Möbius Strip
• Coordinate System Transformations
• Kochen-Specker Theorem
• Smooth Random Functions
• Subdividing Concave Polygons

## CHAPTER 3 Contour and Density Plots

### 3.1 Contour Plots

• Contour Graphics
• Converting Contour Graphics
• Options of Contour Graphics
• Cassini Curve
• Various Sample Contour Plots
• Functions Varying Strongly
• Homogeneous Contour Line Density
• Coloring Contour Plots
• Contour Graphics in Nonrectangular Domains
• Speckles and Scarlets from Superimposing 2D Waves
• Smoothing Contour Lines
• Superimposed 2D Waves in Symmetric Directions
• Comparing Options and Option Settings of Plotting Functions
• Algebraic Description of Polygons
• Blaschke Products
• Charged Goffinet Dragon
• Square Well-Scattering Amplitude

### 3.2 Density Plots

• Density Graphics
• Converting Density Graphics
• Arrays of Gray or Color Values
• Lifting Color Value Arrays to 3D
• Earth Graphics
• Array Plots
• Gauss Sums
• Visualizing Difference Equation Solutions
• Visualizing Matrices
• Saunders Pictures
• Making Photomosaics from Density Plots

### 3.3 Plots of Equipotential Surfaces

• Visualizing Scalar Functions of Three Variables
• Marching Cubes
• Plots of Implicitly Defined Algebraic Surfaces
• Implicit Descriptions of Riemann Surfaces
• Gluing Implicitly Defined Surfaces Smoothly Together
• Using Reflection and Rotation Symmetries to Visualize Algebraic Surfaces
• Examples of Surfaces from Spheres, Tubes, and Tori Glued Together
• An Algebraic Candelabra
• Joining Three Cylinders Smoothly
• Zero-Velocity Surfaces
• Implicit Form of an Oloid
• Isosurfaces of Data

### Exercises

• Clusters of Irreducible Fractions
• Chladny Tone Figures in Rectangles and Triangles
• Helmholtz Operator Eigenfunctions of a Tetrahedron
• Liénard-Wiechert Potential of a Rotating Point Charge
• Shallit-Stolfi-Barbé Plots
• Random Fractals
• Functions with the Symmetry of Cubes and Icosahedra
• Icosahedron Equation
• Belye Functions
• Branch Cuts of Hyperelliptic Curves
• Equipotential Plots of Charged Letters
• Charged Random Polygon
• Gauss-Bonnet Theorem
• Interlocked Double and Triple Tori
• Inverse Elliptic Nome
• Contour Plots of Functions with Boundaries of Analyticity
• Isophotes on a Supersphere
• Structured Knots
• Textures on a Double Torus

### Solutions

• Outer Products
• Repeatedly Mirrored Matrix
• Halley Map
• Generating Random Functions
• Weierstrass P Function Based Fractal
• Contour Plots in Non-Cartesian Coordinate Systems
• Spheres with Handles
• Cmutov Surfaces
• Random Surfaces with Dodecahedral Symmetry
• Polynomials over the Riemann Sphere
• Contour Lines in 3D Plots
• Lines on Polygons
• Slicing Surfaces
• Euler-Poincaré Formula
• Mapping Disks to Polygons
• Statistics of n-gons in 3D Contour Plots

# Numerics Volume

## CHAPTER 1 Numerical Computations

### 1.0 Remarks

• Summing Machine Numbers
• Klein's Modular Function and Chazy Equation
• Discretizing the Rössler System
• Modeling the Ludwig-Soret Effect

### 1.1 Approximate Numbers

#### 1.1.1 Numbers with an Arbitrary Number of Digits

• Machine Arithmetic versus High-Precision Arithmetic
• Modified Logistic Map
• Numerical Calculation of Weierstrass Functions
• High-Precision Arithmetic System Parameters
• Fixed-Precision Arithmetic
• Random Fibonacci Recursion
• Smart Numericalization
• Precision and Accuracy of Real Numbers
• Precision and Accuracy of Complex Numbers
• Precision Loss and Gain in Calculations
• Error Propagation in Numerical Calculations
• Principles of Significance Arithmetic
• Error Propagation for Multivariate Functions
• Collapsing Numeric Expressions
• Setting Precision and Accuracy of Numbers
• Guard Digits in High-Precision Numbers
• The Bits of a Number
• Sum-Based Methods of Calculating pi
• Comparing High-Precision Numbers
• Automatic Switching to High-Precision Arithmetic

#### 1.1.2 Interval Arithmetic

• Rigorous Arithmetic
• Notion of an Interval
• Joining and Intersecting Intervals
• Modeling Error Propagation
• Global Relative Attractor of Rationals Maps

#### 1.1.3 Converting Approximate Numbers to Exact Numbers

• Rational Numbers from Approximate Numbers
• Continued Fractions
• Liouville Constant
• Periodic Continued Fractions
• Numbers with Interesting Continued Fraction Expansions
• Continued Fraction Convergents
• Pseudoconvergents
• Gauss-Kusmin Distribution
• Khinchin Constant
• Khinchin-Lévy Theorem
• Lochs' Theorem
• Canonical Continued Fractions
• Minkowski Function
• Generalized Expansions
• Rounding Numbers
• Frisch Function
• Egyptian Fractions

#### 1.1.4 When N Does Not Succeed

• Using Extra Precision
• Undecidable Numerical Comparisons
• Caching High-Precision Results
• Recursive Prime Number Definition
• Sylvester Expansion

#### 1.1.5 Packed Arrays

• Machine Numbers, Tensors, and Packed Arrays
• Developer Functions for Packed Arrays
• Invisibility of Packed Arrays
• Controlling Automatic Packed Array Generation
• Counting Sums and Products of Sets of Integers
• Long-Range Correlations in Natural Texts
• Analyzing Shakespeare's "Hamlet"
• Zipf's Law
• Mean Square Fluctuation of a Random Walk
• Analyzing a Chapter of This Book
• Analyzing a PostScript Graphic

### 1.2 Fitting and Interpolating Functions

• Fitting Data
• Least Squares and Pseudoinverses
• Approximate Solution of the Helmholtz Equation by Plane Wave Expansion
• Nonlinear Fits
• File Size Distribution
• Polynomial Interpolation of Data
• Neville Algorithm
• Convergence and Divergence of Polynomial Interpolations
• Runge Phenomena
• Newton-Cotes Weights
• Interpolating Functions
• Smoothness of Interpolating Functions
• Curvature Driven Evolution
• Dissecting an Interpolating Function
• Splines

### 1.3 Compiled Programs

• Compiling a Calculation
• Compiled Functions
• Julia Set of the Quadratic Map
• Timing Comparisons for Compiled Procedural and Functional Programs
• Randomized Fibonacci Iterations
• Products of partial Sums of Random Variables
• Hansen-Patrick Root-Finding Method
• Distances in Truchet Images
• Cycles in Iterated Exponentiation
• Ikeda Map
• 3D Period-Doubling Animation
• Sandpiles
• Identity Sandpile
• Nonlocal Cellular Automata
• Caustics from Refraction

### 1.4 Linear Algebra

• Finite Resistor Network
• Exact versus Approximate Solutions
• Avoiding Numericalization of Indicies
• Calculating Resistances Through Eigenvalues
• Tagaki Function
• Numerical Solution of a Functional Equation
• Fixed-Precision Arithmetic in Linear Algebra
• Modular Equation for Klein's Modular Function
• Null Spaces of Linear Systems
• Bound State in a Waveguide Crossing
• Sparse Matrices
• Square Network with Random Resistance Values
• Anderson Model

### 1.5 Fourier Transforms

• Discretized Periodic Functions
• Fourier Transform
• Amplitude and Frequency Modulation
• Approximating a Function
• Uncertainty Relations
• Strang's Strange Figures
• Timing Comparisons of Numerical Fourier Transforms
• Inverse Fourier Transforms
• Fourier Transforms of Arrays
• Approximating the Gosper Curve
• Fourier Transforms of Aperiodic Tilings
• Fractional Fourier Transform
• High-Precision Frequency Approximation of Data
• Approximating the Continuous Fourier transform
• List Convolutions and Correlations
• Manipulating Bitmap Graphics
• Visualizing Trigonometric Identities

### 1.6 Numerical Functions and Their Options

• Common Options of Numerical Functions
• Precision To Be Used in Calculations
• Machine Precision versus High-Precision
• Precision Goal for a Numerical Calculation
• Accuracy Goal for a Numerical Calculation
• Accuracy Goals for Independent and Dependent Variables
• Monitoring Numerical Calculations
• Evaluation Order in Numerical Function
• Avoiding the Evaluation of the First Argument
• Using Vector-Valued Variables
• Dummy Variable-Free Function Calls

### 1.7 Sums and Products

• Numerical Products
• Options of Numerical Product Calculations
• Compensated Summation
• Order Sensitivity in Floating Point Summations
• Numerical Sums
• Options of Numerical Summation
• Verifying Convergence
• Borel-Tanner Distribution
• Sequence Transformations
• Numerically Summing Divergent Series
• Continuous Integer Spiral

### 1.8 Integration

• Numerically Integrating a Function
• Introductory Examples
• Integrable Singularities
• Dealing with Singularities along the Integration Path
• Contour Integration
• Constructing Integration Path Iterators
• Monitoring Numerical Integration
• Matrix Functions Defined through Integrals
• Options of Numerical Integration
• Accuracy and Precision of Results
• Termination Conditions
• Methods of Numerical Integration
• Integrating Discontinuous Functions
• Comparison of Basic Integration Methods
• Visualization of the Sample Points
• Area of a Supersphere
• Comparing Multidimensional Integration Methods
• Double Exponential Method
• Monte-Carlo and Quasi Monte-Carlo Integration
• Distribution of Monte Carlo Sample Points
• van Der Corput Sequences
• Integration of Piecewise Continuous Functions
• Using Symmetries of the Integrands
• Picard-Lindelöf Iteration

### 1.9 Solution of Equations

• Numerical Solution of Polynomials, Polynomial Systems, and Arbitrary Functions
• Sensitivity of Polynomial Roots to Changes in a Coefficient
• Iterated Roots
• Distances between Polynomial Roots
• Schrödinger Equation for Periodic Potential and Applied Magnetic Field
• Farey Sequences
• Hofstadter Butterfly on a Finite Lattice
• Kohmoto Model
• Bézout and Bernstein Bounds for the Number of Roots of Polynomial Equations
• Root Finding of General Functions
• Monitoring the Search Path
• Termination Conditions
• Root-Finding Methods
• Methods of Numerical Equation Solving
• Calculating Jacobians
• Multiple Roots and Roots of Noninteger Order
• Variable-Free Minimization
• Voderberg Spiral
• Nested Touching Circles

### 1.10 Minimization

• Finding the Minimum
• Methods of Numerical Minimization
• Visualizing Search Paths
• Method Option Choices for Numerical Optimization
• Minimizing Sums of Squares
• Sliding Down a Spiral Slide
• Finding Global Minima
• Minimum Energy Configuration of n Electrons in a Disk
• Iterative Minimizations

### 1.11 Solution of Differential Equations

#### 1.11.1 Ordinary Differential Equations

• Boundary and Initial Value Problems
• Interpolating Functions as Solutions
• Differential-Algebraic Equations
• Pendulum ODE
• Anharmonic Oscillator with Random Forcing
• Squatting on a Swing
• Newton Vector Field
• Spiral Waves
• 4D Chaotic Attractor
• Energy Bands in a Random Complex Potential
• Stiff and Nonstiff Systems
• Precision Control
• Nonlinear Differential Equation with Isochronous Solutions
• Buchstab Function
• Higher Order ODEs
• Particle Motion in a Wave Field
• Chazy Equation
• Boundaries of Analyticity
• Generalized Airy Functions
• Monitoring Numerical Differential Equation Solving
• Stepsize Control
• Coupled Pendulums
• Restricting the Solutions
• Stopping the Solution Process
• Calculating and Visualizing Pursuits
• Finding the Initial Slope for the Thomas-Fermi Equation
• Forced Coupled Oscillators
• Chaotic Scattering on a Four-Hill Potential
• Events in Differential Equation Solving
• Vector and Matrix Differential Equations
• Method Option Choices
• Integrated Brownian Motion
• Modified Lorenz System
• Calculating Contour Curves Through Differential Equations
• Geodesics on a Triple-Periodic Surface
• Using Homotopies to Solve Polynomial Systems
• Trajectories in Central Force Fields
• Three-Body Scattering
• Interacting Vortices
• Periodic Orbits of the Restricted Three-Body Problem
• Combining Numerical Functions
• Periodic Orbits of the Lorenz System
• Bohm's Quantum Trajectories
• Continuous Time Random Walks on Graphs
• Sparse Arrays in Differential Equations

#### 1.11.2 Partial Differential Equations

• Parabolic and Hyperbolic PDEs
• 1D Schrödinger Equation with Dirichlet Boundary Conditions
• Scattering on a Potential Wall
• 1D Wave Equation
• PDE-Specific Options
• Singular Initial Conditions
• Wave Function Shredding in an Infinite Well of Time-Dependent Width
• Fokker-Planck Equation for a Damped Anharmonic Oscillator
• Liouville Equation for an Anharmonic Oscillator
• Klein-Gordon Equation
• Differential Equations with Mixed Derivatives
• Nonlinear Schrödinger Equation
• Complex Ginzburg-Landau Equation
• Zakharov Equations
• Prague Reaction-Diffusion Model

### 1.12 Two Applications

#### 1.12.1 Visualizing Electric and Magnetic Field Lines

• Differential Equations for Field Lines
• Field Lines of 2D Charge Configurations
• Reusing Programs
• Stopping Criteria for Field Lines
• Field Lines for 3D Charge Configurations
• Field Lines as Tubes
• Field Lines of Magnetic Fields
• Biot-Savart Rule
• Magnetic Field Lines of a Peano Curve-Shaped Wire
• Nonclosed Magnetic Field Lines
• Field Lines of a Ring Coil

#### 1.12.2 Riemann Surfaces of Algebraic Functions

• Algebraic Functions as Bivariate Polynomials
• Faithful Riemann Surfaces
• Implicit Parametrizations
• Branch Cuts and Branch Points
• Discriminant
• First Order ODEs for Algebraic Functions
• Sheets of Riemann Surfaces
• Samples of Riemann Surfaces

### Exercises

• Logistic Map
• Randomly Perturbed Iterative Maps
• Functions with Boundaries of Analyticity
• q-Trigonometric Functions
• Franel Identity
• Bloch Oscillations
• Courtright Trick
• Hannay Angle
• Harmonic Nonlinear Oscillators
• Orbits Interpolating Between Harmonic Oscillator and Kepler Potential
• Shooting Method for Quartic Oscillator
• Eigenvalues of Symmetric Tridiagonal Matrices
• Optimized Harmonic Oscillator Expansion
• Diagonalization in the Schwinger Representation
• Möbius Potential
• Bound States in the Continuum
• Wynn's Epsilon Algorithm
• Aitken Transformation
• Numerical Regularization
• Scherk's Fifth Surface
• Clebsch Surface
• Smoothed Dodecahedron Wireframe
• Standard Map
• Stochastic Webs
• Forced Logistic Map
• Web Map
• Strange Attractors
• Hénon Map
• Triangle Map Basins
• Trajectories in 2D Periodic Potentials
• Egg Crate Potential
• Pearcey Integral
• Charged Square and Hexagonal Grids
• Ruler on Two Fingers
• Branched Flows in Random Potentials
• Maxwell Line
• Iterated Secant Method Steps
• Unit Sphere Inside a Unit Cube
• Ising-Model Integral
• Random Binary Trees
• Random Matrices
• Iterated Polynomial Roots
• Weierstrass Root Finding Method
• Animation of Newton Basins
• Lagrange Remainder of Taylor Series
• Nodal Lines
• Bloch Equations
• Branch Cuts of Hyperelliptic Curves
• Strange 4D Attractors
• Billiard with Gravity
• Schwarz-Riemann Minimal Surface
• Jorge-Meeks Trinoid
• Random Minimal Surfaces
• Precision Modeling
• Infinite Resistor Networks
• Auto-Compiling Functions
• Card Game Modeling
• Charges With Cubical Symmetry on a Sphere
• Tricky Questions
• Very High-Precision Quartic Oscillator Ground State
• 1D Ideal Gas
• Odlyzko-Stanley Sequences
• Tangent Products
• Thompson's Lamp
• Parking Cars
• Seceder Model
• Avoided Patterns in Permutations
• Cut Sequences
• Exchange Shuffles
• Frog Model
• Second Arcsine Law
• Average Brownian Excursion Shape
• ABC-System
• Vortices on a Sphere
• Oscillations of a Triangular Spring Network
• Lorenz System
• Fourier Differentiation
• Fourier Coefficients of Klein's Function
• Singular Moduli
• Curve Thickening
• Random Textures
• Random Cluster Growth
• First Digit Frequencies in Mandelbrot Set Calculation
• Interesting Jerk Functions
• Initial Value Problems for the Schrödinger Equation
• Initial Value Problems for 1D, 2D, and 3D Wave Equation
• Continued Inverse Square Root Expansion
• Lüroth Expansion
• Lehner Expansion
• Brjuno Function
• Sum of Continued Fraction Convergents Errors
• Average Scaled Continued Fraction Errors
• Bolyai Expansion
• Symmetric Continued Fraction Expansion

### Solutions

• Solving Polynomials Using Differential Equations
• Stabilizing Chaotic Sequences
• Oscillator Clustering
• Transfer Matrices
• Avoided Eigenvalue Crossings
• Hellmann-Feynman Theorem
• Scherk Surface Along a Knot
• Time-Evolution of a Localized Density Under a Discrete Map
• Automatic Selection of "Interesting" Graphic
• Static and Kinematic Friction
• Smoothing Functions
• Eigenvalues of Random Binary Trees
• Basins of Attraction Fractal Iterations
• Calculating Contour Lines Through Differential Equations
• Manipulating Downvalues at Runtime
• Path of Steepest Descent
• Fourier Series Arc Length
• Poincaré Sections
• Random Stirring
• Heegner Numbers
• Quantum Random Walk
• Quantum Carpet
• Coherent State in a Quantum Well

## CHAPTER 2 Computations with Exact Numbers

### 2.0 Remarks

• Using Approximate Numerics in Exact Calculations
• Integer Part Map

### 2.1 Divisors and Multiples

• Factoring Integers
• Number of Prime Factors
• Divisors
• Sum of Squares
• Derivative of an Integer
• mod Function
• Rotate and Mod
• nth Digit of a Proper Fraction
• Schönberg's Peano Curve
• Greatest Common Divisors and Least Common Multiples
• Euclidean Algorithm
• Classical and Generalized Maurer Roses
• de Bruijn Medallions and Friezes

### 2.2 Number Theory Functions

• Prime Numbers
• Prime Number Spiral
• Prime Counting Function
• Euler's Totient Function
• Absolutely Abnormal Number
• Möbius Function
• Redheffer Matrix
• Möbius Inversion
• Calculating Fourier Transforms through Möbius Inversion
• Jacobi Symbol
• Reciprocity Law

### 2.3 Combinatorial Functions

• Factorials
• Digits of Factorials
• Stirling's Formula
• Binomials and Multinomials
• Nested Triangle Patterns
• Stirling Numbers
• Counting Partitions
• Generating Partitions
• Partition Identities

### 2.4 Euler, Bernoulli, and Fibonacci Numbers

• Akiyama-Tanigawa Algorithm
• Euler-Maclaurin Formula
• Lidstone Approximations
• Boole Summation Formula
• Divide-and-Conquer Algorithm for Calculating Large Fibonacci Numbers
• Fibonacci-Binomial Theorem
• Discretized Cat Map

### Exercises

• Sum of Divisor Powers
• Recurrence Relation for Primes
• Arcsin Law for Divisors
• Average Length of Continued Fractions of Rationals
• Isenkrahe Algorithm
• Prime Divisors
• Kimberling Sequence
• Cantor Function Integral
• Cattle Problem of Archimedes
• Mirror Charges in a Wedge
• Periodic Decimal Numbers
• Digit Sequences in Numbers
• Numbered Permutations
• Binomial Coefficient Values
• Smith's Sturmian Word Theorem
• Modeling a Galton Board
• Ehrenfest Urn Model
• Ring Shift Modeling
• Sandpile Model
• Longest Common Subsequence
• Riffle Shuffles
• Weekday from Date
• Easter Dates
• Lattice Points in Disks
• Binomial Digits
• Average of Partitions
• Partition Moments
• 15 and 6174
• Selberg Identity
• Kluyver Identities
• Ford Circles
• Farey-Brocot Interval Coverings
• Sum of Primes
• Visualizing Eisenstein Series
• Magnus Expansion
• Goldbach Conjecture
• Zeckendorf Representation
• Sylvester-Fibonacci Expansion
• Ramanujan \[Tau] Function
• Cross-Number Puzzle
• Cyclotomic Polynomials
• Generalized Bell Polynomials
• Online Bin Packings
• Composition Multiplicities
• Subset Sums

### Solutions

• Nested Iterators
• Being Prime Expressed Analytically
• Legendre Symbol
• Pell Equation
• Recognizing Algebraic Numbers
• Iterated Digit Sum of Divisors
• Guiasu Prime Counting Formula
• Divisor Sum Identities
• Choquet Approximation
• Optical Factoring
• Generalized Multinomial Theorem
• Sums with Constraints
• Faá di Bruno Formula
• Symbolic Tables

# Symbolics Volume

## CHAPTER 1 Symbolic Computations

### 1.1 Introduction

• Simplifying Expressions
• Type Declarations for Simplifications
• Evaluating Expressions Under Assumptions

### 1.2 Operations on Polynomials

#### 1.2.1 Structural Manipulations on Polynomials

• Expanding and Factoring Polynomials
• Factors of Random Polynomials
• Irreducible Polynomials
• Constructing Irreducible Polynomials from Primes
• Factorization over Extension Fields
• Reordering Multivariate Polynomials
• Indeterminates of Polynomials
• Extracting Coefficients from Polynomials
• Decomposing Polynomials

#### 1.2.2 Polynomials in Equations

• Polynomial Division
• Resultants
• Sylvester Matrix
• Differential Equation for the Elliptic Nome
• Gröbner Bases
• Applications of Gröbner Bases
• Equation Solving Using Gröbner Basis
• Approximative Gröbner Bases
• Monomial Orders
• Showing Inconsistency of Equations Using Gröbner Bases
• Finite-Dimensional Representation of the Canonical Commutation Relations
• Eliminating Variables Using Gröbner Bases
• Geometric Theorem Proving
• All Square Roots of Square Matrices
• Bound States in Spherical Symmetric Potentials
• Gröbner Walks
• Reducing Polynomials

#### 1.2.3 Polynomials in Inequalities

• Cylindrical Algebraic Decompositions
• Solving Inequalities
• Locally Parametrizing a Squeezed Torus
• Arnold Cat Map
• Generic Cylindrical Algebraic Decomposition
• Quantifier Elimination
• Generally Proving Inequalities
• Proving Triangle Inequalities
• Deriving New Geometry Theorems
• Restricting Polynomial Roots
• Proving the Sendov-Iliev Conjecture for Quadratic Polynomials
• Deriving Clauser-Horn Inequalities
• Algebraic Blending
• Minkowski Sums

### 1.3 Operations on Rational Functions

• Numerators and Denominators
• Expanding Parts of Nested Fractions
• Partial Fraction Decomposition
• Writing Rational Functions over Common Denominators
• Gale-Robinson Sequence
• The Power of "Togethering"
• Mapping of the Fundamental Domain

### 1.4 Operations on Trigonometric Expressions

• Expansion and Factorization of Trigonometric Expressions
• Addition Theorems for Trigonometric Functions
• Converting Trigonometric Functions to Exponential Form
• Real and Imaginary Parts of Symbolic Expressions

### 1.5 Solution of Equations

• The Notion of Generic Solutions
• Solving Univariate Polynomials in Radicals
• Cubic Polynomials with Three Real Roots
• Symbolic Roots as Solutions of Univariate Polynomials of Any Degree
• Exact Operations on Polynomial Roots
• Matrix Eigenvalues
• Canonicalization of Symbol-Free Algebraic Expression
• Hölder's Theorem about Real Roots of Cubics
• Solving Systems of Polynomials
• Vieta Relations
• Solving Systems of Algebraic Equations
• Solving Nonpolynomial Equations
• Using Inverse Functions
• Solving Trigonometric Equations
• Solving Transcendental Equations
• Verifying Parametric Solutions
• Superposition of Damped Oscillations
• Finding Degenerate Solutions
• Elimination of Variables
• Universal Differential Equation
• Guidelines for Solving Equations and Systems of Equations

### 1.6 Classical Analysis

#### 1.6.1 Differentiation

• Multivariate Differentiation
• Numericalization of Unevaluated Derivatives
• Numerical Differentiation
• Differentiating in the Complex Plane
• Schwarz Theorem
• Differential Algebraic Constants
• High-Order Derivatives
• Derivatives of Inverse Functions
• Differentiation With Respect to Vectors
• Derivatives of Pure Functions
• Differential Equations for n-Nomials
• Generalized Taylor Expansion
• Differentials
• Metric Tensors, Christoffel Symbols, and Geodesics
• Iterated Evolutes
• Phase Integral Approximation

#### 1.6.2 Integration

• Algorithms for Symbolic Integration
• Assumptions on Variables Having Generic Values
• Integrating Abstract Functions
• Korteweg-deVries Equation Hierarchy
• Indefinite Integration Samples
• Integrals and Special Functions
• Integrating Rational Functions
• Integrating Algebraic Functions
• Assumptions of Parameter Variables
• Assumptions in Indefinite Integrals
• Generating Conditions for Convergence
• Cauchy Principal Value Integrals
• Multidimensional Integrals
• Robbin's Integral Identity
• Definite Integrals from Indefinite Integrals
• Piecewise Continuous Antiderivatives
• Continuity of Indefinite Integrals
• Weierstrass Parametrization of Minimal Surfaces
• Infinite Resistor Network
• Timings of Indefinite versus Definite Integration
• d'Alembert Solution of the One-Dimensional Wave Equation
• Schrödinger Equation with a Time-dependent Linear Potential
• Definite Integrals and Branch Cuts

#### 1.6.3 Limits

• Indeterminate Expressions and Limits
• Limit Samples
• Direction Dependence of Limits
• Evaluating Limits Under Assumptions
• Limits of Analytic Functions
• Schwarz Derivative
• Limits of Iterative Function Applications
• Multiple Limits

#### 1.6.4 Series Expansions

• Internal Structure of a Series-Object
• Taylor Series
• Continued Fraction with Three Limit Points
• Laurent Series
• Puiseux Series
• Series Expansions at Branch Points and Branch Cuts
• Series of Special Functions
• Essential Singularities
• Numerov-Mickens Scheme
• Multivariate Series
• Roots of Truncated Series
• q-Taylor Series
• Arithmetic of Series
• Change for \$1
• Iterated Constant Terms
• Inverse Series
• Higher-Order Newton and Chebyshev Methods
• Fractional Iterations
• Cumulant Expansions
• Laurent Series for Mandelbrot Set
• Approximating Linear Functionals

#### 1.6.5 Residues

• Symbolic Residues at Poles
• Generalized Residues
• Residues of Special Functions

#### 1.6.6 Sums

• Sum of Powers
• Numericalization of Symbolic Expressions
• Procedural versus Symbolic Finite Summations
• Riemann Surface of the Square Root Function
• Weierstrass's Method of Analytic Continuation

### 1.7 Differential and Difference Equations

#### 1.7.1 Ordinary Differential Equations

• Solutions as Rules
• Pure Functions as Solutions
• Degenerate Solutions
• Integration Constants
• Linear Inhomogeneous ODE with Constant Coefficients
• ODEs with Separated Variables
• Homogeneous ODEs
• Exact ODEs
• Bernoulli ODE
• Jacobi ODEs
• Special Riccati ODEs
• Abel ODEs of the First Kind
• Abel ODEs of the Second Kind
• Chini ODEs
• Lagrange ODEs
• Clairaut ODEs
• ODEs with Shifted Argument
• Cayley ODE
• Second Order ODEs
• Differential Equations of Special Functions
• Schrödinger Equations for Various Smooth Potentials
• Schrödinger Equations for Piecewise-Defined Potentials
• Higher-Order Differential Equations
• Implicit Solutions
• Monitoring Differential Equation Solving
• δ-Expansion

#### 1.7.2 Partial Differential Equations

• Hamilton-Jacobi Equation
• Szebehely's Equation
• Solutions with Arbitrary Functions

#### 1.7.3 Difference Equations

• Linear Difference Equations
• Calculating Casoratians
• Linear Difference Equations with Nonconstant Coefficients
• Some Nonlinear Difference Equations
• Difference Equations Corresponding to Differential Equations
• Systems of Difference Equations

### 1.8 Integral Transforms and Generalized Functions

• Generalized Functions and Linear Functionals
• Heaviside Theta Function and Dirac Delta Function
• Integrals Containing Generalized Functions
• Multivariate Heaviside Theta and Dirac Delta Function
• Time Dilation
• Derivatives of the Dirac Delta Function
• Simplifying Generalized Functions
• Sequence Representations of Generalized Functions
• Green's Function of Linear Differential Operators
• Generalized Solutions of Differential Equations
• Compactons
• Fourier Transforms
• Self-Fourier Transform
• Principle Value Distribution
• Sokhotsky-Plemelj Formula
• Poincaré-Bertrand Identity
• Laplace Transforms
• Borel Summation of Divergent Sums

• Variational Calculus
• Symbolic Series Terms
• Ramanujan's Master Theorem

### 1.10 Three Applications

#### 1.10.1 Area of a Random Triangle in a Square

• A Quote from M. W. Crofton
• Generalizations
• Generic Cylindrical Algebraic Decompositions
• Six-Dimensional Definite Integrals from Indefinite Integrals
• Monte Carlo Modeling
• Calculating the Probability Distribution of the Area

#### 1.10.2 cos(2pi/257) á la Gauss

• The Morning of March 29 in 1796
• Gauss Periods
• Primitive Roots
• Splitting and Combining Periods
• Thousands of Square Roots
• cos(2pi/65537)
• Fermat Primes

#### 1.10.3 Implicitization of a Trefoil Knot

• Parametric versus Implicit Description of Surfaces
• Envelope Surface of a Moving Ball
• Polynomialization of Trigonometric Expressions
• Calculating a Large Resultant
• Smoothing the Trefoil Knot
• Inflating a Trefoil Knot
• Implicit Klein Bottle

### Exercises

• Heron's formula
• Tetrahedron Volume
• Apollonius Circles
• Proving Trigonometric Identities
• Icosahedron Inequalities
• Two-Point Taylor Expansion
• Horner Form
• Nested Exponentials and Logarithms
• Minimal Distance between Polynomial Roots
• Dynamical Determimants
• Appell-Nielsen Polynomials
• Scoping in Iterated Integrals
• Rational Solution of Painlevé II
• Differential Equation for Products and Quotients of Linear Second Order ODEs
• Singular Points of First-Order ODEs
• Fredholm Integral Equation
• Inverse Sturm-Liouville Problem
• Graeffe Method
• Lagrange Interpolation in 2D Triangles
• Finite Element Matrices
• Hermite Interpolation-Based Finite Element Calculations
• Hylleraas-Undheim Helium Ground State Calculation
• Variational Calculations
• Hyperspherical Coordinates
• Constant Negative Curvature Surfaces
• Optimal Throw Angle
• Jumping from a Swing
• Normal Form of Sturm-Liouville Problems
• Noncentral Collisions
• Envelope of the Bernstein Polynomials
• Eigensystem of the Bernstein Operator
• A Sensitive Linear System
• Bisector Surfaces
• Smoothly Connecting Three Half-Infinite Cylinders
• Nested Double Tori
• Changing Variables in PDEs
• Proving Matrix Identities
• A Divergent Sum
• Casimir Effect Limit
• Generating Random Functions
• Numerical Techniques Used in Symbolic Calculations
• Series Solution of the Thomas-Fermi Equation
• Majorana Form of the Thomas-Fermi Equation
• Yoccoz Function
• Lagrange-Bürmann Formula
• Divisor Sum Identities
• Eisenstein Series
• Product Representation of exp
• Multiple Differentiation of Vector Functions
• Expressing Trigonometric Values in Radicals
• First Order Modular Transformations
• Forced Damped Oscillations
• Series for Euler's Constant
• q-Logarithm
• Symmetrized Determinant
• High Order WKB Approximation
• Greenberger-Horne-Zeilinger State
• Entangled Four Particle State
• Integrating Polynomial Roots
• Riemann Surface of a Cubic
• Series Solution of the Kepler Equation
• Short Time-Series Solution of Newton's Equation
• Lagrange Points of the Three-Body Problem
• Implicitization of Lissajou Curves
• Evolutes
• Orthopodic Locus of Lissajous Curves
• Cissoid of Lisssajou Curves
• Multiple Light Ray Reflections
• Hedgehog Envelope
• Supercircle Normal Superpositions
• Discriminant Surface
• Periodic Surface
• 27 Lines on the Clebsch Surface
• 28 Bitangents of a Plane Quartic
• Pentaellipse
• Galilean Invariance of Maxwell Equations
• Relativistic Field Transformations
• X-Waves
• Thomas Precession
• Liénard-Wiechert Potential Expansion
• Spherical Standing Wave
• Ramanujan's Factorial Expansion
• q-Series to q-Products
• q-Binomial
• Multiplicative Series
• gcd-Free Partitions
• Single Differential Equations for Nonlinear Systems
• Lattice Green's Function Differential Equation
• Puzzles
• Newton-Leibniz Theorem in 2D
• Square Root of Differential Operator
• Polynomials with Identical Coefficients and Roots
• Amoebas
• Cartesian Leaf Area
• Average Distance between Random Points
• Series Solution for Duffing Equation
• Secular Terms
• Implicitization of Various Surfaces
• Kronig-Penney Model Riemann Surface
• Ellipse Secants Envelope
• Lines Intersecting Four Lines
• Shortest Triangle Billiard Path
• Weak Measurement Identity
• Logarithmic Residue
• Geometry Puzzle
• Differential Equations of Bivariate Polynomials
• Graph Eigenvalues
• Change of Variables in the Dirac Delta Function
• Probability Distributions for Sums
• Random Determinants
• Integral Representation of Divided Differences
• Fourier Transform and Fourier Series
• Functional Differentiation
• Operator Splitting Formula
• Tetrahedron of Maximal Volume

### Solutions

• ODE for Circles
• Modular Equations
• Converting Trigonometric Expressions into Algebraic Expressions
• Matrix Sign Function
• Integration with Scoping
• Collecting Powers and Logarithms
• Bound State in Continuum
• Element Vectors, Mass Matrices, and Stiffness Matrices
• Multivariate Minimization
• Envelopes of Throw Trajectories
• Using Ansätze
• Schanuel's Conjecture
• Matrix Derivatives
• Lewis-Carroll Identities
• Abel and Hölder Summation
• Extended Poisson Summation Formula
• Integration Testing
• Detecting the Hidden Use of Approximate Numbers
• Functions with Nontrivial Derivatives
• Expressing ODEs as Integral Equations
• Finding Modular Null Spaces
• Canonicalizing Tensor Expressions
• Nonsorting "Unioning"
• Linear Diophantine Equations
• Ramanujan Trigonometric Identities
• Cot Identities
• Solving the Fokker-Planck Equation for the Forced Damped Oscillator
• Implementing Specialized Integrations
• Bras and Kets
• Density Matrices
• Recognizing Algebraic Numbers
• Differentiation of Symbolic Vectors
• Visualizing the Lagrange Points
• Gröbner Walk
• Piecewise Parametrizations of Implicit Surfaces
• Generalized Clebsch Surfaces
• Algorithmic Rewriting of Covariant Equations in 3D Vectors
• Darboux-Halphen System
• Cubed Sphere Equation
• Numerically Checking Integrals Containing Derivatives of Dirac Delta Functions
• Lagrange Multipliers
• Elementary Symmetric Polynomials

## CHAPTER 2 Classical Orthogonal Polynomials

### 2.1 General Properties of Orthogonal Polynomials

• Orthogonal Polynomials as Solutions of Sturm-Liouville Eigenvalue Problems
• General Properties of Orthogonal Polynomials
• Expansion of Arbitrary Functions in Orthogonal Polynomials

### 2.2 Hermite Polynomials

• Definition
• Graphs
• ODE
• Orthogonality and Normalization
• Harmonic Oscillator Eigenfunctions
• Density of States
• Shifted Harmonic Oscillator

### 2.3 Jacobi Polynomials

• Definition
• Graphs
• ODE
• Orthogonality and Normalization
• Electrostatic Interpretation of the Zeros
• Pöschl-Teller Potential

### 2.4 Gegenbauer Polynomials

• Laplace Equation in nD
• Definition
• Graphs
• ODE
• Orthogonality and Normalization
• Smoothing the Gibbs Phenomenon

### 2.5 Laguerre Polynomials

• Definition
• Graphs
• ODE
• Orthogonality and Normalization
• Expanding Riemann Spheres
• Summed Atomic Orbitals

### 2.6 Legendre Polynomials

• Definition
• Graphs
• ODE
• Orthogonality and Normalization
• Associated Legendre Polynomials
• Modified Pöschl-Teller Potential

### 2.7 Chebyshev Polynomials of the First Kind

• Definition
• Graphs
• ODE
• Orthogonality and Normalization
• Trigonometric Form
• Special Properties

### 2.8 Chebyshev Polynomials of the Second Kind

• Definition
• Graphs
• ODE
• Orthogonality and Normalization
• Trigonometric Form

### 2.9 Relationships Among the Orthogonal Polynomials

• Gegenbauer Polynomials as Special Cases of Jacobi Polynomials
• Hermite Polynomials as Special Cases of Associated Laguerre Polynomials
• Relations between the Chebyshev Polynomials
• Calogero-Sutherland Model
• Schmeisser Companion Matrix
• Iterated Roots of Orthogonal Polynomials

### 2.10 Ground-State of the Quartic Oscillator

• Harmonic and Anharmonic Oscillators
• Matrix Elements in the Harmonic Oscillator Basis
• High-Precision Eigenvalues from Diagonalizing the Hill Matrix
• Lagrange Interpolation-Based Diagonalization
• Complex Energy Surfaces
• Time-Dependent Schrödinger Equation
• PT-Invariant Oscillators

### Exercises

• Mehler's Formula
• Addition Theorem for Hermite Polynomials
• Sums of Zeros of Hermite Polynomials
• Spherical Harmonics
• Sums of Zeros
• General Orthogonal Polynomials
• Gram-Schmidt Orthogonalization
• Power Sums
• Elementary Symmetric Polynomials
• Newton Relations
• Waring Formula
• Generalized Lissajous Figures
• Hyperspherical Harmonics
• Hydrogen Orbitals
• Zeros of Hermite Functions for Varying Order
• Ground State Energy of Relativistic Pseudodifferential Operator
• Moments of Hermite Polynomial Zeros
• Coherent States
• Smoothed Harmonic Oscillator States
• Darboux Isospectral Transformation
• Forming Wave Packets from Superpositions
• Multidimensional Harmonic Oscillator
• High-Order Perturbation Theory
• Differential Equation System for Eigenvalues
• Time-Dependent Sextic Oscillator
• Time Dependent Schrödinger Equation with Calogera Potential

### Solutions

• Bauer-Rayleigh Identity
• Parseval Identity
• Transmission through Periodic Structures
• Freud's Weight Function
• Wronski Polynomials
• Root-Finding Using Differential Equations
• Finding Ramification Indices Numerically
• Classical and Quantum Mechanical Probabilities for the Harmonic Oscillator
• Root Approximant
• Using Recursion Relations to Calculate Orthogonal Polynomials

## CHAPTER 3 Classical Special Functions

### 3.0 Remarks

• Information Sources about Special Functions
• Experimental Mathematics
• Generalized Harmonic Numbers
• Position and Momentum Eigenfunctions and Wigner Function of the Liouville Potential
• Ramanujan Theta Functions
• Modular Identities

### 3.1 Introduction

• Simplifying Expressions Containing Special Functions
• Expressing Special Functions through Simpler Ones
• Indefinite Integrals of Compositions of Elementary Functions
• Volume of a Supersphere
• PT-Symmetric Oscillator
• Monitoring Simplifying Transformations

### 3.2 Gamma, Beta, and Polygamma Functions

• Definitions
• Exact Values
• Graphs
• Riemann Surface of the Incomplete Gamma Function
• Pochhammer Symbol

### 3.3 Error Functions and Fresnel Integrals

• Definitions
• Error Function in the Complex Plane
• Iterated Integrals of Error Functions
• Free Particle Schrödinger Equation with Piecewise Constant Initial Conditions
• Moshinsky Function
• Harmonic Oscillator Green's Function
• Fresnel Diffraction on a Half-Plane

### 3.4 Exponential Integral and Related Functions

• Definitions
• Graphs
• Logarithmic Integral and Prime Counting Function

### 3.5 Bessel and Airy Functions

• Definitions
• Random Walk on a 2D Square Lattice
• Fractal Based on Bessel Function
• Weber-Schafheitlin Integrals
• Bessel Zeros as a Function of the Index
• Oscillation of a Circular Drum
• Oscillation of a Drum of General Shape
• 2D Helmholtz Equation
• Eigenvalues and Eigenfunctions of the Stadium Billiard
• Airy Functions in the Uniform Approximation of Linear Turning Point Problem
• Harmonic Oscillator Approximations

### 3.6 Legendre Functions

• Definitions
• Graphs
• Electrostatic Potential in a Conducting Cone

### 3.7 Hypergeometric Functions

• Gauss Hypergeometric Function and Generalized Hypergeometric Functions
• Some Special Cases
• Closed Form of Partial Sums of Taylor Series for Trigonometric Functions
• Closed Form Padé Approximations of exp and sign
• Generalized Fresnel Integrals
• Generalized Exponential Functions
• Point Charge Outside a Dielectric Sphere
• Finding Contiguous Relations
• Regularized Hypergeometric Functions
• Solutions of the Hypergeometric Differential Equation
• Meijer G Function
• Eigenfunctions of the Inverse Harmonic Oscillator
• Bivariate Hypergeometric Functions

### 3.8 Elliptic Integrals

• Integrals Containing Square Roots of Cubics and Quartics
• Definitions
• Complete and Incomplete Elliptic Integrals
• Graphs
• Deriving Differential Equations for Incomplete Elliptic Integrals
• Green's Function of the Zeilon Operator
• Finding Modular Equations for Ratios of Elliptic Integrals

### 3.9 Elliptic Functions

• Inverting Elliptic Integrals
• Definitions
• Jacobi's Amplitude Function
• Minimal Surface in a Cube Wireframe
• Applications of Elliptic Functions
• Pendulum Oscillations
• Current Flow through a Rectangular Conducting Plate
• Arithmetic-Geometric Mean

### 3.10 Product Log Function

• Definition
• Solving Transcendental Equations
• Riemann Surface of the Product Log Function

### 3.11 Mathieu Functions

• Differential Equation with Periodic Coefficients
• Definition
• Characteristic Values
• Resonance Tongues
• Branch Cuts and Branch Points
• Oscillation of an Ellipsoidal Drum
• Degenerate Eigenfunctions
• Wannier Functions

• Expressing Other Special Functions through Built-in Special Functions
• More Elliptic Functions
• Zeta Functions and Lerch Transcendents

### 3.13 Solution of Quintic Polynomials

• Klein's Solution of the Quintic
• Tschirnhaus Transformation
• Principal Quintic
• Belyi Function and Stereographic Projection of an Icosahedron Projection
• Solving a Polynomial of Degree 60 through Hypergeometric Functions
• Numerical Root Calculation Based on Klein's Formula

### Exercises

• Asymptotic Expansions of Bessel Functions
• Carlitz Expansion
• Meissel's Formula
• Rayleigh Sums
• Gumbel Distribution
• Generalized Bell Numbers
• Borel Summation
• Bound State in Continuum
• ODEs for Incomplete Elliptic Integrals
• Addition Formulas for Elliptic Integrals
• Magnetic Field of a Helmholtz Coil
• Identities, Expansions, ODEs, and Visualizations of the Weierstrass P Function
• Sutherland-Calogero Model
• Weierstrass Zeta and Sigma Functions
• Lamé Equation
• Vortex Lattices
• ODEs, Addition Formulas, Series Expansions for the Twelve Jacobi Elliptic Functions
• Schrödinger Equations with Potentials that are Rational Functions of the Wave Functions
• Periodic Solutions of Nonlinear Evolution Equations
• Complex Pendulum
• Harmonic Oscillator Eigenvalues
• Contour Integral Representation of Bessel Functions
• Large Order and Argument Expansion for Bessel Functions
• Aperture Diffraction
• Circular Andreev Billiard
• Contour Integral Representation for Beta Functions
• Beta Distribution
• Euler's Constant Limit
• Time-Evolution in a Triple-Well Oscillator
• Eigenvalues of a Singular Potential
• Dependencies in the Numerical Calculation of Special Functions
• Hidden Derivative Definitions
• Perturbation Theory for a Square Well in an Electric Field
• Oscillations of a Pendulum with Finite Mass Cord
• Approximation and Asymptotics of Fermi-Dirac Integrals
• Sum of All 9-Free Reciprocal Numbers
• Green's Function for 1D Heat Equation
• Green's Function for the Laplace Equation in a Rectangle
• Addition Theorems for Theta Functions
• Series Expansion of Theta Functions
• Bose Gas in a 3D Box
• Scattering on a Conducting Cylinder
• Poincaré Waves
• Scattering on a Dielectric Cylinder
• Coulomb Scattering
• Spiral Waves
• Scattering on a Corrugated Wall
• Random Helmholtz Equation Solutions
• Toroidal Coordinates
• Riemann-Siegel Expansion
• Zeros of the Hurwitz Zeta Function
• Zeta Zeta Function
• Harmonic Polylogarithms
• Riemann Surface of Gauss Hypergeometric Functions
• Riemann Surface of the Ratio of Complete Elliptic Integrals
• Riemann Surface of the Inverse Error Function
• Kummer's 24 Solutions of Gauss Hypergeometric Equation
• Differential Equation for Appell Function
• Gauss-Lucas Theorem
• Roots of Differentiated Polynomials
• Coinciding Bessel Zeros
• Ramanujan pi Formulas
• Force-Free Magnetic Fields
• Bessel Beams
• Gauge Transformation for a Square
• Riemann Surface of the Bootstrap Equation
• Differential Equations for Powers of Airy Functions
• Asymptotic Expansions for the Zeros of Airy Functions
• Map-Airy Distribution
• Dedekind η ODE
• Darboux-Halphen System
• Ramanujan Identities for \[CurlyPhi] and λ Functions
• Generating Identities in Gamma Functions
• Modular Equations for Dedekind η Function

### Solutions

• Truncation of Asymptotic Series
• Contour Plots of the Gamma Function
• Series of a Gamma Function Ratio
• Partial Sums of Taylor Series for sin
• Area and Volume of a Hypersphere
• All Integrals of Three Compositions of Elementary Functions
• Binomial at Negative Integers
• Contour Lines of z^z
• Weierstrass P Function over the Riemann Sphere
• Using Gröbner Bases to Derive ODEs
• Riemann Surface of Inverse Weierstrass P Function
• Rocket with Discrete Propulsion
• Monitoring All Internal Calculations
• Machine versus High-Precision Evaluations of Special Functions
• Checking Numerical Function Evaluation
• Zeta Regularized Divergent Products
• Fractional Derivatives
• Identifying Algebraic Numbers

### A.1 References and Other Sources of Information

#### A.1.1 General References on Algorithms for Computer Algebra

• General Computer Algebra Books, References, and Websites
• Sources of Algorithms
• Computer Algebra Journals and Conferences

#### A.1.2 Comparison of Various Systems

• Benchmarks and Timing Comparisons

#### A.1.3 References on Mathematica

• Books
• Journals and Websites
• Conferences
• Package Libraries
• Dedicated Newsgroups
• Timing Comparisions

#### A.1.4 Applications of Computer Algebra Systems

• Article Samples
• Further Information Sources

### W.7 Additions to Chapter 1 of the Graphics Volume

• Repeated Breaking of a Stick
• Animation of Rotating Tiles of an Aperiodic Tiling
• Animation of Circles on Lissajou Figures

### W.8 Additions to Chapter 2 of the Graphics Volume

• Animation of Rotating Textured Möbius Bands
• Animation Of Rotating Interlocked Tori
• Klein Bottle with Hexagonal Massive Wireframe
• Many Random Walkers in 3D
• Bivariate Minkowski Function
• Projections from 4D

### W.9 Additions to Chapter 3 of the Graphics Volume

• Animation of Equal-Eigenvalue Chladny Figures
• Animation of Moving Charged Regular Polygons
• Graphics of Charged Truchet Patterns

### W.10 Additions to Chapter 1 of the Numerics Volume

• Random Walks with Variable Stepsize
• Chaotic Scattering on Three Disks
• Vibrating 2D Hilbert Curve
• Optimal Projections of Hypercubes
• Currents Through a Penrose Tiling
• Numerical Solutions of Various Partial Differential Equations
• Brain Growth Modeling
• Step Bunching Modeling
• Swift-Hohenberg Equation
• Meinhardt Equations
• Complex Ginzburg-Landau Equation Hierarchy
• Splitting Localized Structures
• Wave Equation with Piecewise-Constant Phase Velocities
• Local Induction Approximation
• Born-Infeld Wave Equation
• Peakon Trains
• Vibrations of a Square Koch Drum
• Weyl-Berry Law
• Diverging Gradients at Inner Corners
• Classical and Quantum Mechanical Treatment of a Duffing Oscillator
• Calculating Wigner Functions Through Fractional Fourier Transforms
• Sub-h/(2pi) Structures in the Wigner Function
• Circular Aperture Diffraction Integral
• Checking the Cauchy-Born Hypothesis
• Schwarz-Christoffel Map for Some Symmetric Polygons
• Normalized Banzhaf Indices for the European Union Countries
• Wave Propagation on a Torus Surface

### W.11 Additions to Chapter 2 of the Numerics Volume

• A Special Infinite Product of Cosines
• A Special pi-Related Continued Fraction
• Plots of the Argument of Cyclotomic Polynomials

### W.12 Additions to Chapter 1 of the Symbolics Volume

• Convergence Radius of the Virial Series for the Bose Gas
• MacMahon Master Theorem
• Differential Equation for Yablonskii-Vorob'ev Polynomials
• Implicit Polynomial Description of A Hypocycloidal Torus
• Calculating the Second Feigenbaum Constant
• Green's Function for a Sequence of Delta Function Potentials
• Implicit Form of Poynting Vector Equisurfaces
• Symmetrically Arranged Points on Spheres
• The Isospectral Polygons Bilby and Hawk
• Probability Distribution of a Quotient
• Vibrations of Springs on a Gosper Curve
• Probability Distribution for the Distance Between Two Points from the Unit Square
• Animation of the Nodal Lines of a Dirichlet-Neumann Boundary Conditions Transition
• Checking Higher Order Generalized WKB Approximation for the Harmonic Oscillator
• Evaluating an Iterated Integral
• The Kobussen-Leubner-Lopez Lagrangian for the Harmonic Oscillator

### W.13 Additions to Chapter 2 of the Symbolics Volume

• Eigenfunctions of the Hénon-Heiles Potential

### W.14 Additions to Chapter 3 of the Symbolics Volume

• Rational Values of the Gauss Hypergeometric Function
• Eigenfunctions of the Discrete Harmonic Oscillator
• Average Length of Smallest Component of Multidimensional Unit Vectors
• Differential Equation of the Jacobi Elliptic Function sn with Respect to the Modul
• A Certain Sum of Zeta Functions
• High-Order Series Expansion of Harmonic Numbers of a Given Size
• Movement of a Sliding Spinning Disk
• Identities of Jacobi Theta Function for Special Argument Values