Ask Your Question
0

How do I differentiate an implicit function in sagemath?

asked 2020-06-27 07:50:08 -0500

lolora gravatar image

I'm trying to differentiate an implicit expression

$x e^{y} = x -y$

This is my sagemath code

x = var('x')
f(x,y)= x*e**y - x + y
show(diff(f))

Sagemath Answer is $\left( x, y \right) \ {\mapsto} \ \left(e^{y} - 1,\,x e^{y} + 1\right)$

But the actual answer is $\frac{1 - e^{y}}{x e^{y} + 1}$

How do I get the actual answer using sagemath?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2020-06-27 20:01:51 -0500

Juanjo gravatar image

The code

x = var('x')
y = function("y")(x)
eq = x*e**y == x - y
dy = diff(y,x)
sol = solve(diff(eq), dy)
show(dy.subs(sol))

yields $$-\frac{e^{y\left(x\right)} - 1}{x e^{y\left(x\right)} + 1}$$ as expected

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: 2020-06-27 07:50:08 -0500

Seen: 76 times

Last updated: Jun 27