diff --git a/calculus-derivatives-with-python.ipynb b/calculus-derivatives-with-python.ipynb index bfffcaa..65061cf 100644 --- a/calculus-derivatives-with-python.ipynb +++ b/calculus-derivatives-with-python.ipynb @@ -285,7 +285,12 @@ } ], "source": [ - "x = np.linspace(-5, 2, 1000)\n", + "x = np.linspace(-4, 2, 1000)\n" + "def f(x):\n", + " return -x**5 - 2*x**4 + 19*x**3 + 32*x**2 - 48*x", + "def df(x):\n", + " h = 0.000001\n", + " return (f(x + h) - f(x))/h" "plt.plot(x, f(x), label = '$f(x)$')\n", "plt.plot(x, df(x), label = '$f\\'(x)$')\n", "plt.axhline(color = 'black')\n",