# The Difference Quotient (Find It and Use It)

(D4M) — Here is the video transcript for this video.

00:00
in this episode you’ll learn what the difference quotient is and how to find
it let’s do some math [Music] hi everyone um welcome back um let’s get
started here by talking about um what the difference quotient is
and so we’re going to need a function so
we’re going to talk about the difference quotient of a function
and we we’re going to look at this ratio
right here this is called the difference quotient
of course we’re going to be dividing by some h so h is not zero so h can be any
real number except zero and this expression right here is called
the difference quotient and so we’re going to work on a couple
things we’re going to work on how to find it by hand and we’re going to work
on how to find it by computer and then stick around to the end where we explain

00:01
where this comes from and why it’s important and you know how to use it
so let’s get started what is the difference quotient um now
when we look at this right here what we’re going to say is um because you
know this is words uh i also like us to have a um graphical representation of it
so let’s say we have a function that’s coming through here like this
and so we have a function and we need an x and an h to look at
over here so i’m going to put down let’s say i want to look right here
and here’s an x and when i’m looking at this age here i’m
thinking about um h as being a little bit of a change so some people will use
an h some people use a delta x um you know that’s different notation like
you could have a delta x and a delta x there but it’s common to use an h

00:02
but when i’m looking at this h here i’m thinking about here
h could be any real number but um intuitively i’d like to think about h
as being some small little distance right here and we’ll explain why at the
end so this right here is this tick mark right here is x plus h
so h is this little distance right here it’s it’s um you know not zero
and so now we’ll come up here and we’ll have an output value right here so we
have an output right here and we have an output right here
and so this point right here is x f of x for the height
and this point right here is x plus h and then f of x plus h to get the output
so there’s this two points right there and so if we were to say look at the line
between those two points right given any two points we have a line so we have a
line going through here and we can ask what is the slope of this line right

00:03
here so the slope of this line will be you know rise over run so subtract the
y’s so f of x plus h minus f of x and then all over and then now subtract
the x’s so x plus h that one right there minus that x
and so yeah if we just simplify this this numerator here
is the difference of the uh y values the heights the outputs
and in the denominator here we just get an h
and so that is the difference quotient right there so
but let’s practice uh working on how to work all this out and
get an understanding of how to do that and then we’ll come back and and
understand this a little bit some more all right so here we go
find the difference quotient for each of the following
so um now before i get started though i wanted to mention that this episode is

00:04
part of the series functions and their graphs step-by-step tutorials for
beginners and so check out that series uh the link is
below in the description and um hope you follow along with the complete series
and so we in the series we’ve already talked about what functions are and how
to evaluate them all right so here we go here’s the first one right
here so here’s our function right here it’s a quadratic or it’s a polynomial
and we’re going to work out this difference quotient for this function
right here so here we go so we have the f of x plus h minus f of x all over h
and that’s going to be equal to all right so now the first thing is um you
know keep in mind that this is a difference of two things here so we need
to find the first thing minus and then we need to find that right there
so in the numerator here i’m gonna have the difference between two things

00:05
right so this is a difference of two things this one right here this all this
right here goes here and then minus and then f of x that goes right here and
then and this will be all over h so first i need to find out what this right
here is so this means plug in x plus h into here so i need to plug in x plus h
so i need an x plus h here and i need an x plus h here
and we’re going to put all of that right there
and then we’re going to say minus sign and then this part right here is easy
because it just means plug in x well this is already plugged in next so that
part would be there easy all right so i just wanted to give you the good
understanding right here so let’s plug in x plus h here
so this will be x plus h squared and then minus four times x plus h
and n plus seven and so let’s put brackets around all that
and now we have our minus sign and then we have times f of x sorry minus f of x

00:06
so f of x here is x squared minus four x plus seven
and then all of that divided by h so there’s the difference quotient
of course you always want to simplify your answer let’s multiply this out so
this will be x squared plus 2 x h plus h squared
and then let’s multiply by minus four so minus four x minus four h plus seven
and then now let’s distribute the minus sign
so minus x squared plus four x minus seven and then this is all over h still
all right very good so now let’s combine like terms so the x
squares here i’ll use a little color here so the x squares here match up to give
us 0 x squares how many x’s do we have so here we have

00:07
this one has an x this one has an x and this one here has an x and actually this
minus 4x and the positive 4x also add up to 0 so we’re going to just
write down here [Music] 2xh all right and now what about the things
that have no x’s in them right so i looked at all the x squares i looked at
all the x’s now let’s look at things that don’t have any x’s at all in them
so we have an h squared and we have a minus 4h and then we have a seven
and the minus seven over here those two add up to zero so we end up with
h squared plus an h squared and then minus four h here and then all over h
the sevenths add up to zero alright so there we go so now we can
all these things have an h here so i’m going to factor out an h so i’m going to

00:08
have 2x and then we still got an h left and we have a minus 4
and then all over h and then now the h’s will cancel
and so we’re going to get 2x plus h minus 4. very good
so there’s the difference quotient simplified
so as you can see the majority of the work is in simplification here and let’s
just get rid of those things there which just kind of helped us
not make a mistake all right so there we go
there’s our first difference quotient right there
so let’s work on another example now excuse me all right so here we go let me
get rid of this so here’s another quadratic um but this
time it’s upside down if you were to graph it it’s um
so let’s look at the difference question again so f of x plus h minus f of x

00:09
all over h and so i’m going to plug in an x plus h
here and an x plus h here also so this will be 5 times x plus h minus
x plus h squared so all that’s just for this part right
here and i have a minus sign and then minus f of x and so all of this
is f of x so 5x minus x squared all over h so here is f of x plus h
minus and here’s f of x so we did the difference quotient right here
just by substituting it in and now most of the work is by simplification
i’m going to distribute the 5x here uh the 5 here so 5x plus 5h and then
so we have to square this out but we also have a minus sign in front of it

00:10
so x plus h squared is x squared plus 2xh plus h squared but we have a minus
in front of that x plus h squared so i’m
going to need to multiply all of this by minus
so i’m going to get minus x squared minus 2xh minus h squared okay
so that’s for this part right here and then we have minus 5x
and then we have minus minus so we have a positive x squared and then all that
is over h all right very good so we expanded that out and now we’re going to
figure out so here’s a 5x and here’s a minus 5x so those cancel out
here’s an x squared and here’s an x squared and they cancel
out when i say cancel out what i really mean is they add up to zero right so
they add up to zero so what do we got left here we have a five five h
and then a minus two x h and then a minus h squared and then those uh

00:11
added up to zero with something else right there we go so
now we can factor out an h now in the last one i did uh we factored out an h
and then we canceled but it’s probably easier just to look right h h
and then h squared right so if we cancel an h from everything we’re going to get
a 5 minus 2x and then minus h and then there’s the difference quotient
there so i skipped the last step um yeah so i’ll just do it real quick 5
minus 2x minus h over h and then we cancel the h’s i think if
you do enough of these you start wanting to you know simplify your
simplification all right so there’s the difference quotient right there
and yeah let’s do another one here we go so let’s look at a cubic now
so for this cubic here we’re going to need to know what x plus h to the third is

00:12
so here we go x plus h minus f of x all over h
and now we’re going to simplify this hopefully this will be enough room here
in fact i’m just going to maybe skip right down here just to make sure i have
enough room here but i need to actually it’s the next step where i need to
simplify where i need more more space here so i’m going to just go x plus h to
the third and then plus three x plus h all right so that’s just this part right
here i plugged in x plus h in so i have x plus h to the third plus three times x
plus h and then minus and then now minus f of x and so that’s
just f of x right there so x to the third plus 3x and then all over h
all right so very good so [Music] all right so

00:13
yeah make sure you put parentheses around all of this because otherwise
there’s a good way to miss something and and he’s it needs to be there right
so now we need to do x plus h to the third right
um so if we do x plus h squared we’re going to get x squared plus 2xh plus h
squared if we do x plus h again this will be x plus h times x plus h squared
which we just found is x plus h right so squared
uh hopefully you know that one already so to the third we just multiply one
more times the two that we already know and so here’s the two that we already
know the x plus h squared so we need to multiply x times each of
these and then h times each of these and you know we’re going to get a lot of

00:14
stuff here but probably here’s a better way so
we can do the triangle right here this is just pascal’s triangle let me move it
so you can see it so i’m just adding these two and i’m
adding these two and i get ones here right so x plus h to the third
if you were to multiply it out and expand it and simplify it
you would get x to the third plus three x squared h plus three
x h squared plus and then the last one will be h to the third
so notice the total power on all of them is three
three and then a square and a one and then a one and a squared and then a
third and the coefficients are one three three one if you were to expand out x
plus h to the fourth then you would use one four six four one
you would use that right there so in any case

00:15
um yeah if you were to expand out x plus h to the fourth
uh you could do that pretty quickly just using this row right here of of the
pascal triangle but in any case let’s go back to our problem right here
so i didn’t i didn’t want to lose anybody here
so this will be x to the third plus three x squared h
plus three x h squared plus h to the third and then now
this part right here we’re going to multiply out the threes
and now minus sign towards each one of them all right very good
all right and so now let’s look at the terms that match up
so these two add up to zero and let’s see what else the three x’s also
add up to zero so let’s see what we’re gonna get from all of that

00:16
we’re going to get a 3 x squared h plus 3 x h squared plus an h to the third
and then plus another 3h right here and that’s all of them one two three
four and then all over h and now all the ones in the numerator
have an h in them so we could factor it out and cancel i’ll skip that step and
just say three x 3x squared so that h canceled out
plus 3x and then one of these x h is cancelled out so we have one left
and then one canceled out here so we have an h squared
and this h canceled with this h so then we just have plus three
and so there is the difference quotient right there simplified so [Music]
yeah that looks good there’s our difference quotient right there and
so i’m going to show us how to solve all
these by using a computer in a moment so

00:17
but let’s do one more let’s do 1 over an x square just to see something a little
bit different here so let me erase this real quick
all right here we go difference quotient f of x plus h minus f of x all over h
now i’m gonna sorry now i’m gonna substitute x plus h into here so i have
1 over x plus h squared minus minus signs coming from right there minus f of x
all right so there’s f of x plus h minus f of x and then all that’s over h
all right very good so now what i’m going to do is try to
combine these together because right now they do not have a common denominator
so instead of writing divided by h i’m just going to put over here divided by h

00:18
just to make it be more streamlined all right so i’m going to try to get a
common denominator here so i’m going to multiply top and bottom by x squared
and top and bottom by x plus h squared so here i’m going to get x squared over
x squared times x plus h squared minus and then here i’m going to
multiply numerator and denominator by x plus h squared over x plus h squared
so this will give me x plus h squared over x squared times x plus h squared
and then all that is still divided by h all right so this just allows me to have
common denominator now so the common denominator will be x squared and then
we have x plus h squared and so what will be this numerator right
here where we have an x squared minus and then now we have an x plus h squared
here and so i’m going to put parentheses and

00:19
i’m going to go ahead and square that out so it’s x squared
plus 2xh plus h squared and then all this is still divided by h
all right so good so we just expanded that out and we just said x squared minus
all right so here we go in fact actually
well i guess i’ll do it on the next step so here we go we got x squared and then
minus all of this so minus x squared minus 2xh plus h squared all over h
times x squared times x plus h squared so notice how i move this uh
8 divided by h into divided by 8 here so that’s a good way to do that there
so now the x squares here add up to zero and there’s an h down here and they’re
going to cancel with these h’s in here so what we’re going to end up with here

00:20
is in the denominator we’re still going to end up with an x square h x squared
x plus h squared and what are we going to end up with in
the numerator so those add up to 0. so this h is going to cancel with that h
and we’re going to get minus 2x and this h is going to cancel one of
these h’s and so we’re going to get plus h and so there we go right there
with just enough room right in there to finish that off so there’s the
difference quotient and it’s simplified for us so yeah that looks great
so um let’s see here do we have one more for us
yep let’s do one with a square root actually so
i hope you like that let me know in the comments below and
you know i wanted to do one with reciprocal in it but let’s also do one

00:21
with a square root in it so let me get rid of this here first here we go
all right so if we have something like a
square root here we’re going to probably need to do something like
rationalization so here we go uh difference quotient x plus h
minus f of x all over h and now let’s plug in an x plus h here
so i’m going to get square root of 5 times the input which is x plus h minus
and then square root of 5x and then all over h are very good
there’s the difference quotient right there
um but maybe we can try to simplify it a little bit let’s see what happens if we
try to simplify it um and see if anything happens interesting
um so let’s try to rationalize it so let’s go with 5 x plus h minus
all right so let’s just keep the same thing

00:22
and then we’re going to multiply by 5 x plus h plus square root of 5x
right so i didn’t change anything here on this
right that’s exactly the same thing here but i’m going to multiply
numerator and denominator by the same thing the conjugate right
so i’m looking at that minus sign and i change it to positive and i do numerator
with this one i changed into that over that the same thing over the same thing
so it’s still a one but we’re going to try to rationalize here
and see if anything nice happens so now we can expand the numerator out
so i’m going to have square root of this times the square root of the same thing
so it’s going to be 5 times x plus h and now and this is why we chose the

00:23
conjugate because the mixed terms are going to cancel out we’re going to have a
square root of 5 x plus h times square root of 5x
and that’s going to be with a positive sign
and then we’re going to multiply these two out but it’s going to have a
negative sign so those two mixed terms there in the middle are going to add up
to zero so it in and then we’re going to have this one times this one
and it’s got a minus so it’ll be minus and then it’s the same thing here so
minus 5x all over and then we have h times all of this
right here so it’s very important to put parentheses right here so parentheses
um 5 x plus h and then plus square root of 5x
so let’s just make sure we have these parentheses right in here
h times all of this so h times all of this right here all right very good

00:24
now when i expand this 5 out 5 times x plus 5 times h
what happens to the five x’s right the five x’s add up to zero
so we’re gonna get a five h here so we’re gonna get a five h and then h
times all of this stuff here so because this is a lot to write it’s natural to
want to take as many steps as you can in your head without writing all this down
so i distributed the 5 and said 5x minus 5x that adds up to 0 so we’re gonna get
five times h on the top and then now we see the h’s cancel
so the h is cancelled so in fact i’m just gonna cancel them like that with my
hand right there so the h’s were here but then i cancel them and so now we’re
done and you might say well which one is better this one or this one up here
this one the numerator is um you know got square roots and this

00:25
one right here is the denominator that has square roots so
um but this one has an h in it here and this one just has a five so in some
sense or another let’s say this one is simplified here
um if you had to say plug in an h right because h can be any non-real
non zero real number and if i had to plug in h well you only
have to plug it in here one time whereas here you have to plug it in here
but then you also have to divide by it so this one is definitely simpler
so let’s let’s say this is our simplified version
but in all these examples so far that we’ve done
finding the difference quotient that’s the first step
it’s in the simplification that you know the algebra part that is the
funnest part well what however you think about it
in any case let’s see how to uh do these by

00:26
computer now and so i’m going to use the python programming language now in the
description below you can find the link to a python notebook if you’ve
never used python before and so you’ll be able to use that link and to get
started right away right now and you can follow along
and so here we go let’s zoom in on this right here
so you want to open up your python notebook whether it’s on your computer
or you’re using the free one by google the first thing i’m going to do is
import sorry yeah i want to import and um
so this is senpai and we’re going to use some stuff from here
so just type in this right here and then we want to um move our cursor into that
cell and hit shift enter and we’re going to define some symbols
right so from the five examples that we’ve done so far we used an x and an h
so i want to define those as symbols and now in order to do the difference

00:27
quotient i’m going to make up this function right here so let me move out
of the way right here so let’s see here yeah so
this function here is let me uh yeah there we go so this function i’m calling
dq for difference quotient and it’s going to take as an input a function
and so what we’re going to do is just some things right here simplify and
expand and we’re going to use them because they’re already built into this
package right here the senpai package right here very powerful
very useful this is one of the things why people like python so much
is because there’s so many different packages out there ready to use so we’re
going to input a function and in that function we’re going to
input an x plus h into that function minus and then we’re going to input an x
into that function and we’re going to expand all that out
and we’re going to divide it by h and then we’re going to simplify all
that right there so i won’t say that this is going to
find the difference quotient for every function it certainly will not

00:28
but for a large number of examples i think this will be a very good function
to work with it’ll certainly work with the examples that we used before
so we’re going to find the difference quotient right here for each of the
following and so this is the first one we did
so this right here will work for all polynomial functions right here at least um
you know depending upon your computer and processor and how fast it works
but just for small powers like square cubics fourth degrees it’ll work just fine
all right so here we go we’re going to input here’s our first example so first
is i want to define a function so this is number one and i like to call my
functions little f so i’m going to use f1 here it’s going to have a variable x
and i’m going to return an x squared and then a minus 4x and then a plus 7. so
let’s enter that in right there you don’t need to enter all this in here but we
definitely want to input this right here and now we can go and find the

00:29
difference quotient of it and so if we put this right here it outputs the
difference quotient right here and this is what we found in our first example so
it expanded everything and it simplified everything and it just gives you the
output now it may have rearranged the terms on us because i think when we did
ours we had 2x plus h minus 4. so it doesn’t matter
which way you write the the terms there it’s still the same difference quotient
right there all right so now let’s look at our
second example we did 5x minus x squared so for example number two i’m going to
say f2 is my this is the name of my function
so let’s enter that in so this is going to be 5 times x minus the x squared
and then to find the difference quotient i’ll just type in
difference quotient of f2 and then hit shift enter and then we get the
difference quotient it’s pretty fast all right so now for our cubic

00:30
so we’re going to enter in here for our function x to the third plus 3x
and so let’s enter that function in and then now let’s find the difference
quotient of that function right here so hit shift enter and i get the output
really fast very nice very very nice so let’s check out one over x squared
we had to get a common denominator we had to do some stuff in there
so let’s in input definition f4 for our function f4 so it’s one over and then x
squared i like to put in parenthesis to make mine very readable um
in any case let’s find the difference quotient of f4 and there it is right there
so it expanded out the x plus h so i think we had something like
minus 2x plus h over x squared x plus h squared so it expanded that out for us
which is okay you know that’s not bad um
but it did cancel the h’s it did all the

00:31
work and it just brought this minus sign down in front um
well we would have to have a minus 8 here and so it brought a minus sign down
here 2x plus h over x squared x plus h squared
so if you want to write it like this or if you want to write it like that
either way all right so now let’s try out the square root one
and so we’re going to enter the function square root of 5x
and now let’s find the difference quotient here and here it didn’t
rationalize for us it just um you know wrote out the difference quotient here
so it didn’t rationalize for us now i will say this though when you’re
rationalizing that’s more for people to say
um it looks nice for humans for people for example if i have 1 over square root
of 2 which is nicer this number or this number right here square root of 2 over

00:32

1. which number is nicer well if i multiply by one and change that one
into a square rooted two over square root of two
then i get one times square root of two and i get square root of 2 times square
root of 2 in other words square root of 4 in other words 2.
so in other words these two numbers are the same
and you might say which one looks nicer this one or this one well
historically this number is a much nicer number to to work with
but in terms of using calculators or machines this number is just as nice
the reason why this one number is nice historically is for example i know what
this is off the top of my head it’s about 1.404 something like that
and if i want to take half of that so i know that this number right here
just off the top of my head is approximately 0.7

00:33
something so i can get an estimate for this number right here pretty quickly
whereas off the top of my head it would be much more difficult to know this
approximately unless i worked at this first so for
example take that to the extreme or not extreme but just another example [Music]
i don’t know this one here is off the top of my head
um but and i don’t know either one of these are off the top of my head
approximately but if i wanted to go use a computer to
give me approximation entering either one of these would just be just as easy
in fact just a key for your reciprocal so in fact entering it onto a machine
could be this one could be just as easy so the point is is that even though this
doesn’t give us rationalization this is still actually very productive
all right long story short right okay so now let’s go back to now that we

00:34
did those five examples again now let’s go back to um looking at the um
the importance of the difference quotient here here right and so what was
the difference quotient again f of x plus h minus f of x all over h
so um let’s uh remember what the slope formula is right so if we have here the
function coming through here like this and we have an x
and we have an x plus h so this distance right here is a is an h
and so this mark right here is x plus h and we have a height we have a height
and we can talk about the slope of the line through there so
you know the slope will be well we need the y’s and we need the x’s right so
what will these two points here be so this this point right here will be x

00:35
f of x and this point right here will be uh
sorry i wasn’t watching what i was doing i kind of messed it up sorry
uh let’s start again so this time let’s just look at something that just does
this right here there’s our f and here’s our x and here’s our x plus h
and so we got this small little distance in here let’s make it in blue
and that distance is an h so this is x and then this is x plus h
and now we can go up here and calculate a height and we can go up here and
calculate a height so this height will be f of f of x plus
h this height right here will be f of x right there
so we can write the coordinates for this point out here
let’s see if we can do it in red so this will be the point here x plus h

00:36
minus uh sorry f of x plus h so there’s that point right there
and this point right here is x f of x so if we wanted to find the slope of the
line going through those two points so the slope is m is
subtract the y values f of x plus h minus f of x all over
and now subtract the x’s x plus h minus x and we see the x’s here
add up to zero and we just get an h right there
so the slope of the secant line is the difference quotient
now if we want to take a different approach or a different um
yeah a different approach um let’s call this here instead an a and b
so i’ll do this over here and i’ll try to use the same

00:37
sketch here roughly so let’s call this here an a
and let’s call this right here b and so now this height right here will be
f of a and this height right here will be f of b
and so what will be the slope through those lines right there slope through
that line right there so the slope will be f of b minus f of a
all over b minus a so we’re going to talk in the next episode
what the average value of a function is so this will be average value of f over
the interval a b so this is the average value of f of the
function f over the interval a b and this is the difference quotient
which is what we’re covering today the difference quotient right here now

00:38
what’s the difference well here a and b can be anything
except they’re not equal to each other here h can be anything h is not zero
though but it’s really this the way that we’re thinking about things so
here h is i’m thinking about things um technically edgy can be anything
non-zero but the way that we’re going to use the
difference quotient when you get to calculus is h is going to represent a
small little change a small little change so you’ll want to think about h
going to zero and what you’ll think about is is as h gets smaller and smaller
these secant lines here will actually eventually become a tangent line
and when you get the tangent line you’ll be taking a limit and so that part
you’ll see in calculus one so for right now we’ll just say that
this is the average value and we’ll see some
importance of the average value in the next episode but the difference quotient

00:39
is is pretty much coming from the same thing it’s just a slightly different way
of thinking about things and the way that we’re going to think of the reason
why we’re going to think about things like this is because we get to calculus
we’re going to be able to talk about and define the derivative of a function
which has a tremendous number of applications so by looking at the uh two
different ways of thinking about things how about has h is going to zero and so
we’re thinking about things as a process
in other words doing things repetitively what happens uh here’s the difference
quotient when h is like .01 or what happens when h is point zero
zero zero one so if you find the difference quotient for any h
then you can do something with those h’s you can look at some behavior what
happens when h’s do this this and this whereas over here the a and b is just an
interval here and we’re just looking at the average value

00:40
and so this is more like a static um view of things whereas in cactus 1 we’ll
take this and make this more dynamic that’s one way to look at things
of course you can always uh make this dynamic also by looking at what happens
when b approaches a and so we can also actually use this
right here to make the definition of the derivative but in either case um
it has a lot to do with the slope of the line and finding the tangent line which
again is something that you’ll do in calculus so i hope you enjoyed this
video and i look forward to seeing you in the next episode
if you enjoyed this video please like and subscribe to my channel and click
the bell icon to get new video updates