how to parse standard algebraic notation
Marco Buttu
marco.buttu at gmail.com
Wed Oct 1 14:26:26 CEST 2014
On 01/10/2014 09:01, math math wrote:
> What would be a good starting strategy for writing a program to take the derivative of a polynomial expression, such as this below?:
> "x**3 + x**2 + x + 1"
You can look at sympy:
>>> from sympy import *
>>> equation = simplify("x**3 + x**2 + x + 1")
>>> equation
x**3 + x**2 + x + 1
>>> diff(equation)
3*x**2 + 2*x + 1
--
Marco Buttu
More information about the Python-list
mailing list