Creating and Manipulating Symbolic Expressions in Python
Author: David Manuel
In this video, it is shown how to create a symbolic expression in Python with a variable, and then how to factor, expand, and simplify the expression. It is also shown how to evaluate the expression by substituting a value for the variable.
Transcript 03
Transcript 03
Exercises
Python Code:
from sympy import *
x=symbols('x')
f=x**4+5*x**3+8*x**2+x-15
print(f.factor())
f_factor=f.factor()
print(f_factor.expand())
g=f/(x**2-1)
print(g.simplify())
print(g.subs(x,1))
print(g.simplify().subs(x,1))
Open Python Notebook File
Related Videos (200)
Cases for Partial Fraction Decomposition
Explaining all four cases of partial fraction decomposition
MATH 140 5.3 Exercise 1
Finding the domain, intercepts, asymptotes, and holes of a rational function
MATH 140 5.3 Exercise 2
Finding the domain, intercepts, asymptotes, and holes of a rational function
