Block 88: Plotting Mathematical Functions
Visualize symbolic and numeric functions together.
Concepts
- sympy.plotting.plot() for quick symbolic plots
- Converting symbolic expression to numpy function with lambdify()
- Plotting function and its derivative together
- Finding and marking critical points on plots
Code Examples
See exercise below.
Exercise
Plot f(x) = x^3 - 3x and its derivative f'(x) on the same axes. Mark local min/max. Use lambdify to convert a SymPy expression to a NumPy function for fast evaluation.
Homework
How does lambdify bridge the gap between symbolic math and numerical computation? Friday