~/imallett (Ian Mallett)

Introduction to Basic Calculus

by Ian Mallett

Disclaimer: I wrote this at stupid-'o-clock in the morning, so I might do something stupid like calculate \(1+1=fish\).

This is an introduction to the basics of Calculus taught using my personal perspective on how to teach Calculus. Prerequisite is Algebra (as in algebraic manipulation). If you can solve a small linear system and plot easy functions by hand, you're in good shape. This is meant to be a practical guide to the issues, not a textbook. There's very little theory and no exercises. To gain true competency, you must supplement this by solving similar and real-world problems. I will give an overview of the topics and provide intuition, but the reader will need to consult other sources to understand how to actually compute derivatives and integrals.

Some Real Calculus: A Touch of Differentiation

Suppose I give you a smooth function \(f(x)\). Like all smooth functions, it has a slope at each point. That is, if I give you some input \(x\), you should be able to look at a graph of \(f\) and give me a pretty good guess for what the slope of the function is at the point \((x,f(x))\).

For example, suppose that I give you \(f(x):=-x^2+3 x\). If you graph \(f\), you get an inverted parabola. Now, I can ask you what the slope of that parabola is at some point. Say, at the point \((x,y)=(1,2)\), (which is a point on that parabola):

From looking at the graph, you can see that the slope at that point is the same as the slope of that diagonal line going through it. You can give me an estimate of a slope of \(1.0\), which turns out to be exact. Congratulations! What you have just done is calculated \(g(x)=\frac{d}{d x}f(x)\) at \(x=1\) (which is sometimes written more compactly as \(\frac{d}{d x}f(x)\Big|_{x=1}\)).

Here is the key point. Differentiation takes some function \(f\) and makes a new function \(g(x):=\frac{d}{d x}f(x)\). This function \(g\) is a black box that returns the slope of \(f\) at whatever \(x\)-coordinate you pass into it.

Read the above until you are comfortable with it.

In our example, the derivative is \(g=\frac{d}{d x}f(x)=-2 x+3\). Notice that if you put in \(g(1)\), we get our derivative \(1.0\). The derivative function can be used for other points too, though. For example, the top of the parabola is at location \(x=1.5\). If we put that into our derivative, we get \(g(1.5)=0\). This makes sense; the apex of the parabola has a horizontal line with slope \(0\) going through it!

Fun fact: you can find the location of the minimum or maximum of many functions by setting their derivatives equal to \(0\). In the above example:\[ \begin{alignat*}{3} 0 &= g(x) &= -2 x + 3\\ 0 &= & -2 x + 3\\ -3 &= & -2 x\\ 1.5 &= & x\\ \end{alignat*} \]

Note: you will see the other notations \(f'(x)\), \(f^{(1)}(x)\), and \(\dot{f}(x)\) instead of \(\frac{d}{d x}f(x)\). For the single-variable case, these are all the same, but I chose the last one because it always works and it makes it clear what is happening: the function \(f\) is being differentiated with respect to \(x\). You can also write it as \(\frac{d f(x)}{d x}\) or \(\frac{d f}{d x}\).

Note: notations like \(\frac{\partial}{\partial x}f(x)\) mean something different. Don't use them until you know why you should!

Some Real Calculus: A Touch of Integration

Integration is the opposite of differentiation, but it might not be clear why. What it is is a continuous summation. It would be like instead of adding up a finite list of ordinary numbers, you could add up an infinite number of infinitely small numbers. The best we can do is try to build up some intuition, but please note that this section is unavoidably harder.

Here's a graph (note: I had to edit this image and the next a bit; since you now can't go directly to the original source, here it is). The graph is of \(f(x):=a\), where \(a\) is some constant. Look at the red horizontal line:

Starting from the origin and continuing toward the right to some \(x_m\), we might like to ask what the area between the red line \(f(x)\) and the \(\vec{x}\)-axis is. For example, let's consider \(a=6\) and look at some example values of \(x_m\). For \(x_m=0\), the area is \(0\). For \(x_m=1\), the area is \(6\), since we are looking at a \(1 \times 6\) rectangle. For \(x_m=2\), the area is \(12\), since we are looking at a \(2 \times 6\) rectangle. So, the formula for the area is just \(a \cdot x_m\). Congratulations! What you have just done is calculated:\[ \int_0^{x_m} f(x) \cdot d x = \int_0^{x_m} a \cdot d x = a \cdot x_m \]

This is called a definite integral. The bottom number on the integral sign is the lower limit of integration and the top number is the upper limit of integration. They define the range of input to the function we want to sum over. The left hand side above means: Find the area under \(f(x)\) starting at \(x=0\) and continuing to \(x=x_m\).

Note: what does the \(d x\) mean? It (sortof) means you're taking very small steps in \(x\), but really it has no function. It needs to be there to be a valid integral over \(x\) though.

The other kind of integral is the indefinite integral, and it's really not different. It's the same thing, except without the bounds of integration. It's a way of solving all the definite integrals with all the different bounds all at once by making a new function. Let's clarify with our example:\[ \begin{alignat*}{2} F(x) &:= \int f(x) \cdot d x = \int a \cdot d x = a \cdot x + C\\ F(x) &= a \cdot x + C \end{alignat*} \]This looks pretty similar to the above integral, doesn't it? In the above, \(F\) is the new function, called the integral of \(f(x)\).

Be sure to notice that \(x_m\) doesn't appear anywhere in the definition of \(F\)! The other thing to notice is the \(C\). This is a magical constant that you don't know. It is added when evaluating indefinite integrals only. You should think of it as expressing that you don't know how far offset the \(x\) is. It describes the initial value of the problem. More on all this stuff later; for now, just remember to add it.

How can we use the indefinite integral to solve a definite integral? The first definite integral was to find the area under \(f(x)\) from \(0\) to \(x_m\). With the indefinite integral, you evaluate at the limits and subtract:\[ \int_0^{x_m} f(x) \cdot d x ~~=~~ F(x) \Big|_{x=0}^{x=x_m} ~~=~~ F(x_m) - F(0) ~~=~~ (a \cdot x_m+C) - (a \cdot 0+C) ~~=~~ a \cdot x_m \]

Notice how \(C\) canceled out. This will always be the case when using an indefinite integral to solve a definite integral.

Here's a very slightly more complicated example with a new function \(f(x):=a \cdot x\):

The area under \(f(x)\) is now the area of a triangle. Recall that the formula for the area of a triangle is \(A=\frac{1}{2}b\,h\). Here, \(b\), the base, is the distance along the \(\vec{x}\)-axis to \(x_m\) while \(h\), the height, is the value of \(f(x_m)\). Here's an example of calculating the discrete integral for this \(f\):\[ \int_0^{x_m} f(x) \cdot d x ~~=~~ \frac{1}{2} b\,h ~~=~~ \frac{1}{2} x_m f(x_m) ~~=~~ \frac{1}{2} x_m \cdot a x_m ~~=~~ \frac{1}{2} a x_m^2 \]

The indefinite integral for this function is:\[ F(x) := \int f(x) \cdot d x = \frac{1}{2} a x^2 + C \]Again, you should notice that \(F(x)\) is very similar to the integral above (and again notice that \(x_m\) doesn't appear in its definition).

Let's use the indefinite integral to find a more interesting area:\[ \int_2^4 f(x) \cdot d x ~~=~~ F(x) \Big|_{x=2}^{x=4} ~~=~~ F(4) - F(2) ~~=~~ \left(\frac{1}{2} a \cdot 4^2+C\right) - \left(\frac{1}{2} a \cdot 2^2+C\right) ~~=~~ 8 a - 2 a ~~=~~ 6 a \]

An Obvious Example of Differentiation and Integration

Everyone understands position along a line. It's also pretty obvious how speed works. It turns out that speed is the derivative of position with respect to time.

Say you're walking at a constant speed. As you walk past position \(x=2\), I start a timer. When you walk past \(x=14\), I stop the timer. Suppose it takes you \(4\) seconds. If I graph your position with respect to time, it looks like a slanted line. The slope of this line—its derivative—is \(3\). This is also your speed (\(3\) units per second)! I'd write these functions describing position and velocity, respectively, like so:\[ \begin{alignat*}{2} x(t) &= 3 t + 2\\ v(t) &= \frac{d}{d t}x(t) = 3 \end{alignat*} \]

Here's how you apply integration. Suppose you're traveling at \(3\) units per second and you travel for \(4\) seconds. Where are you? To answer that, we need to know where we started from (this is where \(C\) will come in; it represents the initial condition of the system).

We know that speed is the derivative of position, so we know that position is the integral of speed:\[ \begin{alignat*}{2} x(t) &= \int v(t) d t\\ &= \int 3 \cdot dt = 3 t + C \end{alignat*} \]By comparing with the differentiation example above, we know that \(C=2\):\[ x(t) = 3 t + 2 \]Notice that in this case we actually know the value of \(C\), so now we can use the integral (\(x(t)\)) to figure out where we are at any point in time! When we pass in \(t=4\), for example, we see that an answer of \(14\) falls out, which indeed is our position at time \(t=4\).

Another question you might ask is, how far did you go in that time? To solve this, we can use a discrete integral:\[ \int_0^4 v(t) \cdot d t = x(4) - x(0) = (3 \cdot 4 + C) - (3 \cdot 0 + C) = (3 \cdot 4 + 2) - (3 \cdot 0 + 2) = 12 \]This says that moving at \(3\) units per second from time \(t=0\) to time \(t=4\) will make you travel \(12\) units (in this case, from \(x=2\) to \(x=14\)).

Again, notice that, even though we knew the value of \(C\), it cancels, so it doesn't matter. Intuitively, this means that we don't care where you started from if we just want to know how far you traveled.

Fun fact: just as speed is the derivative of position, acceleration is the derivative of speed. Even higher, we have jerk, and then jounce. Jounce together with the next two are called snap, crackle, and pop, but since no one uses such high derivatives of position these names are meant only humorously. Here are the derivatives and corresponding integrals (please note that I have bundled all the \(C\)-type constants into the appropriate functions):\[ \frac{d^6 x}{d t^6} = \frac{d^5 v}{d t^5} = \frac{d^4 a}{d t^4} = \frac{d^3 jerk}{d t^3} = \frac{d^2~snap}{d t^2} = \frac{d~crackle}{d t} = pop(t)\\ \int \int \int \int \int \int pop(t) \cdot d t = \int \int \int \int \int crackle(t) \cdot d t = \int \int \int \int snap(t) \cdot d t = \int \int \int jerk(t) \cdot d t = \int \int a(t) \cdot d t = \int v(t) \cdot d t = x(t) \]

An Important Example of Integration

When you throw an object, it follows a nearly parabolic path:


From basic physics, we know that the only significant force acting on this motorcycle is that due to gravity. This force is proportional to the object's mass, which, when combined with Newton's law \(\vec{F}=m\cdot\vec{a}\) means that the acceleration of any (reasonably sized) object downward is roughly constant. This constant is standard gravity: \(9.80665\) meters per second per second downward. Since no (significant) force pushes horizontally, we can write the approximate accelerations in the \(\vec{x}\)- and \(\vec{y}\)-axes as:\[ \begin{alignat*}{2} a_x(t) &= 0.0\\ a_y(t) &= -9.80665 \end{alignat*} \]We can now integrate the accelerations to find the velocities:\[ \begin{alignat*}{3} v_x(t) &= \int a_x(t) \cdot d t = \int 0.0 \cdot d t &= 0.0 \cdot t + v_{0x}\\ v_y(t) &= \int a_y(t) \cdot d t = \int -9.80665 \cdot d t &= -9.80665 \cdot t + v_{0y} \end{alignat*} \]Those new terms at the end are constants—just like \(C\)—that correspond to our initial conditions. Let's say the motorcycle flew into the air at a horizontal speed of \(v_{0x}:=30\)m/s and a vertical speed of \(v_{0y}:=10\)m/s:\[ \begin{alignat*}{2} v_x(t) &= 30\\ v_y(t) &= -9.80665 \cdot t + 10 \end{alignat*} \]We can now integrate the velocities to find the positions:\[ \begin{alignat*}{3} x(t) &= \int v_x(t) \cdot d t = \int 30 \cdot d t &= 30 \cdot t + x_0\\ y(t) &= \int v_y(t) \cdot d t = \int (-9.80665 \cdot t + 10) d t &= -4.903325 \cdot t^2 + 10 \cdot t + y_0 \end{alignat*} \]For simplicity, let's say the motorcycle started at the origin (so that \(x_0:=0\) and \(y_0:=0\)). This gives our final equations:\[ \begin{alignat*}{2} x(t) &= 30 \cdot t\\ y(t) &= -4.903325 \cdot t^2 + 10 \cdot t \end{alignat*} \]A careful mathematician would now reparameterize the \(t\) variable and give you an exact answer, but in this case the particulars aren't important.

Look what happened! The \(x\) value increases linearly with time. This means that the motorcycle is still moving steadily over the ground while it's jumping. However, at the same time, the \(y\) value is following an inverted parabola! This means that the motorcycle is following a parabola through the air!


I hope this tutorial has been helpful. As I mentioned, you must practice these concepts to assimilate them. If you've spotted an error, let me know!

Ian Mallett - Contact -
- 2021 - Creative Commons License