1 | initial version |
Because of Sage prepersing, when you define f(x)=...
you define a symbolic function, where the x
is a symbol, not an element of the ring you just defined, see
sage: parent(f)
Callable function ring with argument x
If you want to stay in R
, you should define f
as follows:
sage: R = ZZ['x']
....: x = R.gen()
sage: f = 122313*x^23 + 445*x^12 + 2013*x + 2345
sage: parent(f)
Univariate Polynomial Ring in x over Integer Ring
Then you can define the derivative of f
directly as:
sage: h = f.derivative()
sage: h
2813199*x^22 + 5340*x^11 + 2013
and evauate it:
sage: h(5)
6707189083360107423888