Neuron 101

Math foundations / Derivative

Türkçe

Plate7

Unit 1 · Topic 7 of 11

Derivative

Medium, 7 min, 9 steps

Keyboard: left and right arrows change the step, space plays and pauses.

Step 1 of 9 Curve

A curve that rises and falls

In some places the curve rises and in others it falls. We want to measure how fast it rises at one point.

Open in Colab
  1. import math
  2. def f(x):
  3. return 4 + 2.2 * math.sin(1.1 * x)
  4. x = 2.0
  5. h = 1.5
  6. for _ in range(4):
  7. egim = (f(x + h) - f(x)) / h
  8. print(h, egim)
  9. h = h / 2
x
2
h
1.50
kesenEgim
−2.14
turev
−1.42