Search code examples
pythonsymbolic-mathsage

How do you simplify the following expression in Sage?


By differentiating a function at 0, I got the following equation in Sage.

(b - f(0))*(c - f(0))*D[0](f)(0) - 1 == 0

How do I make Sage

  1. Plug in f(0) = b+c

  2. Simplify and solve for D[0](f)(0)?

I tried

equation = (b - f(0))*(c - f(0))*D[0](f)(0) - 1 == 0
new_equation = equation.subs({f(0): b+c})
solve(new_equation, D[0](f)(0))

I get the following error

Substitution using function-call syntax and unnamed arguments has been removed. You can use named arguments instead, like EXPR(x=..., y=...)

Solution

  • Be it with SageMath 10.2 or SageMath 10.4, the following input

    b, c = SR.var('b, c')
    f = function('f')
    equation = (b - f(0))*(c - f(0))*D[0](f)(0) - 1 == 0
    new_equation = equation.subs({f(0): b + c})
    solve(new_equation, D[0](f)(0))
    

    gives the following output

    [D[0](f)(0) == 1/(b*c)]
    

    What version of SageMath are you having trouble with?