3 ms·
Hey you can do this w/ python too! <code> dx = .000001 def deriv(f): def fprime(x): return (f(x+dx) - f(x))/dx return fprime def cube(x): return x3 def
by elai 18y ago
Hey you can do this w/ python too!
<code>
dx = .000001
def deriv(f):
def fprime(x):
return (f(x+dx) - f(x))/dx
return fprime
def cube(x):
return x3
def printDeriv(x):
print (deriv(cube))(x)
print 3x*2
printDeriv(5)
</code>