Answers for "differentate derivative differentation"

0

differentate derivative differentation

# function wrt to differentate
def cu(x):
    return x*x*x

# differentation function
# Slightly increase x and compute the result. 
# Then compute the ratio of change in result with change in x
def diff(fun, x):
    delta = 0.000000001
    y = fun(x)
    x1 = x+delta
    y1 = fun(x1)
    return (y1-y) / (x1-x)

# X^3 = 3X^2
diff(cu,2)
# >>12.0
Posted by: Guest on August-21-2021

Code answers related to "differentate derivative differentation"

Python Answers by Framework

Browse Popular Code Answers by Language