Overview of Key Python Commands in MATH 151
(Alphabetical with newest commands first)
Command
Summary
Online Documentation
integrate
Integrate a function
https://docs.sympy.org/latest/tutorial/calculus.html#integrals
apart()
Decomposes a large fraction into a sum of smaller fractions.
https://docs.sympy.org/latest/tutorial/simplification.html#apart
diff()
Differentiate an expression
https://docs.sympy.org/latest/tutorial/calculus.html#derivatives
.evalf()
Evaluate to floating point
https://docs.sympy.org/latest/tutorial/basic_operations.html#evalf
.extend
Combine graphs into one figure
https://docs.sympy.org/latest/modules/plotting.html#sympy.plotting.plot.Plot.extend
for (List comprehension)
Perform the same operation on a list of values.
https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions
nsolve()
Numerically solve an equation given an initial guess
https://docs.sympy.org/latest/modules/solvers/solvers.html (NOTE: Use Ctrl-F to find the nsolve syntax and examples as they are far down the page.)
plot()
Plot a function.
https://docs.sympy.org/latest/modules/plotting.html#plotting-function-reference
plot_parametric()
Plot a parametrized curve.
print()
Display variable values and text output
https://docs.python.org/3/library/functions.html#print
simplify()
Simplify an algebraic expression.
https://docs.sympy.org/latest/tutorial/simplification.html#simplify
subs()
Substitute value(s) into an expression.
https://docs.sympy.org/latest/tutorial/basic_operations.html#substitution
symbols()
Defines a variable to be symbolic.
https://docs.sympy.org/latest/tutorial/intro.html#a-more-interesting-example
Trig
List of Trig and Inverse Trig Functions
https://docs.scipy.org/doc/numpy/reference/routines.math.html