Engineering Math - Calculus

 

 

 

Line Integral

 

A line integral adds up a quantity along a curve instead of along the x axis. In engineering it gives the work done by a force along a path, the voltage between two points in an electric field, and the circulation of a flow around a loop. This page first shows what the integral adds up. Then it shows how to describe the curve as a function, which is where most of the difficulty lies, and works two examples to the final number.

If you are new to the concept of Integration, I would suggest you to read the "Integration" page first.

What does a line integral add up ?

Let's look at one example as shown below. In this example, you see a lot of vectors in blue arrow and vectors in red arrow. You see the red vector is sitting on top of a curve (path) shown in red curve. Each of the red vector is the tangential to each point on the path. Now I want to take the inner product of each red vector and blue vector and sum them all. This operation can be represented in a mathematical form as shown below. This kind of integration is called "Line Integral".

 

Line integral of F(r) dot dr along an open curve C with blue field vectors and red tangent vectors

Figure 1. A line integral along an open curve C. At each point, the field vector F(r) and the small tangent step dr are combined by an inner product, and the results are summed along C.

The inner product keeps only the part of F that points along the path. A blue vector that crosses the path at a right angle contributes nothing, and a blue vector that points against the path contributes a negative amount. So the line integral measures how much the field pushes along the path, as a whole. If F is a force, this sum is the work done on an object that moves along C.

One special case of line integral is the integration over a closed path which is as shown in the following example. In this example, you see a lot of vectors in blue arrow and vectors in red arrow. You see the red vector is sitting on top of a curve (path) shown in red curve.  Each of the red vector is the tangential to each point on the path. Now I want to take the inner product of each red vector and blue vector and sum them all. This operation can be represented in a mathematical form as shown below. The mathematical operation is exactly same as the one shown in previous example. The only difference is the path the red vectors are going along. The path in this example is a closed curve. This kind of integration is called "Circular Integral" (The closed path need not to be exact circle as below. It can be any arbitrary shape of closed curve).

 

Closed line integral of F(r) dot dr around a circle

Figure 2. A line integral around a closed curve. The small circle on the integral sign marks the closed path.

Most textbooks call this a closed line integral or a contour integral. Its value is called the circulation of F around the curve. Example 2 below computes one for an ellipse.

  • A line integral sums F along a path : only the part of F that is tangent to the path counts.
  • The sign follows the direction of travel : walking the same path in the opposite direction changes the sign of the result.
  • A closed path gives the circulation : the curve ends where it started, and the integral sign carries a small circle.

How to represent a curve in a function ?

I think (hope) the concept of line integral didn't sound so complicated to you. At least, it didn't sound so complicated to me, but when I was give specific mathematical equation or formular for the line ingral or when I was asked to write a mathematical equation/formular for a real application using line integral, I didn't know what to do and couldn't understand what it really means when I was given those equations from textbook example. After a long time struggle, what I realized was that the reason why I have this kind of difficulty is not because I didn't understand the concept of line integral itself, but because I was not familar to how to represent the curve (path) in a function.

What is the definition of the function ? Here goes the definition from https://www.mathsisfun.com/definitions/function.html . It says

"A function is a special relationship between values : Each of its input values gives back exactly one output value".

The page at that link now words it a little differently: a special relationship where each input has a single output. The meaning is the same.

The keyword in this definition is that "exactly one output value".

Let's look at following three example. Which of these three example is a function ? which is not ?

 

Three curves A, B and C asking whether each one is a function

Figure 3. Three curves. Only curve A passes the test of one y value for each x value.

Plot A definitely can be a function since one value on the x axis (independent variable) is mapped to ONLY ONE value on y axis (dependent variable).

How about plot B ? Is this a function ? It cannot be a function at least according what we have learned in most of high school math. In this example, some x value maps to two different y value. so it is not a single valued map from independent variable to dependent variable.

How about plot C ? Is this a function either ? It cannot be a function according what we have learned in most of high school math. In this example, some x value maps to two different y value. so it is not a single valued map from independent variable to dependent variable.

Note that the test does not forbid two x values with the same y value. Plot A does that near its bump, and it is still a function. What a function y = f(x) cannot do is give two y values for one x value. You can check this with a vertical line: if any vertical line crosses the curve twice, the curve is not a function of x.

Here we have problem. Most of the curve that we deal with in line integral look like plot B or plot C. Is there any way to represent this kind of curve as a function ? If you take the course of advanced high school math or university level math, you would know that it is possible to represent this type of curve in a function. Just give you the direct answer, you can represent this type of curves in one of the following type of function.

  • i) Parametric Function
  • ii) Vector Function
  • iii) Complex Function (Function with complex variable)

I would not explain about these functions in this page. Now you may see why most of applications of line integral are given in the form of Parametric function, Complex function or vector function (I would write a separate pages for these functions later when I have chance. For now, I would just assume that you are familiar with these functions. I know, unfortunately we were asked to learn 'line integral' before you learn or is used to the concept of various different types of functions). The point here is that to understand the meaning of line integral, first you have to be very familiar with how to represent a curve in a mathematical function.

Let's see how each of the three forms describes a circle of radius r, which fails the vertical line test. A parametric function gives x and y separately in terms of a third variable: x(t) = r cos t and y(t) = r sin t. A vector function packs the same pair into one vector: r(t) = (r cos t, r sin t). A complex function uses the real and the imaginary part as x and y: z(t) = r ejt. In all three, each value of t gives exactly one point. So the new variable t removes the problem, and t runs from 0 to 2π for one full turn.

  • A function of x gives one y for each x : curves B and C break this rule, so y = f(x) cannot describe them.
  • A parameter t fixes the problem : x(t) and y(t) give one point for each t, whatever shape the curve has.
  • Parametric, vector and complex forms are the same idea : they differ only in how the pair x(t), y(t) is written.

Examples of Line Integral

Here goes some examples for Line Integral. I would suggest you pay very careful attention to each steps and make it sure that you understand the meaning of each steps. Just memorizing the mathematical operation would not help you much and you would get confused within a couple of days.

Both examples follow the same four steps. First, write the integral in terms of ds. Second, describe the curve with a parameter t. Third, rewrite ds with dt. Fourth, compute an ordinary integral in t.

Example 1 - Arc Length

The first example has no vector field at all. The quantity to sum is 1, so the line integral simply adds up the lengths of the small pieces of the curve.

The question is this example is "Calculate the length of the following red curve (half circle) using Line Integral".

 

Right half of a circle of radius 2 drawn in red

Figure 4. The curve is the right half of a circle of radius 2, from the bottom at (0, -2) to the top at (0, 2).

First, think about how to approach this problem and how to come up with mathematical equation for this problem.

The first step is to devide the curve into a lot of small segments as shown below.

 

Red half circle divided into small segments ds

Figure 5. The curve cut into small segments. Each segment has the length ds.

Here, the ds represents the length of each segment. So the solution to our questions is to integrate ds along the whole curve. It can be represented as shown below.

 

Line integral of ds over C equals line integral of 1 times ds

Once you come up with the mathematical equation in the line integral, next step is to think about how to represent the curve in mathematical form.

 

Question: how do we represent the curve in the form of function

There can be many ways to do it, but I like to use parametric function to represent the curve. This example, the curve can be represented as shown below. Note that we represented two variable x,y with a single variable 't'.

    Parametric form x(t) = 2cos(t), y(t) = 2sin(t) of the half circle

Figure 6. The half circle in parametric form. The red half is covered when t runs from -π/2 to π/2.

Since we have the function for the curve using the variable t, we have to convert our original 'integral expression' into the one using the variable t. The first step for this is to convert ds into a form using dt. This step is the most difficult part of line integral but usually textbook or math class would not explain about this process in detail. The best way is to represent the 'ds' in a picture. In case of this example, ds can be represented as shown below. Note as well that how dx, dy is represented here.

    Small segment ds between points at t and t + dt with its dx and dy legs

Figure 7. One small segment enlarged. The segment ds is the hypotenuse of a right triangle with legs dx and dy.

Since ds is the length of a line segment, it can be describe as follows using dx, dy.

    ds equals the square root of dx squared plus dy squared

Now you have to think about how to convert this ds into a form using dt. This is also very tricky part and it requires some mathematical trick. Only making a lot of practice would make you familiar with this process. There is no single/solid method for this. In case of this example, we convert as shown below.

    Conversion of ds into the form square root of x'(t) squared plus y'(t) squared times dt, which gives 2 dt

Figure 8. Rewriting ds with dt. For this circle, ds = 2 dt, because the radius is 2.

Now we have converted ds into a form using dt. If you plug this result into the original integral equation, you would get the new integral equation with 'dt' as shown below.

    Integral of 1 times 2 dt from minus pi over 2 to pi over 2

Figure 9. The line integral becomes an ordinary integral of the constant 2 over t from -π/2 to π/2.

The last step is left to the reader in the picture, so let's finish it. The integral of the constant 2 over an interval of length π is 2*π = 2π. This is the length of the red curve. You can check it without calculus: a full circle of radius 2 has the length 2πr = 4π, and the red curve is half of it.

Notice what made the example easy. The expression √(x'(t)2 + y'(t)2) is the speed at which the point moves along the curve as t increases. On a circle of radius 2 this speed is the constant 2. On an ellipse it changes with t, and the same arc length integral has no closed form in elementary functions.

Example 2 - Line Integral of Vector Field

Now we have an example doing line integral in vector field. We were give a vector field as shown below and want to integrate the field over the red oval. If you are not familiar with vector field, see the vector field page first.

    Vector field F(x,y) = (y, -x) with a red ellipse

Figure 10. The vector field F(x,y) = <y, -x> and the red ellipse. The arrows turn clockwise around the origin.

First, let's think about how to describe the curve into a mathematical form. It can be represented into a parametric function as shown below. Here I combined two equation(x(t),y(t)) into a single fuction c(t). This is just for simplicity.

    Parametric form c(t) = (0.5cos(t), 0.75sin(t)) of the ellipse

Figure 11. The ellipse in parametric form, with half axes 0.5 along x and 0.75 along y. As t runs from 0 to 2π, c(t) goes around it once counterclockwise.

Now we can represent our problem into a mathematical form as shown below. (The 'dot' in the equation means 'inner product').

    Line integral of F dot ds over C

Since we have the function for the curve using the variable t, we have to convert our original 'integral expression' into the one using the variable t. The first step for this is to convert the vector ds into a form using dt. This step is the most difficult part of line integral but usually textbook or math class would not explain about this process in detail. The best way is to represent the 'ds' in a picture. In case of this example, ds can be represented as shown below. Note as well that how the vector dx, dy is represented here.

    Small vector ds along the ellipse with its components dx and dy and the field vector F(c(t))

Figure 12. One small step along the ellipse. The vector ds has the components dx and dy, and the field vector F(c(t)) acts at the same point.

Since ds is a vector, we can represent the vector ds as shown below.

    ds equals the vector of dx and dy

Now you have to think about how to convert this ds into a form using dt. This is also very tricky part and it requires some mathematical trick. Only making a lot of practice would make you familiar with this process. There is no single/solid method for this. In case of this example, we convert as shown below.

    ds rewritten as c'(t) dt

Figure 13. The vector ds is the derivative c'(t) times dt, so it points along the tangent of the curve.

Now we have converted ds into a form using dt. If you plug this result into the original integral equation, you would get the new integral equation with 'dt' as shown below.

    Line integral of F dot ds rewritten as an integral from 0 to 2 pi of F(c(t)) dot c'(t) dt

Figure 14. The line integral becomes an ordinary integral over t from 0 to 2π.

Just plug in the vector field function and curve function into this equation and solve the equation. You would get the following answer and this is easy step.

    Worked evaluation of the line integral, ending in -0.375 pi

Figure 15. The worked evaluation. The coefficient 0.1875 in the third line is wrong, and the correct result is -0.75π, as shown below.

Let's check the third line of the calculation. F(c(t)) is (0.75 sin t, -0.5 cos t), and c'(t) is (-0.5 sin t, 0.75 cos t). Their inner product is -0.375 sin2t - 0.375 cos2t, because 0.75*0.5 = 0.375. The picture writes 0.1875 instead, which is half of the right value. So the integrand is the constant -0.375, and the result is -0.375*2π = -0.75π, about -2.356. A symbolic computation of the same integral gives -3π/4, which is the same number.

Green's theorem gives an independent check. For a field (P, Q) and a closed curve walked counterclockwise, the circulation equals the integral of Qx - Py over the enclosed area. Here P = y and Q = -x, so Qx - Py = -1 - 1 = -2 everywhere. The ellipse has the area π * 0.5 * 0.75 = 0.375π. So the circulation is -2 * 0.375π = -0.75π, the same value. The result is negative because the field turns clockwise while c(t) goes around counterclockwise.

  • Arc length is a line integral of 1 : the half circle of radius 2 has the length 2π.
  • ds becomes c'(t) dt : for a length, you use its size √(x'(t)2 + y'(t)2) dt, and for a vector field, you use the vector itself.
  • The circulation in Example 2 is -0.75π : the picture shows -0.375π because of a halved coefficient.
  • Check a closed line integral with Green's theorem : it turns the circulation into an area integral, which is often easier.