# Graphing derivatives of implicitly given functions

 3 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. asked Jan 29 '11 Andres Caicedo 37 ● 1 ● 6 http://andrescaicedo.word...

 1 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))  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. posted Jan 29 '11 kcrisman 6639 ● 13 ● 66 ● 150
 2 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? posted Jan 30 '11 niles 3354 ● 5 ● 38 ● 92 http://nilesjohnson.net/
 1 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. posted Feb 03 '11 mmarco 191 ● 6 ● 12
 0 I am not sure whether this is what you are looking for y(x)=sin(x) plot(diff(sin(x),x),(x,0,pi))  posted Jan 29 '11 Shashank 1570 ● 5 ● 22 ● 55

[hide preview]

## Stats:

Seen: 228 times

Last updated: Feb 03 '11