Hi Valerio,
The above syntax, as innocent as it looks, implies a lot of things,
via Sage's preparser:
sage: preparse("L(a,x) = f(a)+sl(a)*(x-a)")
'__tmp__=var("a,x"); L = symbolic_expression(f(a)+sl(a)*(x-a)).function(a,x)'
So, what exactly is happening here? Two symbolic variables are
created, and a symbolic function is created, whose definition
on the *result* of evaluating f(a)+sl(a)*(x-a).
And since `a` is just a symbolic variable at that point, which evaluates
unequal to one, sl(a) returns a fraction:
sage: L(a,x) = f(a)+sl(a)*(x-a)
sage: L(a,x)
a^2 - (a^2 - 1)*(a - x)/(a - 1)
Apparently, inserting a=1 results in a division by zero.
Solution: Instead of invoking Sage's preparser and using a symbolic
function, just create a Python function, either like this:
sage: L = lambda a,x:f(a)+sl(a)*(x-a)
sage: L(1,x)
2*x - 1
or like this:
sage: def L(a,x): return f(a)+sl(a)*(x-a)
sage: L(1,x)
2*x - 1
Best regards,
Simon