Block 86: SymPy: Calculus
Perform differentiation and integration symbolically.
Concepts
- diff(expr, var) for derivatives
- integrate(expr, var) and definite integrals
- Higher-order derivatives
- Limits: limit(expr, var, point)
Code Examples
See exercise below.
Exercise
Compute the derivative of x^3 + 2x^2 - 5x + 1. Find critical points. Compute the definite integral of x^2 from 0 to 3 symbolically. Verify with scipy.
Homework
Find the symbolic second derivative of sin(x) * exp(x). Simplify the result. Thursday