2.1 Calculus Fundamentals

Calculus is defined as the branch of mathematics that utilizes infinitesimally small quantities to study continuous change. The two main topics within calculus are the derivative and the integral.

2.1.1 The Derivative

In order to understand the derivative, we will start with a two variables (x,y). These variables are related to each other by the function presented in equation 2.1.

y = f(x) (2.1)

Our goal is to find how much y varies per increment of x. This ”quantity of change per unit x” is symbolized by the variable C. In order to do this, we can start out with equation 2.2.

C = y2 y1 x2 x1 (2.2)

Equation 2.2 will tell us how much y changes from x1 to x2. However, we are interested in the amount y is changed instantaneously. Therefore, we can say that x2 = x1 + h where h is an infinitesimally small quantity. Plugging this into equation 2.2 we get equation 2.3.

C = lim h0 y2 y1 (x1 + h) x1 (2.3)

Simplifying the denominator of equation 2.3 and plugging in equation 2.1 we get equation 2.4.

C = lim h0f(x + h) f(x) h (2.4)

Please note that since we are now dealing with one value of x, we replaced x1 with x. The above equation can be used to find the instantaneous change in y per infinitesimally small interval x for any value x. Typically, we replace C with the following notation.

𝑑𝑦 𝑑𝑥 = lim h0f(x + h) f(x) h (2.5)

The 𝑑𝑦 𝑑𝑥 symbolizes ”The change in y per a infinitesimally small interval x”.

Short Example

Let us start with the function shown in equation 2.6.

p = t2 (2.6)

For the purpose of this example, let us assume that p is the position of a particle at any time t. We want to find the instantaneous change in p per interval t. You may notice that this is position divided by time ... we are calculating speed. Plugging equation 2.6 into equation 2.5 we get equation 2.7.

𝑑𝑝 𝑑𝑡 = lim h0(t + h)2 t2 h (2.7)

Solving the limit in equation 2.7, we get equation 2.8.

𝑑𝑝 𝑑𝑡 = 2t (2.8)
The Chain Rule

Finding the limit of complicated functions using equation 2.5 is very difficult. Therefore, calculus students typically memorize series of rules which correspond to the derivatives of functions. One of the most fundamental derivation rules is the chain rule. The chain rule deals with derivatives of functions within functions. Consider the function provided in equation 2.9.

f(x) = h(g(x)) (2.9)

To simply equation 2.9, we can state y = g(x). The chain rule then states 𝑑𝑓𝑑𝑥 can be found using equation 2.10.

𝑑𝑓 𝑑𝑥 = 𝑑h(y) 𝑑𝑦 𝑑𝑔(x) 𝑑𝑥 (2.10)

Essentially, you take the derivative of the outside function first, treating the inside function as a variable, and then take the derivative of the inside function.

The Product Rule

Consider a function f(x) which consists of the product of two separate functions g(x) and h(x), as shown in equation 2.11.

f(x) = g(x) h(x) (2.11)

The product rule states that the derivative of f(x) can be calculated using equation 2.12.

𝑑𝑓 𝑑𝑥 = 𝑑𝑔 𝑑𝑥 h(x) + g(x) 𝑑h 𝑑𝑥 (2.12)

The product rule can be derived by use of equation 2.5. However, calculus proofs are outside of the scope of this book.

The Quotient Rule

Consider a function f(x) which consists of the quotient of two separate functions g(x) and h(x), as shown in equation 2.13.

f(x) = g(x) h(x) (2.13)

The quotient rule states that the derivative of f(x) is as shown in equation 2.14.

𝑑𝑓 𝑑𝑥 = 𝑑𝑔 𝑑𝑥 h(x) g(x) 𝑑h 𝑑𝑥 (h(x))2 (2.14)

The quotient rule can be derived by use of equation 2.5. However, calculus proofs are outside of the scope of this book.

2.1.2 The Partial Derivative

The partial derivative is used when we differentiate a function with more than two variables. An example of such a function is shown in equation 2.15.

z = f(x,y) (2.15)

Now, we need to make a decision. Are we interested in finding out how much z changes per increment of y? Or are we interested in finding out how much z changes per increment of x? Lets go with the change of z with respect to x. This change can be expressed using equation 2.16.

C = z2 z1 x2 x1 (2.16)

Following the example from section 2.1.1, equation 2.16 will tell us how much z changes from x1 to x2. However, we are interested in the amount z is changed instantaneously. Therefore, we can say that x2 = x1 + h where h is an infinitesimally small quantity. Plugging this into equation 2.16 we get equation 2.17.

∂𝑧 ∂𝑥 = lim h0f(x + h,y) f(x,y) h (2.17)

Please note that in equation 2.17, the denominator was simplified and equation 2.15 was plugged in. The ∂𝑧∂𝑥 notation mimics the 𝑑𝑦𝑑𝑥 notation from equation 2.5. However, the fancy emphasizes that this is a partial derivative. Partial referrers to the fact that we are finding the change in z with respect to one out of two possible variables. We can repeat the proceeding process to find ∂𝑧∂𝑦.

Short Example

Let us start with the function in equation 2.18.

z = x2 + y2 + 𝑥𝑦 (2.18)

We are interested in finding ∂𝑧∂𝑥. In order to do this, we use equation 2.17 accordingly.

∂𝑧 ∂𝑥 = lim h0 [(x + h)2 + (x + h)y + y2] [x2 + 𝑥𝑦 + y2] h

Solving the limit, we are left with equation 2.19.

∂𝑧 ∂𝑥 = 2x + y (2.19)

In order to provide a visualization, a graph of the function in equation 2.18 with the y = 0 plane overlaid is provided in Figure 2.1. The derivative of the grey line is ∂𝑧 ∂𝑥 at y = 0.

PIC

Figure 2.1: Graph of equation 2.18 with the y = 0 plane overlaid. The derivative of the grey line is ∂𝑧 ∂𝑥 at y = 0.

The partial derivative simply constrains the original function z to a two dimensional plane and then finds the derivative (section 2.1.1) on that plane.

2.1.3 The Integral

In the derivative sections, we reviewed a method for finding the change in a variable (in section 2.1.1 this was y) per an interval of another variable (in section 2.1.1 this was x). This process can also be thought of as a type of instantaneous division. We divide the change in y by the change in x, given that the change in x is infinitesimally small. The integral can be thought of as the opposite of the derivative; instead of dealing with instantaneous division, it deals with instantaneous multiplication.

To understand the integral, let us begin with the function shown in equation 2.20.

y = f(x) (2.20)

Our goal is to multiply y by some interval Δx𝑡𝑜𝑡. Δx𝑡𝑜𝑡 is equal to xB xA. The result of the multiplication will be represented by M. Since y varies as a function of x, we need to use the the series shown in equation 2.21 for such a multiplication.

M = f(x1) Δx12 + f(x2) Δx23 + f(x3) Δx34 + ... (2.21)

Essentially, we are freezing the continuous f(x) function at points x1, x2, x3 (and so forth) and then multiplying this function by an incremental Δx, which is the distance between each frozen x value. Naturally, Δx12 + Δx23 + Δx34 + ... must equal the total interval Δx𝑡𝑜𝑡 (xB xA).

We also set up the above sequence so that each incremental Δx value is of the same quantity. Therefore, Δx12 = Δx23 = Δx34 = ... = Δx𝑖𝑛𝑐. The Δx𝑖𝑛𝑐 stands for x incremental and will be used from now on. If we want to find the value of Δx𝑖𝑛𝑐 we can use equation 2.22.

Δx𝑖𝑛𝑐 = xB xA n (2.22)

In equation 2.22 n is the total amount of terms we use to calculate M. Plugging in equation 2.22 into equation 2.21 we get equation 2.23.

M = f (xB xA n )Δx𝑖𝑛𝑐 + f (xB xA n + xB xA n )Δx𝑖𝑛𝑐+ f (xB xA n + xB xA n + xB xA n )Δx𝑖𝑛𝑐 + ... (2.23)

We can rewrite equation 2.23 as a series as shown in equation 2.24.

M = i=1nf (xB xA n i) xB xA n (2.24)

How, here is the fun part. The more n terms we have, the more ”accurate” our result will become because we will be freezing f(x) at more locations. Therefore, ideally, n = . We can rewrite equation 2.24 to include a limit for n approaching infinity. This is shown in equation 2.25.

xAxB f(x)𝑑𝑥 = lim n i=1nf (Δx𝑡𝑜𝑡 n i) Δx𝑡𝑜𝑡 n (2.25)

In equation 2.25, M was replaced by the xAxBf(x)𝑑𝑥. The is called the integral sign and represents a big elongated S, which stands for sum. The integral is, as shown in the above sequences, a repeated sum. As stated previously, xA and xB are the lower and upper bounds of Δx. 𝑑𝑥 represents Δx𝑖𝑛𝑐 which is multiplied and added an infinite amount of times, with the goal of multiplying f(x) by Δx𝑡𝑜𝑡.

The integral can be easily visualized as the area under a curve, as shown in Figure 2.2.

PIC

Figure 2.2: Visualization of abf(x)𝑑𝑥. The value of the integral is the area of the region bounded by f(x) from the top, the x axis from the bottom, a on the left, and b on the right.
A short example

Let us begin with the function in equation 2.26.

v = 2t (2.26)

We are interested in integrating (multiplying) this term by the interval 0 tf. For the purpose of this example, let us assume that v is velocity and t is time. You may notice that we are multiplying velocity by an interval of time (0 tf)... we are calculating position traveled during the time period 0 tf. Plugging in equation 2.26 to equation 2.25 we get equation 2.27.

0tf 2𝑡𝑑𝑡 = lim n i=1n2 (tf n i) tf n (2.27)

Simplifying equation 2.27, we get equation 2.28.

0tf 2𝑡𝑑𝑡 = lim n i=1n2 (tf n )2 i (2.28)

Part of this sequence actually has a known solution shown in equation 2.29.

n=1ni = n(n + 1) 2 (2.29)

There are numerous visual and traditional mathematical proofs for the series sum shown in equation 2.29. These will not be covered in this book. Since we know that tf n is a constant, we can plug in equation 2.29 into equation 2.28 to get equation 2.30.

0t2𝑡𝑑𝑡 = lim n2 (tf n )2 n(n + 1) 2 (2.30)

Evaluating the limit in equation 2.30, we get equation 2.31.

0t2𝑡𝑑𝑡 = t f2 (2.31)

You may notice that this gave us the exact same output as equation 2.6. We essentially just undid what was done in the example in section 2.1.1.0. This solidifies the concept that the integral is the opposite of a derivative.

2.1.4 Double (and beyond) Integrals

In section 2.1.3 we reviewed how to multiply y by an interval Δx𝑡𝑜𝑡 if y varies as a function of x. In this section, we expand the definition of the integral to make it compatible with multiple variables. In order to do this, let us begin with equation 2.32.

z = f(x,y) (2.32)

Our goal is to multiply z by some interval Δx𝑡𝑜𝑡 and Δy𝑡𝑜𝑡. Δx𝑡𝑜𝑡 is equal to xB xA. Δy𝑡𝑜𝑡 is equal to yB yA. Plugging this into equation 2.25 we get equation 2.33.

yAyB xAxB f(x,y)𝑑𝑥𝑑𝑦 = lim n j=1n i=1nf (Δx𝑡𝑜𝑡 n i, Δy𝑡𝑜𝑡 n j) Δx𝑡𝑜𝑡 n Δy𝑡𝑜𝑡 n (2.33)

As with the single integral, we are finding z at each incremental location x,y and multiplying this value by the interval Δx𝑖𝑛𝑐 and Δy𝑖𝑛𝑐. All these “multiplications” are then added together. In equation 2.33, we first iterate through all x intervals with j fixed at 1, and then move on to j = 2 and so forth. This makes x the inner integration variable and y the outer integration variable. However, since this is all multiplication and addition it does not matter which order we use. The solution to f(x,y)𝑑𝑥𝑑𝑥 is the same as f(x,y)𝑑𝑦𝑑𝑥.

The double integral can be easily visualized as the volume under a surface, as shown in Figure 2.3.

PIC

Figure 2.3: Visualization of cdabf(x,y)𝑑𝑥𝑑𝑦. The value of the integral is the volume of the region bounded by f(x,y) from the top and the x y plane from the bottom within the bounds of x = a to x = b and y = c to y = d.

We can follow a similar pattern for variables that are a function of three (or more) variables. In this case we would get a triple (or more) integral.

A short example

Let us begin with the function provided in equation 2.34.

z = 𝑥𝑦 (2.34)

We are interested in integrating (multiplying) this term by the interval 0 xf and 0 yf. Plugging the equation 2.34 into equation 2.33 we get equation 2.35.

0yf 0xf f(x,y)𝑑𝑥𝑑𝑦 = lim n j=1n i=1n (xf n i) (yf n j) xf n yf n (2.35)

As before, part of this sequence actually has a known solution shown in equation 2.36.

n=1ni = n(n + 1) 2 (2.36)

Plugging equation 2.36 into equation 2.35 and simplifying we get equation 2.37.

0yf 0xf f(x,y)𝑑𝑥𝑑𝑦 = lim nxf2yf2 n4 n(n + 1) 2 j=1nj (2.37)

Now we can plug in equation 2.36 again; given that we replace i with j. Doing this we, are left with the limit provided in equation 2.38.

0yf 0xf f(x,y)𝑑𝑥𝑑𝑦 = lim nxf2yf2 n4 n(n + 1) 2 n(n + 1) 2 (2.38)

Evaluating the limit in equation 2.38, we obtain the answer as shown in equation 2.39.

0yf 0xf f(x,y)𝑑𝑥𝑑𝑦 = 1 4xf2y f2 (2.39)

2.1.5 Methods of Integration

The integral is defined in equation 2.25. Considering we are dealing with an sum with a number of terms which approach infinity, finding a solution for any function can be very hard. In the short examples provided for both the integral and double integral we used the convenient identity n=1ni = n(n+1) 2 . However, not every function has a closed form equation for a given sum. In practice, integrals are usually solved with the help of known base function integrals. Algebraic manipulations are used to simplify an original function into one in the form of such base functions, allowing for easier integration. In this section, three common algebraic manipulations used to simplify integrals are provided. This is not a comprehensive list; there are other methods such as trig substitution which are also used to simplify integrals. However, the methods included in this section are deemed most relevant.

U Substitution

U substitution is a process of reversing the chain rule (the chain rule is introduced in section 2.1.1.0). Consider the integral shown in equation 2.40.

𝑑𝑓(g(x)) 𝑑𝑥 𝑑𝑔(x) 𝑑𝑥 𝑑𝑥 (2.40)

By using the substitution u = g(x) we can rewrite the equation 2.40 as shown in equation 2.41.

𝑑𝑓(u) 𝑑𝑥 𝑑𝑢 (2.41)

The idea here is equation 2.41 is simpler to look at and therefore easier for to integrate.

Short Example

Consider the function provided in equation 2.42.

0x2xcos (x2) 𝑑𝑥 (2.42)

Setting u = x2, we can rewrite the equation 2.42 as shown in equation 2.43.

0x cos(u)𝑑𝑢 (2.43)

It is given that cos(u) = sin(u). Therefore, plugging u back in, our final answer is obtained as shown in equation 2.44.

0x2xcos (x2) 𝑑𝑥 = sin (x2) (2.44)

Integration by Parts

Integration by Parts is a way of reducing the power of a term within a two term integral. The integration by parts identity is provided in equation 2.45.

f(x)d (g(x)) = f(x)g(x) g(x)d (f(x)) (2.45)

Short Example

Consider the function provided in equation 2.46.

0xxcos(x)𝑑𝑥 (2.46)

Let us define the above equation in terms of equation 2.45. f(x) = x, and 𝑑𝑔(x) 𝑑𝑥 = cos(x). Therefore, g(x) = sin(x). Plugging this all into equation 2.45 we are left with equation 2.47.

0xxcos(x)𝑑𝑥 = xsin(x) sin(x)𝑑𝑥 (2.47)

The integral in equation 2.47 simplifies so nicely because d(f(x)) 𝑑𝑥 = 1.

Partial Fraction Decomposition

From algebra, we know the identity provided in equation 2.48 is true.

C1 g(x) + C2 f(x) = 𝐴𝑓(x) + 𝐵𝑔(x) f(x)g(x) (2.48)

Equation 2.48, C1 and C2 are both known constants. The partial fraction decomposition technique is a method of doing the opposite of this operation. Essentially, given C1f(x)+C2g(x) f(x)g(x) we want to get C1 g(x) + C2 f(x). The reason we want to decompose polynomial fractions in this way is because it is easier to integrate C1 g(x) + C2 f(x) than it is to integrate C1f(x)+C2g(x) f(x)g(x) .

The first step in a fraction decomposition is to write an equation in the general format provided in equation 2.49.

C1f(x) + C2g(x) f(x)g(x) = A g(x) + B f(x) (2.49)

In equation 2.49, A and B are both unknown constants. Multiplying both sides of equation 2.49 by f(x)g(x) f(x)g(x) we get equation 2.50.

C1f(x) + C2g(x) = 𝐴𝑓(x) + 𝐵𝑔(x) (2.50)

From here it is quite obvious that A = C1 and B = C2. In the case of more complicated algebra, a system of equations can be used to find A and B.

There are some specific rules regarding situations where the denominator of the original equation is at a given power (for example [f(x)]k) or when the power of the denominator is greater than 1 (for example ax2 + 𝑏𝑥 + c). The goal here is to provide a method overview and therefore we will not go over how to do partial fraction decomposition in these specific cases.

Short Example

Suppose we tasked with solving the integral in equation 2.51.

5x 4 x2 x 2𝑑𝑥 (2.51)

Factoring the denominator of equation 2.51 and using equation 2.49 we get the equation 2.52.

5x 4 (x + 1)(x 2) = A x 2 + B x + 1 = (2.52)

Multiplying equation 2.52 by (x + 1)(x 2) we get equation 2.53.

5x 4 = A(x + 1) + B(x 2) (2.53)

Now, we can plug in 2 different values for x. It doesn’t matter which values. We will be then left with 2 equations and two unknowns. Solving this system of equations, we get A = 2 and B = 3. We can plug these values into equation 2.52, and then plug this new identity into the original integral. Doing this, we are left with equation 2.54.

2 x 2 + 3 x + 1𝑑𝑥 (2.54)

The integral in equation 2.54 is easier to integrate than the integral in equation 2.51, although they are equivalent.