Ask Your Question
1

How do you simplify the following expression in Sage?

asked 2024-12-27 22:02:47 +0100

mathew1794 gravatar image

updated 2024-12-28 11:27:02 +0100

tmonteil gravatar image

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

Plug in f(0) = b+c

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=...)
edit retag flag offensive close merge delete

Comments

You should tell us how you defined f, so that we can replicate the behaviour you obtain.

tmonteil gravatar imagetmonteil ( 2024-12-28 11:28:54 +0100 )edit
slelievre gravatar imageslelievre ( 2024-12-29 00:13:47 +0100 )edit

f is defined as

a=SR.var('a')
f=function('f')(a)

mathew1794 gravatar imagemathew1794 ( 2024-12-31 23:58:00 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2024-12-29 00:12:44 +0100

slelievre gravatar image

The problem could be with how f was defined.

In particular if it was defined as an expression rather than a function.

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

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

gives the following output

[D[0](f)(0) == 1/(b*c)]
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2024-12-27 22:02:47 +0100

Seen: 50 times

Last updated: Dec 29 '24