liveBook · Manning

Symbolic mathematics

As explained in Geometry for Programmers

Symbolic mathematics is the manipulation and solution of mathematical expressions in terms of symbols rather than only numerical values.

Symbolic mathematics manipulates equations using named quantities instead of only fixed numbers. With SymPy, you define symbols, provide equations, and ask a solver to return numerical or general results. section 1.6

Two trains, one system of equations

Represent the train problem with Va + Vp = 450 and Vp = 2Va. SymPy returns Va = 150 and Vp = 300. Replacing the numbers with D, t, and Vpx produces formulas for the general case. section 1.6

Listing 1.2 Symbolic solution in SymPy
from sympy import *
 
Va, Vp, Vpx, D, t = symbols('Va Vp Vpx D t')   #1
 
solution = solve([
    Vp - Va * Vpx,
    Va * t + Vp * t - D
], (Va, Vp))
 
print(solution)

Inspect the SymPy listing that solves the generalized train equations symbolically. section 1.6

How Geometry for Programmers covers it

How deep it goes
Explains equation setup, numerical and symbolic solving, and Python or LaTeX output, but does not develop computer-algebra internals.
Examples
Uses a two-train word problem, linear equation systems, generalized variables, and SymPy listings.
What it assumes
Uses a word problem translated into equations and introduces symbol declaration and solving through a Python module.
What you can do after
Apply it via SymPy to solve numerical or generalized systems of equations and produce Python or LaTeX representations.
How it connects
Connects symbolic mathematics with computer algebra, algebra systems, Python modules, equations, and code or LaTeX generation.

This explainer was generated by Manning's knowledge graph from the text of Geometry for Programmers. The section links point to the parts of the book it draws on.