Introduction to differential and integral calculus

## **Lesson I**

In mathematics, there are many curves. From spheres, parabolas, hyperboloids, to the graph of the 71st degree polynomial whose root is the growth constant for Conway's Look-And-Say sequence, there are many curves. For some of these, like the sphere, there are convenient equations we can use to find the volume if we know the radius. But how was this volume determined in the first place, and why should we care about other less common curved surfaces?

In 1930, a mathematician-philosopher named Hermann Weyl said "Mathematics is the science of the infinite." So to understand and appreciate mathematics better it is necessary to deal with some of this infinity. With linear graphs of the form f(x) = ax + b, you don't really encounter this infinity, unless you're measuring the domain or range of a linear function. After all, the slope of f(x) = ax + b is just given by a, as the slope between two points is the vertical distance of the heights over their horizontal distance:

# S

f
(

x
2

)
−
f
(

x
1

)

x
2

−

x
1

=

a

x
2

b
−
a

x
1

−
b

x
2

−

x
1

=

a
(

x
2

−

x
1

)

x
2

−

x
1

=
a

{\displaystyle S = \frac{f(x\_2) - f(x\_1)}{x\_2 - x\_1} = \frac{ax\_2 + b - ax\_1 - b}{x\_2 - x\_1} = \frac{a(x\_2 - x\_1)}{x\_2 - x\_1} = a}

This slope can be gotten through just one calculation. But for a *curve*, something weird happens. Because since it's a curve and not a line, there's not really an easy way to tell the slope of a curve at any given point until you calculate the slope closer and closer to this point. In the same way a sphere seems flatter and flatter the more you zoom in on its surface, curves will appear flatter and flatter the more you get closer to a single part of that curve. We can't zoom in infinitely far, but we can get close enough that we get a "what-if" slope, as in "what-if we could zoom in infinitely far, what might the slope be?" Let's calculate this for the parabola f(x) = x2.

Given an arbitrarily point x, we know that the value of f(x) will be x2. The slope of the line running through the points (x,x2) and (x + a,(x + a)2) will tend towards the what-if slope at the point (x,x2) as a gets closer and closer to zero. First, without replacing a with anything, let's calculate the slope of this line:

# S

f
(
x
a
)
−
f
(
x
)

x
a
−
x

=

x
2

2
a
x

a
2

−

x
2

a

=

2
a
x

a
2

a

=
2
x
a

{\displaystyle S = \frac{f(x + a) - f(x)}{x + a - x} = \frac{x^2 + 2ax + a^2 - x^2}{a} = \frac{2ax + a^2}{a} = 2x + a}

For any point (x,x2), the "what-if" slope at (x,x2) will be 2x + a as a tends towards zero. Interestingly, since this gets closer and closer to 2x, we can say the "what-if" slope is *exactly* 2x because a goes to nothing. This means at the point x = -3 and y = 9, the what-if slope of the parabola will be 2(-3) = -6. If you put a ruler to the parabola at this point and compared it with a graph of f(x) = -6x you'll find this checks out. So it seems what we did worked.

The process of finding the slope of a curve or curved object is called *differentiation* and the slope at a given point on a curve is called the *derivative*. If g(x) is the derivative of every point at (x,f(x)), then g(x) is said to be the derivative of f(x). The derivative of f(x) is either denoted as f'(x) with a prime symbol in the superscript place of the function letter, or as

d
f
(
x
)

d
x

{\displaystyle \frac{df(x)}{dx}}

. This can also be written as

d

d
x

f
(
x
)

{\displaystyle \frac{d}{dx}f(x)}

. The d stands for **d**ifference, so that df(x) is actually shorthand for f(x + a) - f(x) and dx is shorthand for x + a - x = a. We don't need to consider a because

d
f
(
x
)

d
x

=

f
(
x
a
)
−
f
(
x
)

a

{\displaystyle \frac{df(x)}{dx} = \frac{f(x + a) - f(x)}{a}}

 is evaluated as a approaches 0, so a eventually becomes nothing. All the derivative is then is a what-if slope taken as you approach an instantaneous moment of the curve.

The phrase "what-if slope" has been used instead of just slope, because this process of reducing a down to nothing actually *doesn't* always work. If we had the graph f(x) = x2 when x ≠ 3 and f(x) = 0 when x = 3, then we'd have a function which looks like a parabola at all points *except for* x = 3, y = 0. If used the a-reduction method to find the slope of (3,0) we'd find it comes out to 6, even though this is ridiculous. The point is obviously separated from the others over an infinitely short distance on the x-axis, so if anything maybe the slope should be +∞ or -∞? This too is not valid. In fact no slope or derivative is valid here because the function f(x) is *non-differentiable*. A non-differentiable function f(x) is one where there exists at least one point (x,f(x)) where the slope between (x,f(x)) and (x + a,f(x + a)) *or* (x - a,f(x - a)) tends towards infinity as a approaches zero. In the case of f(x) = x2 when x ≠ 3 and f(x) = 0 when x = 3, this point is (3,0). This is because the rise between y = 0 and y = (3 + a)2 will tend towards 9 as a gets closer to 0, but the run, a, will get smaller as a gets closer to zero, meaning that you're dividing 9 by smaller and smaller amounts, causing the quotient to tend towards infinity.

Try the following problems and questions. You can check answers after trying.

* Questions
* Answers and Explanations

**1.** What is

d

d
x

x
2

{\displaystyle \frac{d}{dx} x^2}

?

**2.** What is the derivative of f(x) = x3 - 1 at x = 7?

**3.** Use *Desmos* Graphing Calulator. Is the function f(x) = 1/x differentiable at all points? Explain why or why not.

**4.BONUS** Find a general way to find

d

d
x

x
n

{\displaystyle \frac{d}{dx} x^n}

.

**1A.** By the derivative already explained,

d

d
x

x
2

=
2
x

{\displaystyle \frac{d}{dx} x^2 = 2x}

**2A.** This would be

f
(
7
a
)
−
f
(
7
)

a

{\displaystyle \frac{f(7 + a) - f(7)}{a}}

 as a approaches zero. This can be evaluated like so.

f
(
7
a
)
−
f
(
7
)

a

=

(
7
a

)
3

−
1
−

7
3

1

a

=

343
21

a
2

147
a

a
3

−
1
−
343
1

a

=

{\displaystyle \frac{f(7 + a) - f(7)}{a} = \frac{(7 + a)^3 - 1 - 7^3 + 1}{a} = \frac{343 + 21a^2 + 147a + a^3 - 1 - 343 + 1}{a} =}

a
3

21

a
2

147
a

a

=

a
2

21
a
147

{\displaystyle \frac{a^3 + 21a^2 + 147a}{a} = a^2 + 21a + 147}

As a tends towards to 0, a2 and 21a will both tend towards nothing, leaving only 147, the derivative of f(x) at x = 7.

**3A.** No. There is no defined derivative for x = 0, as 1/0 is undefined.

**4A.BONUS** The derivative of xn is

(
x
a

)
n

−

x
n

a

{\displaystyle \frac{(x + a)^n - x^n}{a}}

 as a approaches 0. Since (x + a)n will always have the leading term xn when expanded, we can cancel this out with -xn leaving us with all the non-leading terms of (x + a)n divided by a. Using Pascal's triangle, we see the second term is always naxn - 1, with all terms after that involving higher powers of a. Any term with a power of a greater than 1 will be reduced to nothing because even when divided by a it will tend towards 0. This leaves naxn - 1 which when divided by a is nxn - 1. Thus

d

d
x

x

n

=
n

x

n
−
1

{\displaystyle \frac{d}{dx} x^{n} = nx^{n-1}}

.
## **Lesson II**

Imagine the graph of every function like a heap of sand on the x-axis. If it crosses the x-axis then imagine the sand as if it were on the other side of an *Alice In Wonderland* looking glass world where gravity is reversed, pushing it against the x-axis. We might say that the sand on the top side of the x-axis has positive area, or mass, and the sand on the bottom side of the x-axis has negative area, or mass. Actually, negative mass *would* cause objects to start flying up against gravity, so this analogy checks out on multiple levels. Bazinga.

Every function that is differentiable is also *integratable*, where *integration* is defined as the process by which you can find out the area between a curve and the x-axis. This is negative if the area is beneath the x-axis and positive if the area is above the x-axis. Let's try integrating a simple linear equation - f(x) = 2x + 3.

Let's ignore that +3 and pretend it were 2x. We can always account for that +3 later anyways.

We note that the area between f(x) and the x-axis between the values of x = 0 and x = b is trivially simple - it's just a triangle with b as a base and f(b) as a height. This is

b
f
(
b
)

2

=

b
2
b

2

=

b
2

{\displaystyle \frac{bf(b)}{2} = \frac{b2b}{2} = b^2}

 The area between f(x) and the x-axis between the values x = 0 and x = -b is the same thing but negative, or

−

b
2

{\displaystyle -b^2}

. For the interval [a,b], the area between f(x) and the x-axis between x = a and x = b is b2 - a2

To reintroduce that +3 we just consider that if we shift f(x) up three units it will add 3(b - a) in area underneath the triangle calculated, so that the integral of f(x) = 2x + 3 in the range [a,b] becomes b2 - a2 + 3b - 3a. Just as we have a notation for derivatives, there is a notation for integrals, using the ∫ symbol. It looks like one of the holes on a violin body.

To denote the general function relating the area between the curve f(x) and the x-axis, we write it as

∫
f
(
x
)

d
x

{\displaystyle \int f(x) \text{ }dx}

. The dx is used because for non-linear equations and curves we actually divide the area up into a bunch of thin strips, and find the area as the sum of these as the **d**ifference between the strips tends towards zero. The specific integral in the interval [a,b] is denoted

∫
a
b

f
(
x
)

d
x

{\displaystyle \int\_a^b f(x)\text{ }dx}

. In our example,

∫
a
b

2
x
3

d
# x

b
2

−

a
2

3
b
−
3
a

{\displaystyle \int\_a^b 2x + 3\text{ }dx = b^2 - a^2 + 3b - 3a}

. When an integral is defined over an interval it's called a *definite* integral, as in "we're measuring something *definite*," but when an integral is defined in general without the little a or b it's called an *indefinite* integral.

Now you may have noticed something odd. The indefinite integral of 2x is x2 and the derivative of x2 is 2x. Is this a coincedence? No! Because it turns out that **integration and differentiation are two sides of the same coin, where the ridge is the function**!

But how can we prove this for all functions? Let's get physical. Let's say the y-axis was speed and the x-axis distance. We are measuring the distance of an object over time. Since distance is speed multiplied by time, the *area* underneath the graph of the object's speed at any given time would be the distance traveled. Now if the speed is constant then the distance will be linearly proportional to the time, but if the speed is not constant, if it *changes* because of acceleration, then the area also changes non-linearly. Distance is still speed multiplied by time, only now by "speed" we mean the average of all the speed moments that object undergoes. So acceleration corresponds to slope, the y-value speed, the x-value time, and the area distance. We can therefore say that acceleration is the derivative of speed as respects to time. So now let's graph acceleration on the y-axis and time on the x-axis. What would the area be? Well, acceleration is a distance per unit of time squared, or D/T2. Time is just T. Thus, D/T2\*T = D/T would be the area. Distance over time is of course speed, which brings us back to the original graph! Speed is the integral of acceleration as respects to time. Now the same reasoning holds for all functions, whether or not we're talking about physics. This is why integration and differentiation are inverses. . .

. . .except they *aren't*! At least not absolute opposites. You see, when we integrate a curve we are always able to recover the original curve from which we integrated. For example, we can integrate over f(x) = x and say that the indefinite integral is

∫
x

d
# x
2

x
2

{\displaystyle \int x\text{ }dx = 2x^2}

. Given 2x2 we can recover f(x) = x as the derivative,

d

d
x

2

x
2

=
x

{\displaystyle \frac{d}{dx} 2x^2 = x}

. But if we took the *derivative* of f(x) = x we'd get

d

d
x

# x
1

{\displaystyle \frac{d}{dx} x = 1}

. It's simple, but there's a problem. Because this is also the derivative of *any* linear equation of the form f(x) = x + C, where C is some **C**onstant. So to integrate over the function f(x) = 1 there is not just one possible integral but *infinitely many*, all in the form x + C. This means that differentiation is a *lossy* process, and we lose the whereabouts of a function's height on the Cartesian plane whenever we differentiate over a function.

[To be Continued. . .]