Week 9 • Wednesday

Block 85: SymPy: Symbolic Mathematics

Define and manipulate mathematical symbols and expressions.

Concepts

Code Examples

See exercise below.

Exercise

Define x and y as symbols. Expand (x+y)^3. Factor x^2 - 5x + 6. Substitute x=2 into an expression and compare with numeric calculation.

Homework

What is the difference between symbolic computation and numerical computation? Give 2 examples of when each is preferred.