Mathew George
Mathew George

Reputation: 103

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=...)

Upvotes: 0

Views: 44

Answers (1)

Samuel Lelièvre
Samuel Lelièvre

Reputation: 3453

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?

Upvotes: 0

Related Questions