Definition of derivative
In this worksheet we will use the definition of derivative (as limit of the quotient of differences) to compute the derivative of a simple polynomial. We also
make an animation showing that the secants (whose slopes are the quotients)
converge to the tangent of the graph of the function (and therefore the tangent
slope is the derivative of the function).
First of all, let’s recall some basic facts.
Given a function f(x) define on some interval (a,b). Let c, t1 , t2 be points
in the interval. We have
The average rate of change of f(x) on the interval [ t1 , t2 ] =
f(t2 )−f(t1 )
t2 −t1
If we take t1 = c and t2 = c + h then t2 − t1 = h. So that,
The average rate of change of f(x) on the interval [ c, c + h] =
f(c+h)−f(c)
h
If we let the interval [ c, c + h] shrink to one point c. That is, let h goes to
0. We have
The instantaneous rate of change of f(x) at c =f’(c)= limh→0
f(c+h)−f(c)
h
The value f ’(c) is called the derivative of f at c
f ’(c) is also the slope of the tangent to the graph of f at the point
(c,f(c))
Recall the equation of the line passing through the point ( x0 , y0 ) with
slope m:
y − y0 = m (x − x0 ) or y = y0 + m(x − x0 )
Therefore the equation of the tangent to the graph of f at the point
(c,f(c)) is the above equation with x0 = c, y0 = f(c) and m = f’(c).
1
Rate of change
Let’s consider the function
>
p:=t->2*t^2+3*t;
p := t → 2 t2 + 3 t
Let’s compute the average rate of change of p over the interval [1,3].
To do this, we compute
The change of the value of p(t)
>
change_in_p:=p(3)-p(1);
change in p := 22
>
change_in_t:=3-1;
change in t := 2
1
average_rate:=change_in_p/change_in_t;
average rate := 11
Now let h be any small number. The average rate of change of p on the
interval [1,1+h] is
>
average_rate:=(p(1+h)-p(1))/h;
2 (1 + h)2 − 2 + 3 h
average rate :=
h
>
simplify(average_rate);
7 + 2h
The instantaneous rate of change at t=1 will be the limit of the above
as h goes to 0
>
limit(average_rate,h=0);
7
>
We then say that p’(1)=7.
2
Tangent as limit of secant lines - A movie
Let’s consider a cubic polynomial
>
f:=x->x^3-3*x^2+2*x;
f := x → x3 − 3 x2 + 2 x
The quotient of differences at a point x is given by
>
q:=(x,h)->(f(x+h)-f(x))/h;
f(x + h) − f(x)
q := (x, h) →
h
That is,
>
q(x,h);
(x + h)3 − 3 (x + h)2 + 2 h − x3 + 3 x2
h
By definition, the derivative of f at x is the limit of this quotient as h goes
to 0. We enter it in Maple as a new function
>
derivative:=x->limit(q(x,h),h=0);
derivative := x → lim q(x, h)
h→0
That is,
>
derivative(x);
3 x2 + 2 − 6 x
To check this, let simplify the quotient q(x,h)
>
simplify(q(x,h));
3 x2 + 3 x h + h2 − 6 x − 3 h + 2
2
It’s clear that, as h goes to 0, the q(x,h) converge to derivative(x) given by
Maple.
We now look at the point A=(1,f(1)) on the graph (f(1)=0)
The tangent of f at the point A=(1,f(1)) on the graph is y = f(1)+slope at A (x−
1) ( slope at A = derivative(1))
>
tangent:=x->f(1)+derivative(1)*(x-1);
tangent := x → f(1) + derivative(1) (x − 1)
The secant passing through A with slope q(1,h) is given by
>
secant:=(x,h)->f(1)+q(1,h)*(x-1);
secant := (x, h) → f(1) + q(1, h) (x − 1)
In order to create an animation, we will make use of the command animation which is included in the package plots we then use the command with to
upload this package.
>
with(plots):
Create the animation which include the graphs of the function, the tangent
and the secants with varying h. We want to have 50 frames in the animation.
>
animate({f(x),tangent(x),secant(x,1/h) },x=0.5..2,h=2..50,color=red,frames=50);
3
Tangent
Consider the function
>
f:=x->2*x^4+6*x^3-8*x;
f := x → 2 x4 + 6 x3 − 8 x
3
whose graph looks like this
>
plot(f(x),x=-3..2, y=-4..5);
We want to write down the equation of the tangent at the point (-1,f(-1)) =
(-1,4).
Since we already know one point on the line, we need only to compute the
slope of the tangent. This slope is just the derivative of f at c=-1. This can be
done by using the power rule. Here, we use the command diff of Maple to get
the derivative at a general point x
>
diff(f(x),x);
8 x3 + 18 x2 − 8
We then substitue x=-1 to get the derivative at -1
>
subs(x=-1,%);
2
Therefore, the slope = 2 and the equation of the tangent is y = 4+2 (x−(−1))
= 2 x + 6. Let’s plot it with the graph of f .
>
plot({f(x), 2*x+6},x=-3..2, y=-4..5);
4
5
© Copyright 2026 Paperzz