Here is the cheatsheet in Markdown format:
Operation | MATLAB | Python/SymPy |
---|---|---|
Define symbolic variable | syms x |
x = symbols('x') |
ex: syms x y z |
ex: x, y, z = symbols('x y z') |
|
Differentiation | diff(f) |
f.diff() |
ex: diff(sin(x)) |
ex: sin(x).diff() |
|
Partial differentiation | diff(f,n) |
f.diff(x,n) |
ex: diff(f(x,y),2,1) |
ex: f(x,y).diff(x,2).diff(y) |