__________________________
USING CALCULUS TO SOLVE PROBLEMS
Engineering mathematics is built upon the core principles of calculus. Although the theory is certainly important, the fundamental results related to differentiation and integration are the most useful tools for engineers. To examine these results, we need to look at two main areas of study: differential calculus and integral calculus.
A classic example to motivate the concept of differential calculus is rooted in physics. Suppose we have a car driving along a straight road, but it is not traveling at a constant speed. If we described the distance as a function of time, we can plot it as shown in Figure 4.1.
Figure 4.1. Plot of the car’s distance over 6 s
If the function describing the distance this car covers is f(t) = 0.1t4 + 0.1t3 + 0.5t2, where t is in seconds and f (t) is in meters, we can determine how far this car has traveled at any instant in time. For example, in t = 4 seconds, the distance can be found by plugging 4 into the function:
This means the car has gone 40 meters in 4 seconds. In addition, we can find out how far the car has traveled over any period of time. For t = 2 to t = 4 seconds, the car has traveled
This is usually called displacement, the distance covered in a certain amount of time. Now, here is the question: what is the velocity (or the rate of change of the position) of the car at any time? The units here for velocity should be meters per second, which lets us make an easy association with another mathematical idea - the slope of a line.
A change in distance (the y values) over a change in time (the x values) implies we are dealing with finding a slope; yet, we do not have a straight line! If we tried to find the slope at t = 4, we would need to calculate the slope of a curve. One strategy involves drawing a tangent line at that point, and the slope of the curve will be precisely the slope of the line (Figure 4.2).
Definition 4.1: A tangent line to a curve is a line that touches the curve only at one point.
Figure 4.2. Meaning of velocity, the slope at t = 4
If we step back for a bit and reiterate, to find the velocity (or change in displacement with respect to time), we know that we need the slope of the curve. We might think “Well, this is clearly impossible.” Yet, if we were driving this car, we know that we can glance at the speedometer and see our velocity at any point, and so it is clearly not impossible from a physical point of view.
We are a little bit closer to our goal, but now we just rephrased the problem: find the slope of the tangent line. At least now we can approximate the velocity by using our trick from calculating limits. At 4 seconds, the car moves a small distance. Using this fact, we can center ourselves at t = 4 and make a tiny displacement by adding and subtracting a small amount of time. This means the displacement is:
Then, we need to take the time interval, 3.9 to 4.1 seconds, and calculate that difference as well:
This means our first approximation is:
Our first guess is surprisingly accurate, but its use is limited. The equivalent of knowing the velocity at one point is like having one word in our vocabulary. Sure, we can talk, but we cannot string a coherent sentence together. We need an all-encompassing description of the velocity, a dictionary, so to speak.
The writer of our dictionary is called the derivative. Given any function, within reason, we can find another function that tells us the slope of a curve at any point—or the rate of change at any point. The command that means “take the derivative” has a few different notations, but we tend to use the simple operator, D. This means for a function f(x),
where f′(x) is called the first derivative of f. In terms of limits, we can write the derivative in the same way we were finding the velocity in the previous example.
Definition 4.2: The derivative of a function f(x) is an infinitesimal change in the function with respect to the variable x (rate of change)—written as D{f(x)}. It is calculated formally as a limit,
but we prefer to use the shortcuts discussed later in practice.
To briefly see how this limit works, say we want to find the derivative of f(x) = x2. In the formula, the term f(x + ɛ) = (x + ɛ)2. Now, let’s try the limit...
At this stage, we can plug in ɛ = 0 and find that f′(x) = 2x! Note that we can plug in a value of zero since nothing is happening to the function around that point to make us cautious like we were in Section 3.4. We are not terribly concerned with working out limits, so we will continue with our discussion.
The derivative operator is commonly written in fractional form like so,
which means the “derivative with respect to x.” In addition, f′(x) can be rewritten in a different fractional form,
meaning “the derivative of f with respect to x.” The notion of derivatives has far-reaching implications beyond being able to define a function describing velocity from position. For instance, we can define current—the flow of positive charges —as a function i(t) by describing the position of the charge as q(t) and taking the derivative to say i(t) = q′(t).
The easiest functions to differentiate are polynomials, which consist of variables raised to non-variable powers. If we have a polynomial, all we need to do when finding the derivative is multiply the function by the exponent and subtract one from the exponent—this is the General Power Rule. So, if our function is,
the derivative, f′(x), is as follows:
Definition 4.3: The General Power Rule is a rule for finding the derivative of f(x) = axn, where a and n are constants and x is a variable. Given f(x), then
Here, we are finding the derivative of a power function. We have quite a few different types of functions we will encounter in engineering, and (almost) each one has a derivative. The first time through different techniques, it might appear that the strategies are radically different: in time, we tend to use them so often that they become second nature.
Example 4.1: Finding the Derivative of a Position Function—We have our distance function f(t) = 0.1t4 + 0.1t3 + 0.5t2, and we want to find the derivative to tell us the speed. Informally, we can think of the derivative D distributing to each term like a variable so we can take the derivative of each piece and sum all of the results (this is because the derivative is a linear operation).
Now we use the General Power Rule,
Therefore,
Since we have the velocity, let us check the approximation we made earlier at t = 4. This involves evaluating the derivative at t = 4.
Turns out we were right on the mark!
***
Motived by the same physical situation at the beginning of this chapter, we have one more measurement of interest with this car—its acceleration (or the rate of change of its velocity). For those rusty in Physics, the acceleration is the change in velocity over a period of time:
When measuring acceleration, we end up with another slope; however, this time we need the slope of the velocity curve. Well, all we need to do is take the derivative again.
Note that the velocity is the derivative of the displacement; the acceleration is the derivative of the velocity and the second derivative of the displacement.
Example 4.2: Higher-Order Derivatives—As mentioned, the only thing we need to do in order to calculate the acceleration for any time is take the derivative again.
Using the General Power Rule once more:
Therefore, the acceleration is:
To make a point about the repeatability of taking the derivative, we could rewrite f″(t) as
where the power on D tells us which derivative to take.
***
In fact, we can keep taking derivatives until our hearts are content. The derivative can be written generally for any order of derivative in the following way—for the nth derivative,
Note the (n) corresponds to a derivative, not a power. For instance, the third derivative of f(x) can be written as:
We can also use the dash notation, f″′(x), but this tends to become unwieldy as the number of derivatives increases.
Example 4.3: A More Complicated Position Function—Our favorite scenario, the mass and spring, is back! (Figure 4.3)
Way back in the first chapter, we mentioned that the mass–spring arrangement is a system where the output is the position of the block at any given time. Now we can look into exactly what we meant by such a statement. Say we just bumped the mass with a strong, but short, force and let the mass move without friction. Since the mass is attached to a spring, the mass will push into the spring, which will then propel it back toward us only to be pulled back. With the lack of friction, nothing is going to be able to stop this mass from moving. This must mean the mass will oscillate like a wave, say f(t) = sin(t) (Figure 4.4).
Figure 4.3. Mass and spring system
Figure 4.4. Position function of the mass, f(t) = sin(t)
Like before, we can take the derivative of the position function and find the velocity of the block at any point; however, we will run into a bit of a problem. What is D{(t)}? It is not a variable raised to a power, so the General Power Rule fails us here. Instead, through some clever rewriting of sin (t) or using the limit definition, we find that
When taking the derivative of any trigonometric functions, we cannot apply the General Power Rule directly. This means we need to use the definition of the derivative, calculate it numerically, or do some rewriting. In fact, the General Power Rule fails more often than we would like—far beyond the trigonometric functions. These include exponential functions, logarithmic functions, inverse trigonometric functions, and so on. For convenience, we collected a few common functions and their derivatives in Table 4.1. Note that there are a few functions in the table we have yet to introduce, but are included for completeness. The derivation of the derivatives for each of these functions can be found in any standard calculus book.
Table 4.1. Common functions and their derivatives
***
Most derivatives will not be direct applications of Table 4.1; instead, the function will often be a cocktail of special functions combined using the standard operations of addition, subtraction, multiplication, and division. By applying the following rules for differentiation, we can find the derivative of virtually any function we come across.
Table 4.2. Derivative rules
Example 4.4: The Product Rule—A moment, the tendency of an object to rotate, can be calculated as long as we know the magnitude of the force on the object and the distance the force is away from the reference point. Consider a 5-meter-long cantilever beam rigidly attached to the wall. Say we used a function called F(x) to describe the magnitude of the force at a particular point on the beam as shown in Figure 4.5.
Figure 4.5. Cantilever beam rigidly attached to a wall
To calculate the moment, using the wall as a reference point, caused by the force some distance x away, then we simply multiply the distance and the force together.
In this case, we will assume the magnitude of the force will vary, F(x) = 100sin(x) from 0 to π. This means the force is drawn starting from the curve depicted in Figure 4.5 down to the beam; the magnitude is found by plugging the distance x into F(x). For reference, the curve shown in Figure 4.5 is one period of sin(x). By assuming our “origin” for the moment is the wall, then the distance the force is away from the wall is simply x; therefore, the moment at any point x is
Let us pick a value, say x = 2. This means the force applied at 2 meters is F(2), which is approximately 90.93 Newtons. The moment at that distance is found using M(x).
If we wanted to know how quickly the moment is changing with respect to the distance, then we need to take the derivative. Sadly, the General Power Rule fails us here; instead, we need to use the product rule. Let f(x) = x and g(x) = 100sin(x), then our derivative, M′(x), will have the following form:
The derivatives of both functions are simple: f′(x) = 1 and g′(x) = 100cos(x). Substituting in the appropriate quantities yields
Let us try plugging in x = 2 like we did earlier.
The 7.7 figure is telling us that our moment is changing by 7.7 Newton meters/meter when our force is 2 meters away from the wall. Like velocity, we are finding rate of change—this time, it was with respect to distance from the wall.
***
Example 4.5: The Quotient Rule—The efficiency of a mechanical device tells us the amount of usable power that can be extracted from the process it performs. We define efficiency as the output power over the input power. In this case, let’s assume the mechanical device’s efficiency can be described by the function ɛ(t), where t is time in minutes:
We can infer that the longer the machine runs, it gradually becomes more efficient until it reaches its most efficient state. To figure out how quickly efficiency increases or decreases by changing t, we need to find ɛ′(t). Rather than being a product like Example 4.4, we have a quotient—meaning we need to apply the quotient rule. Let f(t) = t and g(t) = 2t + 5. Then ɛ′(t) will be calculated as follows:
The derivatives of f(t) and g(t) can be found easily using the General Power Rule: f′(t) = 1 and g′(t) = 2. Therefore, the rate at which efficiency changes is characterized by the following function:
***
Example 4.6: The Chain Rule—Suppose we had a circuit with a discharging capacitor. The voltage across the capacitor at any time t bigger than zero can be described by the following function: . We want to know the rate at which the voltage is decreasing as seen in Figure 4.6.
Figure 4.6. Plot of the voltage across the capacitor
To find the rate of decay, we need to calculate V′(t). We know the derivative of the standard exponential function from Table 4.1, but V(t) is a composition of two functions. To demonstrate why, let f(t) = 5et and g(t) = -t/3. Compose f with g and we end up with our original function, V.
Since V is a composition of functions, we need to apply the chain rule to find V′. Chain rule states that our derivative has the following form:
We can find each derivative separately,
The “derivative of entire function” is simply the derivative of the exponential function, which is itself.
Our result is the product of the two,
***
Example 4.7: Maximizing and Minimizing, the Process of Optimization—Albert Betz used calculus techniques in his derivation for the maximum possible power that is usable in the wind. In other words, what is the maximum efficiency of a turbine harnessing the power of the wind? Since the derivative tells us the slope of the curve at any point, we can infer a slope of zero means a maximum or minimum has been reached! To apply this idea, consider a wind turbine that sweeps an area A with its blades (Figure 4.7). We assume the wind coming into the turbine is v1 and the velocity of the wind leaving the turbine is v2.
Figure 4.7. Fluid flow through a wind turbine
If the wind was blowing freely (i.e., not through the turbine), the power of the wind can be expressed as
where ρ is the density of air. On the other hand, the wind traveling through the turbine will generate the following power:
Now, Betz was searching for the maximum possible efficiency a wind turbine could attain. To find this quantity, he formed the ratio for efficiency, ɛ = Pturbine/Pwind.
Next, we want to optimize ɛ. At the moment, ɛ is a function of the ratio v2/v1. To make our job easier, let us make a substitution by stating x = v2/v1. Therefore, we are now optimizing ɛ(x).
We begin the process by taking the derivative,
Then, we solve ɛ′(x) = 0. The solution(s) to this equation tell us where the slope of the curve is zero, which would indicate a “peak” or “valley” in the graph.
Solving for x yields a value of 1/3; therefore, the slope of the curve becomes zero at x = 1/3—this will be our critical number. Now, is this a maximum or a minimum? We can check by observing how the sign of the slope changes before and after the point at which the slope becomes zero. To gain a visual understanding of what is happening, draw three lines: one with positive slope and one with negative slope so they intersect like the peak of a mountain, then one with zero slope at the intersection point (Figure 4.8). If we are not allowed to pass the line with zero slope, then we need to change from positive to negative slope at the intersection point, the peak of the mountain (which happens to be the highest point). This is how we know we have reached a maximum! Finding a minimum involves using the same kind of picture, but the metaphor is the bottom of a valley/minimum instead of a peak/maximum.
Figure 4.8. Finding minimums and maximums using the derivative
Around the critical point, we will pick a number a little smaller than 1/3 and a number a little bigger than 1/3 to notice the change in sign like the pictures; therefore, our test points will be x = 0 and x = 1.
From these two points, we can verify the point at x = 1/3 must be a maximum. We can check the result graphically as shown in Figure 4.9.
Figure 4.9. Verifying the point at x = 1/3 is a maximum
Physically, the value of ɛ(x) at x = 1/3 will tell us the maximum possible power usable in the wind—the answer to the original question.
Thus, the most power we can extract from the wind is roughly 59.3% of the original power regardless of whatever v1 or v2 may be.
***
If we know the displacement of the car, we can find the velocity simply by taking the derivative! Does this work both ways? In other words, can we find the displacement if we know the velocity? Is there a kind of “antiderivative?” Of course! The opposite of differentiating is called integrating.
Like derivatives, the antiderivative and integration have far-reaching implications; for example, the foundation of probability for continuous random variables rests upon Integral Calculus We can also find various properties of materials like the center of mass (also called the centroid) and the moment of inertia (a measure of the moment needed to rotate an object) with the help of integration.
Rather than looking at the rate of change (slope), we will be calculating the accumulation of area. Using our motivating example of the accelerating car for differentiation in the previous section, we can take the derivative f′(t) = v(t) and look at the accumulation of area under the curve in terms of the units on the x- and y-axis in Figure 4.10 to retrieve f(t). Think of the area of the rectangle formed by the axis and dotted line, base times height. Since the x-axis is in seconds and the y-axis is in meters per second, the multiplication results in meters, a measure of distance!
In this case, estimating the area will be more tedious than attempting to ballpark slope. The general idea is to approximate the area using known shapes. For simplicity, the chosen shape is typically a rectangle. By dividing the interval into n equal pieces starting at a point a and ending at another point b, each rectangle will have a length of Δx = (b-a)/n. From this, we know the area can be approximated by adding up all of the rectangles.
Figure 4.10. The physical meaning of integration—determining position using velocity
Pictured in Figure 4.11, we have a function on the interval from 0 to 3 (a = 0 and b = 3). We can attempt to calculate the area by choosing to make 10 rectangles; then the approximation will be the sum of the rectangles.
Since we are using 10 rectangles and our area is between 0 and 3, then the width of the rectangles is
Figure 4.11. Estimating the area under the curve
The height of each rectangle can be found by evaluating the function at the point the rectangle makes contact with the curve, so
After crunching the numbers using the following formula, we approximate the area as 12.92, which tells us how far the car has traveled (in meters). If we increase the number of rectangles, then we reduce the amount of error in our calculations. This leads us to the definition of the definite integral given we tend the number of rectangles to infinity.
Definition 4.4: The definite integral of a function f (x) on an interval from a to b is the area under the curve, written as
Symbolically, the definite integral yields the area under the curve, so
The command “integrate v(t) from 0 to 3” is captured by the elongated “s” and the dt (the differential, an infinitesimally small width). The number at the bottom of the s is the lower bound and the number at the top is the upper bound. If we want a general formula for the antiderivative, then we use the indefinite integral—same notation, but no upper or lower bounds.
Provided with a derivative and the command to retrace our steps back to the original function, the quirks associated integration bubble to the surface.
Example 4.8: Defined up to a Constant—Limitations of the Antiderivative—Consider the functions listed in Table 4.3.
Table 4.3. Table of similar functions and their derivatives
By using the General Power Rule, we can calculate D{f(x)} for each function and find they all share the same derivative. With differentiation, we were able to find f′(x) exactly with little difficulty. Now, what happens if we have f′(x) = 2x and need to find f(x) exactly? By reading through Table 4.3, we know this task is impossible without being provided with more information. To compensate for the additional constant that we do not know, we will always add a “+C” (an arbitrary constant) whenever we find an antiderivative.
Definition 4.5: An antiderivative F of a function f is a function with the property that the derivative of F is f. Loosely speaking, it is a general expression for the area under the curve f for any interval from a to b.
***
To begin, we can define the General Power Rule for Integration. Be careful though, it is valid for any value of n except n = –1, that is a special case.
We can find the integral of a function by simply taking the rule for differentiation in reverse. Computing the area requires using the Fundamental Theorem of Calculus.
The Fundamental Theorem of Calculus: For a continuous function f and its antiderivative F on an interval a to b, then
The antiderivatives that F can be are all located in Table 4.1, but now the table is read in reverse!
Example 4.9: Going Backward—The Antiderivative—As we mentioned in the opening of the chapter, we can figure the displacement an object makes as long as we know the velocity function. For instance, if we have
as the velocity function and the question is “how far does the object travel in 5 seconds?” then all we need to do is find the following definite integral:
By substituting in the function v(t), we have
Like differentiation, integration is also linear—meaning it follows all of the wonderful linearity properties. Therefore, we can integrate term by term and factor out any constants.
By the General Power Rule for Integration, we can simply add one to the exponent and divide by the new exponent. Once we complete the rule, we need to evaluate each piece at the end points—signified by the vertical bars. Note that we do not have to split up the integrals, we could do it all in one step.
By plugging in the end points using the Fundamental Theorem of Calculus, we have
After simplifying, we find
If we wanted the position function itself, then we would simply not evaluate at the end points and add a “+C” to our result. Therefore, the position function s(t) is
***
Example 4.10: A Simple Substitution (u-Substitution)—Say we have a capacitor in a circuit with an incoming current of i(t) = cos(0.1t + θ), where θ is a constant, and we want the voltage v(t). The current and voltage are related through the following equation:
where c is the capacitance. Solving for v′(t) will let us take the integral of both sides.
Now we can substitute in i(t) and integrate,
The left-hand side of the formula yields the function we want, v(t), but the right-hand side cannot be integrated like before.
We can integrate cos(t) with no trouble, so why not rename the expression on the inside of the function as something else—how about u?
One slight technicality remains: now our variable is u, but we are integrating with respect to t (as indicated by the dt). This means we need a du, which we could find by taking the derivative of our substitution u. Therefore, du = 0.1 dt. By solving for dt, we know exactly what needs to replace d tin the original integral. (Note 1/0.1 = 10.)
Recall, c is capacitance and C is the generic constant. The final step is to convert back to our original variable—then we are done.
***
One versatile method of integration is called integration by parts. The differential equivalent to this technique would be the product rule, as the following formula is derived from it:
where u, v, du, and dv and dv are functions. Instead of making a u- substitution, we are trading an integral we cannot solve for one we can solve. Thus, by choosing u and dv strategically, we will have the following expression:
The following rule of thumb in Table 4.4 can help us pick our u.1 Of the two functions, whichever comes first in this list becomes u.
Table 4.4. LIATE Rule
For instance, if our function to integrate is x2ex, then x2 becomes u because “algebraic” occurs first in the list before “exponential,” which occurs last.
Example 4.11: Integration by Parts—The expected value (or mean) E[X] of a probability density function f(x) (we can understand this as a function describing the likelihood of something happening for some value of x) is a weighted average calculated using the following integral:
Notice the bounds on the interval are not regular numbers; instead, they are infinite. Although discussing improper integrals is beyond this text, the expected value is a perfect example of an integral over the entire real line. For this demonstration, the fact that this integral is improper would not matter and we will see why soon. Say f(x) = 0.5sin(x) for 0 ≤ x ≤ π and is zero elsewhere, then the expected value is:
Since we know the function is zero everywhere except between 0 and π, the bounds of the integral can be reduced to the interval 0 ≤ x ≤ π. That is because integrating zero gives us zero anyway; there is no area to be found.
We can now apply integration by parts. Using our rule of thumb, “algebraic” occurs before “trigonometric,” so u = x and dv = sin(x)dx. To find du and v, we need to take the derivative of u and integrate dv, respectively:
Then, our original integral becomes
Notice how the non-integral portion is evaluated like a normal definite integral and the constant 0.5 is carried over. The right-hand side simplifies as
Our strategy was to obtain a simpler integral on the right side of our formula, which worked wonders! We know how to integrate cos(x) with no issues whatsoever.
Therefore, the expected value of f(x) is
This result makes sense considering the expected value can also be interpreted as the “center” of the function, as shown in Figure 4.12.
Figure 4.12. Physical meaning of expected value
***
Other integration techniques exist like the partial fraction method and trigonometric substitution, but are well beyond the scope of this text.
__________
1 Kasube, Herbert E. (1983). “A Technique for Integration by Parts”. The American Mathematical Monthly 90 (3): 210–211. doi:10.2307/2975556. JSTOR 2975556.