Ask Your Question
3

Graphing derivatives of implicitly given functions

asked 2011-01-29 17:10:11 +0100

Sorry if this is too elementary.

I want to graph the derivative of a function y that is given implicitly as a function of x. I would appreciate any suggestions.

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
1

answered 2011-01-29 22:10:27 +0100

kcrisman gravatar image

Unfortunately, this is pretty hard to do in Sage. Even this attempt (eventually) fails:

sage: y = function('y',x)
sage: f = y*x==1; f
x*y(x) == 1
sage: f.derivative(x)
x*D[0](y)(x) + y(x) == 0
sage: g = f.derivative(x)
sage: g.operands()[0].operands()[0].operands()[1]
D[0](y)(x)
sage: h = g.solve(g.operands()[0].operands()[0].operands()[1])[0]; h
D[0](y)(x) == -y(x)/x
sage: implicit_plot(h.rhs(),(x,-1,1),(y,-1,1))
<boom>

I don't know that this is easy to fix in general, either, because of course derivatives in implicit functions can be arbitrarily complicated to solve for, and so not necessarily accessible to a computer method. I don't think there are any numerical methods for doing this.

edit flag offensive delete link more
2

answered 2011-01-30 13:58:03 +0100

niles gravatar image

Surely there is a way to do this numerically, isn't there? What I mean is that one should be able to write a function which, for a given numerical value of x, solves the implicit equation to find the value of the derivative at x -- using find_root, perhaps. And then one ought to be able to plot this function.

Of course this won't work for every implicitly defined function, but sage's numerics should work for a lot of cases that users actually want.

But I don't know enough about sage symbolics to actually do this. Any takers?

edit flag offensive delete link more
1

answered 2011-02-03 10:13:06 +0100

mmarco gravatar image

updated 2011-02-03 10:27:46 +0100

You can try this:

y=function('y',x) 
var('x,yy,z')
f=x*y+x^2-y^3*x
ff=f.diff(x).subs({y.diff(x):z,y:yy})
implicit_plot3d(ff,(x,-3,3),(yy,-3,3),(z,-4,4))

This way you avoid the "solve" issue.

edit flag offensive delete link more
0

answered 2011-01-29 17:52:21 +0100

Shashank gravatar image

I am not sure whether this is what you are looking for

y(x)=sin(x)
plot(diff(sin(x),x),(x,0,pi))
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

Stats

Asked: 2011-01-29 17:10:11 +0100

Seen: 969 times

Last updated: Feb 03 '11