Ask Your Question
3

Graphing derivatives of implicitly given functions

asked 2011-01-29 10:10:11 -0600

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 15:10:27 -0600

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 06:58:03 -0600

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 03:13:06 -0600

mmarco gravatar image

updated 2011-02-03 03:27:46 -0600

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 10:52:21 -0600

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 10:10:11 -0600

Seen: 399 times

Last updated: Feb 03 '11