Skip to content

Differentiation Basics

Differentiation measures how quickly a function changes at a given point. The analytical derivative is computed by applying standard calculus rules directly to the formula for f(x)f(x). Understanding the analytical result first gives us a reference value to measure how well our numerical methods perform.


The Power Rule

For a monomial c⋅xnc \cdot x^n, the derivative is given by:

ddx(c⋅xn)=n⋅c⋅xn−1\frac{d}{dx}(c \cdot x^n) = n \cdot c \cdot x^{n-1}

This rule applies term by term to any polynomial.

Example: Evaluating a Derivative at a Point

For f(x)=x3−4x+1f(x) = x^3 - 4x + 1, applying the power rule to each term gives:

f′(x)=3x2−4f'(x) = 3x^2 - 4

Evaluating at x=2x = 2:

f′(2)=3(2)2−4=12−4=8f'(2) = 3(2)^2 - 4 = 12 - 4 = 8


Geometric Meaning

The value f′(2)=8f'(2) = 8 is the slope of the tangent line to the curve at x=2x = 2. If we draw the tangent line at that exact point, its equation takes the form y=8x+cy = 8x + c for some constant cc. A large positive derivative means the function is rising steeply; a negative value would mean it is falling.

Graph showing a curve with its tangent line at x=2 having a slope of 8, alongside a secant line demonstrating the limit definition.

Geometrically, we can also think of the derivative as the limit of the slope of a secant line: a straight line connecting two nearby points on the curve (from xx to x+hx+h).

As the second point is brought closer to the first (meaning h→0h \to 0), the secant line rotates downward until it perfectly coincides with the tangent line. This visual rotation is exactly what the formal limit definition represents:

f′(x)=lim⁡h→0f(x+h)−f(x)hf'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}


Why Numerical Methods are Needed

Analytical differentiation works perfectly when f(x)f(x) is available as an explicit formula. In practice, that is not always possible:

  • f(x)f(x) is defined only by a table of measured data points, with no underlying formula.
  • f(x)f(x) is so complex that computing its derivative analytically is impractical.
  • The function is the output of a simulation or physical measurement.

In all of these cases, we use numerical differentiation: approximating the derivative using only a discrete set of function values f(xi)f(x_i). The key idea is that the secant slope between two points close to xx is a good approximation of the tangent slope at xx. The smaller the gap between the two points, the better the approximation.