I would like to understand why this definition of the slope of the secant
line does not allow me to define the tangent line at a=1, even though it
works if I use it by itself:
f(x)=x^2
def sl(a):
if a!=1:
m=(f(a)-f(1))/(a-1)
else:
m=f.diff(x)(1)
return m
sl(1)
2
L(a,x)=f(a)+sl(a)*(x-a)
L(1,x)
ValueError: power::eval(): division by zero
Thank you for any help.
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.