Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

HCMUT, Group 3 Calculus 2, Project 1

Theory- Solving- Matlab

1
HCMUT, Group 3 Calculus 2, Project 1

Chapter 1: Introduction
- In this project, there are three problems from the Calculus 2 Project that are
relevant to our theoretical lessons. Based on what we have learned and understood,
we will illustrate how to solve the issues and explain all underlying theories using
our knowledge of Calculus 2.

1.2. Chapters:
- Content report will consist of 3 chapters:
1. Introduction.
2. Main part:
A. Triple Integrals
B. Line Integral
C. Surface Integral
3. Result.
4. References

2
HCMUT, Group 3 Calculus 2, Project 1

Chapter 2: Main parts


A. Triple Integrals:
I. Theory:
- It can be difficult to visualize what a triple integral represents. Through triple
integrals, we can now extend our understanding of iterated integrals to
expressions and functions with three variables. We can use triple integrals to
calculate the volume and mass of different objects- which are important
components we need in physics, structural engineering, and other fields.
Therefore, understanding triple integrals are important if we want to work with
setups where there are now three variable components.[1]
- What are triple integrals representing? Triple integrals represent the iterated
functions with three variables. Instead of integrating our function over a given
area, we’re now integrating it over a three-dimensional figure that has volume.
- So, what is a triple integral? A triple integral is an iterated integral with three
variables over a three-dimensional region. We can treat the triple integrals
definition as an extension of that of the double integrals. But this time, we’re
integrating over a volume instead of an area.[2]
- Similar to double integrals, we can start with simple triple integrals. Imagine
that we have a rectangular space. Dividing the rectangular space into smaller
boxes with the following dimensions: △ 𝑥.△ 𝑦.△ 𝑧. Adding the volume up and
taking the volume’s limit will return triple integrals shown below:

∭𝑓(𝑥, 𝑦, 𝑧) 𝑑𝑉
𝑆

- Keep in mind that for the triple integral to exist for the region𝑆, 𝑓(𝑥, 𝑦, 𝑧)
must be continuous and integrated. Let’s say we are integrating over the box
with the following bounds:

𝑆 = [𝑎, 𝑏]. [𝑐, 𝑑]. [𝑚, 𝑛]

3
HCMUT, Group 3 Calculus 2, Project 1

- For this case, [𝑎, 𝑏] represents the limits with respect to𝑥, [𝑐, 𝑑] are the limits
for𝑦, and are the limits for𝑧. We can write the triple integral of 𝑓(𝑥, 𝑦, 𝑧) bound
by the box, 𝑆,s shown below:

𝑛 𝑑 𝑏
∭𝑓(𝑥, 𝑦, 𝑧)𝑑𝑉 = ∫ ∫ ∫ 𝑓(𝑥, 𝑦, 𝑧)𝑑𝑥𝑑𝑦𝑑𝑧
𝑆 𝑚 𝑐 𝑎

II. Application:
1. Using triple integrals to calculate the volume of an
object:
- We can use triple integrals to solve for the volume of a solid three-
dimensional object. The volume formula is:

𝑉 = ∭ 𝑓(𝑥, 𝑦, 𝑧)𝑑𝑉
𝐸

(where f ( x, y, z ) represents the solid object. Replacing 𝑑𝑉 with 𝑑𝑥, 𝑑𝑦, 𝑑𝑧.

- We can integrate in any order, so we’ll try to integrate in whichever order is


easiest, depending on the limits of integration, which we’ll find by analyzing
the object 𝐸. [1]
- Set up the integral of f (x, y, z) over W, the solid “ice cream cone” bounded by
the cone:

𝑧 = √𝑥 2 + 𝑦 2 and the half-sphere = √1 − 𝑥 2 − 𝑦 2 , pictured below:

4
HCMUT, Group 3 Calculus 2, Project 1

Solution:
- We'll use the shadow method to set up the bounds on the integral. This means
we'll write the triple integral as a double integral on the outside and a single
integral on the inside of the form:
𝑡𝑜𝑝
∫∫ ∫ 𝑓(𝑥, 𝑦, 𝑧)
𝑠ℎ𝑎𝑑𝑜𝑤 𝑏𝑜𝑡𝑡𝑜𝑚

- We'll let the z-axis be the vertical axis so that the cone 𝑧 = √𝑥 2 + 𝑦 2 is the
bottom and the half-sphere 𝑧 = √1 − 𝑥 2 − 𝑦 2 is the top of the ice cream
cone W. Hence, W is the region between these two surfaces:

√𝑥 2 + 𝑦 𝑧 ≤ 𝑧 ≤ √1 − 𝑥 2 − 𝑦 2
- These inequalities give the range of z as a function of x and y and thus form
the bounds of the inner integral, which will be an integral with respect to z of
the form:

𝑡𝑜𝑝 √1−𝑥 2 −𝑦 2
∫ 𝑓(𝑥, 𝑦, 𝑧)𝑑𝑧 = ∫ 𝑓(𝑥, 𝑦, 𝑧)𝑑𝑧
𝑏𝑜𝑡𝑡𝑜𝑚 √𝑥 2 +𝑦 2

- The whole region W is the set of points satisfying the


inequalities (1) while x and y range over the shadow of the ice cream cone that
is parallel to the xy-plane, as illustrated by the cyan circle below:

5
HCMUT, Group 3 Calculus 2, Project 1

- Ice cream cone region with shadow. The ice cream cone region is bounded
above by the half-sphere 𝑧 = √1 − 𝑥 2 − 𝑦 2 and bounded below by the cone
𝑧 = √𝑥 2 + 𝑦 2 .The two surfaces intersect along a circle defined by x2 + y 2 =
1/2 and z = 1/√2, which is the widest part of the ice cream cone. Therefore, the
shadow of the ice cream cone region parallel to the xy-plane is the disk of
radius 1/√2 described by x2 + y 2 ≤ 1/2.

- The shadow parallel to the xy-plane is the maximal range of x and y over all
points inside W. Inside the ice cream cone, the maximal range of x and y occurs
where the two surfaces meet, i.e., where the “ice cream” (the half-sphere) meets
the cone. From the figure, you can see that the surfaces meet in a circle, and the
range of x and y is the disk that is the interior of that circle.

- The surfaces meet when √𝑥 2 + 𝑦 2 = √1 − 𝑥 2 − 𝑦 2 , which means


x2 + y2 = 1 − x2 − y2 or x2 + y2 = 1/2. In other words, for any point (x,y,z) in the
ice cream cone, the inequality
x2 + y2 ≤ 1/2

is satisfied. This inequality describes the shadow of the ice cream cone, which
is the set of points (x,y) that lie in a disk of radius 1/√2, as illustrated below.

6
HCMUT, Group 3 Calculus 2, Project 1

2. Using triple integrals to calculate the mass of an object:

- Suppose we have a solid occupying a region 𝑈. Its volume density at a point is


given by the function𝜌(𝑥, 𝑦, 𝑧).

- Then the mass of the solid 𝑚 is expressed through the triple integral as

m =  f ( x, y, z )dxdydz
U

Example: A cube has sides of length4. Let one corner be at the origin and the
adjacent corners be on the positive 𝑥, 𝑦 and 𝑧 axis.

- If the cube’s density is proportional to the distance from the 𝑥𝑦 - plane. Find
its mass.

Solution:
- The density of the cube is 𝑓(𝑥, 𝑦, 𝑧) = 𝑘𝑧 for some constant 𝑘. If 𝑊 is the
cube, the mass is the triple integrals

7
HCMUT, Group 3 Calculus 2, Project 1

 W
kzdV
4 4 4
=  kzdxdydz
0 0 0

=
4 
4 4

0 0  kxz 0  dydz
4 4
=  4kzdydz
0 0

=   4kzy dz
4 4

0
 0

4
=  16kzdz
0
4
2
= 8kz = 128k
0

- If distance is in cm and 𝑘 = 1 gram per cubic cm per cm, then the mass of the
cube is 128 grams.

III. Code on Matlab

1. Using triple integrals to calculate the mass of an object:


% Constants

a = input('Enter the length of the side of the cube: '); % Length of the cube's sides

k = 1; % Proportionality constant for density

% Define the density function


density = @(x, y, z) k * z;

% Define the limits of integration


xmin = 0;
xmax = a;
ymin = 0;
ymax = a;
zmin = 0;
zmax = a;

% Define the integrand function


integrand = @(x, y, z) density(x, y, z);

% Calculate the mass using triple integrals


mass = integral3(integrand, xmin, xmax, ymin, ymax, zmin, zmax);

8
HCMUT, Group 3 Calculus 2, Project 1

% Display the mass of the cube


disp(['The mass of the cube is ' num2str(mass) ' grams.']);

% Create a meshgrid for the cube


[X, Y, Z] = meshgrid(xmin:a/10:xmax, ymin:a/10:ymax, zmin:a/10:zmax);

% Evaluate the density function over the meshgrid


D = density(X, Y, Z);

% Plot the cube with bold edges


b = a; %inner square of the hollow beam for casting
l = a;

x = [0 b b 0 ]; %0 10 10 breadth-10 breadth-10 10];


y = [0 l];
z = [0 0 b b ]; %0 10 10 breadth-10 breadth-10 10];

m = length(x);
xr=[x x(1)];
yr1=y(1)*ones(m+1,1);
zr=[z z(1)];
plot3(xr,yr1,zr,'k');
hold on
yr2=y(2)*ones(m+1,1);
plot3(xr,yr2,zr,'k');
hold on
for i=1:1:m
plot3([x(i) x(i)],y,[z(i) z(i)],'k');
end
hold on
Result:

9
HCMUT, Group 3 Calculus 2, Project 1

10
HCMUT, Group 3 Calculus 2, Project 1

B. Line Integral:
I. Theory:
- A line integral is a type of integral in calculus that is used to calculate the total
value of a scalar or vector field along a curve or path in space. The curve is
typically defined by a set of parametric equations, and the line integral is
calculated by integrating the function over the curve with respect to arc length.
- A line integral gives us the ability to integrate multivariable functions and
vector fields over arbitrary curves in a plane or in space. There are two types of
line integrals: scalar line integrals and vector line integrals. Scalar line integrals
are integrals of a scalar function over a curve in a plane or in space. Vector line
integrals are integrals of a vector field over a curve in a plane or in space. Let’s
look at scalar line integrals first.

II. Scalar Line Integral:


- A scalar line integral is defined just as a single-variable integral is defined,
except that for a scalar line integral, the integrand is a function of more than one
variable and the domain of integration is a curve in a plane or in space, as
opposed to a curve on the x-axis.
- For a scalar line integral, we let C be a smooth curve in a plane or in space and
let 𝑓 be a function with a domain that includes C. We chop the curve into small
pieces. For each piece, we choose point P in that piece and evaluate 𝑓 at P. (We
can do this because all the points in the curve are in the domain of 𝑓 .) We
multiply 𝑓(𝑃) by the arc length of the piece s, add the product 𝑓(𝑃) s over
all the pieces, and then let the arc length of the pieces shrink to zero by taking a
limit. The result is the scalar line integral of the function over the curve.
- For a formal description of a scalar line integral, let 𝐶 be a smooth curve in

space given by the parameterization 𝒓 (𝒕) =< 𝒙(𝒕), 𝒚(𝒕), 𝒛(𝒕) >, 𝒂 ≤ 𝒕 ≤ 𝒃.
Let 𝑓(𝑥, 𝑦, 𝑧) be a function with a domain that includes curve 𝐶. To define the

line integral of the function 𝑓 over ∫𝐶 𝑓(𝑥, 𝑦, 𝑧)𝑑𝑠 = 𝑙𝑖𝑚 ∑𝑛
𝑖=1 𝑓(𝑃𝑖 )𝛥𝑠𝑖 ,
𝑛→∞
we begin as most definitions of an integral begin: we chop the curve into small
pieces. Partition the parameter interval [a, b] into subintervals [t i-l, ti] of equal
width for, where t0= a and tn= b (picture below). Let ti* be a value in the ith
11
HCMUT, Group 3 Calculus 2, Project 1

⇀ ⇀ ⇀
interval [ti-l, ti]. Denote the endpoints of 𝒓 (𝑡0 ), 𝒓 (𝑡1 ), . . . , 𝒓 (𝑡𝑛 ) by P0, …, Pn.
Points Pi divide curve 𝐶 into n pieces 𝐶1, 𝐶2, … , 𝐶𝑛 with lengths Δs1, Δs2, …,
sn, respectively. Let Pi* denote the endpoint of 𝑟⃗(ti*) for 1≤ i ≤n. Now, we
evaluate the function 𝑓 at point Pi* for 1≤ i ≤n. Note that Pi* is in piece 𝐶1, and
therefore Pi* is in the domain of 𝑓. Multiply 𝑓(Pi*) by the length s1 of 𝐶1,
which gives the area of the “sheet” with base 𝐶1, and height 𝑓(Pi*). This is
analogous to using rectangles to approximate area in a single-variable integral.
Now, we form the sum
𝑛

∑ 𝑓(𝑃𝑖 ∗ )𝛥𝑠𝑖 .
𝑖=1

Curve C has been divided into n pieces, and a point inside each piece has
been chosen.

12
HCMUT, Group 3 Calculus 2, Project 1

1. Definitions:
- Let 𝑓 be a function with a domain that includes the smooth curve 𝐶 that is

parameterized by 𝒓 (𝑡) =< 𝑥(𝑡), 𝑦(𝑡), 𝑧(𝑡) >, 𝑎 ≤ 𝑡 ≤ 𝑏. The scalar line
integral of 𝑓 along 𝐶 is
𝑛

∫ 𝑓(𝑥, 𝑦, 𝑧)𝑑𝑠 = 𝑙𝑖𝑚 ∑ 𝑓(𝑃𝑖 ∗ )𝛥𝑠𝑖


𝐶 𝑛→∞
𝑖=1

if this limit exists ti* and si are defined as in the previous paragraphs). If 𝐶 is a
planar curve, then 𝐶 can be represented by the parametric equations x= x(t), y=
y(t), and a ≤ t ≤ b. If 𝐶 is smooth and 𝑓 (𝑥, 𝑦) is a function of two variables,
then the scalar line integral of along 𝐶 is defined similarly as
𝑛

∫ 𝑓(𝑥, 𝑦)𝑑𝑠 = 𝑙𝑖𝑚 ∑ 𝑓(𝑃𝑖 ∗ )𝛥𝑠𝑖


𝐶 𝑛→∞
𝑖=1

if this limit exists.

1. Calculation:
- Let 𝑓 be a continuous function with a domain that includes the smooth

curve 𝐶 with parameterization 𝒓 (𝑡) =< 𝑥(𝑡), 𝑦(𝑡), 𝑧(𝑡) >, 𝑎 ≤ 𝑡 ≤ 𝑏. Then

𝑏

∫ 𝑓(𝑥, 𝑦, 𝑧)𝑑𝑠 = ∫ 𝑓(𝐫 (𝑡)) = √(𝑥′(𝑡))2 + (𝑦′(𝑡))2 + (𝑧′(𝑡))2 𝑑𝑡.
𝐶 𝑎

- Similarly,
𝑏

∫ 𝑓(𝑥, 𝑦)𝑑𝑠 = ∫ 𝑓(𝐫 (𝑡)) = √(𝑥′(𝑡))2 + (𝑦′(𝑡))2 𝑑𝑡.
𝐶 𝑎

- If 𝐶 is a planar curve and 𝑓is a function of two variables.

13
HCMUT, Group 3 Calculus 2, Project 1

Overall:

- Formulas of type 1 - line integrals:

- In 2 dimensions: If a curve 𝐶 has a parametric equation

x=x(t).

y=y(t).

for a ≤ t ≤b

𝑏
∫ 𝑓(𝑥, 𝑦)𝑑𝑠 = ∫ 𝑓(𝑥(𝑡), 𝑦(𝑡)). √(𝑥′(𝑡))2 + (𝑦′(𝑡))2 𝑑𝑡.
𝐶 𝑎

- In 3 dimensions: If a curve 𝐶 has a parametric equation

x=x(t).

y=y(t).

z=z(t).

for a ≤ t ≤b
𝑏
∫ 𝑓(𝑥, 𝑦, 𝑧)𝑑𝑠 = ∫ 𝑓(𝑥(𝑡), 𝑦(𝑡), 𝑧(𝑡)). √(𝑥′(𝑡))2 + (𝑦′(𝑡))2 + (𝑧′(𝑡))2 𝑑𝑡.
𝐶 𝑎

14
HCMUT, Group 3 Calculus 2, Project 1

III. Vector Line Integral:


- The second type of line integrals are vector line integral, in which we integrate
along a curve through a vector field. For example, let:
⇀ ⇀ ⇀ ⇀
𝐹 (𝑥, 𝑦, 𝑧) = 𝑃(𝑥, 𝑦, 𝑧) 𝑖 + 𝑄(𝑥, 𝑦, 𝑧) 𝑗 + 𝑅(𝑥, 𝑦, 𝑧)𝑘 .
be a continuous vector field in R3 that represents a force on a particle and let
𝐶 be a smooth curve in R3 contained in the domain of ⃗⃗⃗⃗
𝐹 . How would we
compute the work done by ⃗⃗⃗⃗
𝐹 in moving a particle along 𝐶 ?
- To answer this question, first note that a particle could travel in two directions
along a curve: a forward direction and a backward direction. The work done by
the vector field depends on the direction in which the particle is moving.
Therefore, we must specify a direction along curve 𝐶; such a specified direction
is called an orientation of a curve. The specified direction is the positive
direction along 𝐶; the opposite direction is the negative direction along 𝐶.
When 𝐶 has been given an orientation, 𝐶 is called an oriented curve. The work
done on the particle depends on the direction along the curve in which the
particle is moving.

- A closed curve is one for which there exists a parameterization 𝑟 (𝑡), 𝑎 ≤ 𝑡 ≤
𝑏, such that 𝑟⃗(𝑎) = 𝑟⃗⃗⃗(𝑏) and the curve is traversed exactly once. In other
words, the parameterization is one-to-one on the domain (a, b).

- Let 𝑟⃗(t) be a parameterization of 𝐶 for a ≤ t ≤ b such that the curve is traversed


exactly once by the particle and the particle moves in the positive direction
along 𝐶. Divide the parameter interval [a, b] into n subintervals [ti−1, ti], 0 ≤ i ≤
n, of equal width. Denote the endpoints of r(t0), r(t1), …, r(tn) by P0, …, Pn.
Points Pi divide 𝐶 into n pieces. Denote the length of the piece from Pi−1 to Pi by
15
HCMUT, Group 3 Calculus 2, Project 1

Δsi. For each i, choose a value ti* in the subinterval [ti−1, ti]. Then, the endpoint
𝑟 ti*) is a point in the piece of 𝐶 between Pi−1 and Pi. If Δsi is small, then as
of⃗⃗⃗⃗(
the particle moves from Pi−1 to Pi along 𝐶, it moves approximately in the
direction of 𝑇 ⃗⃗.(Pi), the unit tangent vector at the endpoint of 𝑟⃗ (ti*). Let Pi*
denote the endpoint of 𝑟⃗⃗⃗( ti*). Then, the work done by the force vector field in
moving the particle from Pi−1 to Pi is ⃗⃗⃗⃗
𝐹 ( Pi*) ⋅ (si. ⃗⃗⃗⃗
𝑇 . (Pi*)), so the total work
done along 𝐶 is
𝑛 𝑛
⇀ ⇀ ⇀ ⇀
∑ 𝐹 (𝑃𝑖 ). (𝛥𝑠𝑖 𝑇( 𝑃𝑖 )) = ∑ 𝐹 (𝑃𝑖 ). 𝑇( 𝑃𝑖 ∗ )𝛥𝑠𝑖 .
∗ ∗ ∗

𝑖=1 𝑖=1

- Curve 𝐶 is divided into n pieces, and a point inside each piece is chosen. The
dot product of any tangent vector in the ith piece with the corresponding vector
⃗⃗⃗⃗is approximated by 𝐹⃗ ( Pi* ). . 𝑇
𝐹 ⃗⃗⃗⃗( Pi* ).

- Letting the arc length of the pieces of C get arbitrarily small by taking a limit
as n→∞ gives us the work done by the field in moving the particle along 𝐶.
Therefore, the work done by ⃗⃗⃗⃗
𝐹 in moving the particle in the positive direction
along 𝐶 is defined as

16
HCMUT, Group 3 Calculus 2, Project 1

⇀ ⇀
𝑊 = ∫𝐹 . 𝑇. 𝑑𝑠
𝐶

which gives us the concept of a vector line integral.

1. DEFINITION: Line Intergral of a vector field


- The vector line intergral of vector field ⃗⃗⃗⃗
𝐹 along oriented smooth curve 𝐶 is
𝑛
⇀ ⇀ ⇀ ⇀
∫ 𝐹 . 𝑇𝑑𝑠 = 𝑙𝑖𝑚 ∑ 𝐹 (𝑃𝑖 ∗ ). 𝑇( 𝑃𝑖 ∗ )𝛥𝑠𝑖
𝐶 𝑥→∞
𝑖=1

If that limit exists.

- With scalar line integrals, neither the orientation nor the parameterization of
the curve matters. As long as the curve is traversed exactly once by the
parameterization, the value of the line integral is unchanged. With vector line
integrals, the orientation of the curve does matter. If we think of the line
integral as computing work, then this makes sense: if you hike up a mountain,
then the gravitational force of Earth does negative work on you. If you walk
down the mountain by the exact same path, then Earth’s gravitational force does
positive work on you. In other words, reversing the path changes the work value
from negative to positive in this case. Note that if 𝐶 is an oriented curve, then
we let −𝐶 represent the same curve but with opposite orientation.

- As with scalar line integrals, it is easier to compute a vector line integral if we


express it in terms of the parameterization function 𝑟⃗⃗⃗ and the variable 𝑡. To
⇀ ⇀
translate the integral ∫𝐶 𝐹 . 𝑇𝑑𝑠 in terms of 𝑡, note that unit tangent
⇀ ⇀
𝑟 ′(𝑡) ⇀
vector ⃗⃗⃗⃗
𝑇 along 𝐶 is given by 𝑇 = ⇀ (assuming ||𝑟 ′(𝑡)|| ≠ 0 ) Since 𝑑𝑠
||𝑟 ′(𝑡)||

= ||𝑟 ′(𝑡)||𝑑𝑡, as we saw when discussing scalar line integrals, we have

17
HCMUT, Group 3 Calculus 2, Project 1


⇀ ⇀ ⇀ ⇀ 𝑟 ′(𝑡) ⇀ ⇀ ⇀ ⇀
∫𝐹 . 𝑇𝑑𝑠 = 𝐹 (𝑟 (𝑡)). ⇀ . ||𝑟 ′(𝑡)||𝑑𝑡 = 𝐹 (𝑟 (𝑡)). 𝑟 ′(𝑡)𝑑𝑡
𝐶 ||𝑟 ′(𝑡)||

2. Properities:
Let ⃗⃗⃗⃗ ⃗⃗⃗⃗ be continuous vector fields with domains that include the oriented
𝐹 and 𝐺
smooth curve 𝐶. Then
⇀ ⇀ ⇀ ⇀ ⇀ ⇀ ⇀
1. ∫𝐶 (𝐹 + 𝐺 ). 𝑑𝑟 = ∫𝐶 𝐹 . 𝑑𝑟 + ∫𝐶 𝐺. 𝑑𝑟
⇀ ⇀
2. 𝑘 ∫𝐶 𝐹 . 𝑑𝑟 , where 𝑘 is a constant.
⇀ ⇀ ⇀ ⇀
3. ∫𝐶 𝐹 . 𝑑𝑟 = ∫−𝐶 𝐹 . 𝑑𝑟

4. Suppose instead that 𝐶 is a piecewise smooth curve in the domains of ⃗⃗⃗⃗


𝐹 and
⃗⃗⃗⃗
𝐺 where 𝐶 = 𝐶1 + 𝐶2 + ⋯ + 𝐶𝑛 and 𝐶1, 𝐶2, … , 𝐶𝑛 are smooth curves such
that the endpoint of 𝐶𝑖 is the starting point of 𝐶𝑖 + 1. Then
⇀ ⇀ ⇀ ⇀ ⇀ ⇀ ⇀ ⇀
∫𝐹 . 𝑑𝑟 = ∫ 𝐹 . 𝑑𝑟 + ∫ 𝐹 . 𝑑𝑟 +. . . + ∫ 𝐹 . 𝑑𝑟 .
𝐶 𝐶1 𝐶2 𝐶𝑛

18
HCMUT, Group 3 Calculus 2, Project 1

3. Vector Field Line Integral Calculation


Formulas of type 2 - line integrals:

In 2 dimensions:
⃗⃗⃗⃗(𝑥, 𝑦) = (𝑃(𝑥, 𝑦), 𝑄(𝑥, 𝑦)) then
if ( 𝐹
⇀ 𝑏

∫𝐹 . 𝑑𝑟 = ∫ [𝑃(𝑥(𝑡), 𝑦(𝑡)). 𝑥′(𝑡) + 𝑄(𝑥(𝑡), 𝑦(𝑡)). 𝑦′(𝑡)]. 𝑑𝑡
𝐶 𝑎

where 𝐶 is of equation:
x= x(t)
y= y(t)
a≤t≤b

In 3 dimensions:
if ( ⃗⃗⃗⃗
𝐹 (𝑥, 𝑦, 𝑧) = (𝑃(𝑥, 𝑦, 𝑧), 𝑄(𝑥, 𝑦, 𝑧), 𝑅(𝑥, 𝑦, 𝑧) then
⇀ 𝑏

∫𝐹 . 𝑑𝑟 = ∫ [𝑃(𝑥(𝑡), 𝑦(𝑡), 𝑧(𝑡)). 𝑥′(𝑡) + 𝑄(𝑥(𝑡), 𝑦(𝑡), 𝑧(𝑡)). 𝑦′(𝑡)
𝐶 𝑎
+ 𝑅(𝑥(𝑡), 𝑦(𝑡), 𝑧(𝑡)). 𝑧′(𝑡)]. 𝑑𝑡

where 𝐶 is of equation:
x= x(t)
y= y(t)
z= z(t)
a≤t≤b

19
HCMUT, Group 3 Calculus 2, Project 1

III. Application of line intergral in physics

1. Center of Mass and Moments of Inertia of a Wire


- Let a wire is described by a curve 𝐶 with a continuous density function
𝑝(𝑥, 𝑦, 𝑧) . The coordinates of the center of mass of the wire are defined as

Myz Mxz Mxy


x = , y = , z =
m m m

where

𝑀𝑦𝑧 = ∫𝑥𝑝(𝑥, 𝑦, 𝑧)𝑑𝑠


𝐶

𝑀𝑥𝑧 = ∫𝑦𝑝(𝑥, 𝑦, 𝑧)𝑑𝑠


𝐶

𝑀𝑥𝑦 = ∫𝑧𝑝(𝑥, 𝑦, 𝑧)𝑑𝑠


𝐶

are so-called first moments.


- The moments of inertia about the x-axis, y-axis and z-axis are given by the
formulas
𝐼𝑥 = ∫𝐶 (𝑦 2 + 𝑧 2 ). 𝑝(𝑥, 𝑦, 𝑧)𝑑𝑠 , 𝐼𝑦 = ∫𝐶 (𝑥 2 + 𝑧 2 ). 𝑝(𝑥, 𝑦, 𝑧)𝑑𝑠 , 𝐼𝑧 =
∫𝐶 (𝑥 2 + 𝑦 2 ). 𝑝(𝑥, 𝑦, 𝑧)𝑑𝑠
- Example: Find the moment of inertia Ix of the circle x2+ y2=42 with the
density p=1.

20
HCMUT, Group 3 Calculus 2, Project 1

Solution:
- The equation of the circle in parametric form is
x= 4.cos(t)
y= 4.sin(t)
0 ≤ t ≤ 2π
- Then the moment of inertia Ix about the x-axis can be calculated by the
formula

2𝜋
𝑑𝑥 2 𝑑𝑦
𝐼𝑥 = ∫𝑦 2 . 𝑝𝑑𝑠 = ∫ (𝑦(𝑡))2 . 𝑝(𝑥(𝑡), 𝑦(𝑡))√( ) + ( )2 𝑑𝑡.
𝐶 0 𝑑𝑡 𝑑𝑡

So, we have
2𝜋
𝑑(4 𝑐𝑜𝑠 𝑡) 2 𝑑(4 𝑠𝑖𝑛 𝑡) 2
𝐼𝑥 = ∫ (4 𝑠𝑖𝑛 𝑡)2 . 1. ( ) +( ) 𝑑𝑡
0 𝑑𝑡 𝑑𝑡
2𝜋
= ∫ 42 𝑠𝑖𝑛2 𝑡 √(−4 𝑠𝑖𝑛 𝑡)2 + (4 𝑐𝑜𝑠 𝑡)2 𝑑𝑡
0
2𝜋 2𝜋
3 2
= ∫ 4 𝑠𝑖𝑛 𝑡 √𝑠𝑖𝑛2 𝑡 + 𝑐𝑜𝑠 2 𝑡 . 𝑑𝑡 = 4 ∫ 𝑠𝑖𝑛2 𝑡 𝑑𝑡
3
0 0
2𝜋
3
1 − 𝑐𝑜𝑠 2 𝑡 43 2𝜋
=4 ∫ . 𝑑𝑡 = ∫ (1 − 𝑐𝑜𝑠 2 𝑡)𝑑𝑡 = 2𝜋43
0 2 2 0

2. Faraday's Law: Finding The electromotive force 𝜺


- The electromotive force  induced around a closed loop 𝐶 is equal to the rate
of the change of magnetic flux  passing through the loop.

d
 =  Edr = −
C
dt
21
HCMUT, Group 3 Calculus 2, Project 1

Example:
- Evaluate the maximum electromotive force 𝜀 and the electric field 𝐸 induced
in a finger ring of radius 1cm when the passenger flies on an airplane in the
magnetic field of the Earth with the velocity of 900km/h.

Solution:
According to Faraday's law,
𝑑𝜓
𝜀 = ∮ 𝐸𝑑𝑟 = − .
𝐶 𝑑𝑡
- As the conducting ring moves through the Earth's magnetic field, there is a
change in the magnetic flux  , passing through the ring.
- Suppose that the magnetic field 𝐵 is perpendicular to the plane of the ring.
Then change in the flux for the time t is:
𝛥𝜓 = 2𝑟𝐵𝑥 = 2𝑟𝐵𝑣𝛥𝑡,

22
HCMUT, Group 3 Calculus 2, Project 1

where x= 𝑣.t, 𝑣 is the velocity of the airplane, 𝐵 is the magnetic field of the
Earth. It follows from the last expression that
𝑑𝜓
𝜀=− = 2𝑟𝐵𝑣
𝑑𝑡
- Substituting the given values: 𝑣 =900km/h, r= 0.01m, 𝐵=5x10-5T
- We obtain the electromotive force:

𝜀 = 2𝑟𝐵𝑣 = 2.0,01.5𝑥10−5 . 900 = 0,00009𝑉


- As one can see, it's safe for human.
- We can find the electric field in the conducting ring by the formula
𝜀 = ∫𝐸. 𝑑𝑟
𝐶
- By symmetry, the induced electric field will have a constant magnitude along
the ring. Its direction will be tangential to the circle at every point. Hence, the
line integral around the circle is
𝜀 = ∮𝐸. 𝑑𝑟 = ∮ 𝐸. 𝑑𝑟. 𝑐𝑜𝑠 0 = 𝐸 ∮𝑑𝑟 = 2 𝜋𝑟𝐸.
𝐶 𝐶 𝐶
- Hence, the electric field strength is
𝜀 0.00009
𝐸= = = 0.000014(𝑉/𝑚)
2𝜋𝑟 2𝜋. 0,01

23
HCMUT, Group 3 Calculus 2, Project 1

IV. Code on Matlab:


1. Center of Mass and Moments of Inertia of a Wire:
Code:
% Prompt the user to enter the function definition
funcString = input('Enter the function: ', 's');

% Evaluate the function using eval


f = eval(['@(x,y) ' funcString]);

% Define the density function


p= @(x,y) 1;

%Prmopt the user to enter the result of function


result = input('Enter the right result: ');

% Define the limits of integration


x_min = -result;
x_max = result;
y_min = @(x) -sqrt(result.^2 - x.^2);
y_max = @(x) sqrt(result.^2 - x.^2);

% Define the integrand function


integrand = @(x, y) p(x,y) * f(x,y);

% Perform the double integral


Ix = integral2(integrand, x_min, x_max, y_min, y_max);

% Display the moment of inertia


disp('The moment of inertia Ix is: ');
disp(Ix);

Result:

24
HCMUT, Group 3 Calculus 2, Project 1

2. Faraday's Law: Finding The electromotive force 𝜺


%Enter all the vlaue:
r = input('Enter the value of r: ');
v = input ('Enter the value of v: ');
B = input ('Enter the value of B: ');

%Calculate the electromotive force


ef = 2 * r * v * B;

% Display the electromotive force


fprintf('Tthe electromotive force: %.4f\n', ef);

%Caculate the electric field strength


E = ef/ (2*3.14*0.01);

% Display the electric field strength


fprintf('The electric field strength: %.4f\n', E);

25
HCMUT, Group 3 Calculus 2, Project 1

C. Surface Integral:
I. Theory:
- Let be a surface with equation z=f(x, y) , where has continuous partial
derivatives. For simplicity in deriving the surface area formula, we assume that
and the domain of is a rectangle. We divide into small rectangles with area . If
is the corner closest to the origin, let , be the point directly above it. The tangent
plane to at approximates nearby. So, the area of the part of this tangent plane (a
parallelogram) that lies directly above approximates the area of the part of that
lies directly above. Thus, the sum approximates the total area of, and this
approximation appears to improve as the number of rectangles increases.
Therefore, we define the surface area S of to be
1) 𝐴(𝑆) = lim ∑𝑚 𝑛
𝑖=1 ∑𝑗=1 ∆𝑇𝑖𝑗
𝑚,𝑛 →∞

by the definition of a double integral, we get the following formula


2) The area of the surface with equation z=f(x, y), (x,y)𝜖 𝐷, where and are
continuous, is
 
A ( S ) =    f x ( x, y )  +  f y ( x, y )  + 1  dA
2 2

D
 
- We will verify that this formula is consistent with our previous formula for the
area of a surface of revolution. If we use the alternative notation for partial
derivatives, we can rewrite Formula 2 as follows:
2
 z   z 
2

A ( S ) =  1 +   +   dA
D
 x   y 

- Surface integrals are used in multiple areas of physics and engineering. In


particular, they are used for calculations of:
• mass of a shell;
• center of mass and moments of inertia of a shell.
• gravitational force and pressure force.
• fluid flow and mass flow across a surface.

26
HCMUT, Group 3 Calculus 2, Project 1

II. Application
1. Magnetic Flux
- Surface integrals are extremely important in the study of electromagnetics.
They are used to compute values such as electric flux and magnetic flux, which
are critical for understanding the behavior of electric and magnetic fields.
- A magnetic field exists, and it can be mathematically defined by the function
B (x, y, z) = (x^2 + y^2, 2xy, z2). This indicates that the magnetic field has a
certain strength and direction at any location in space defined by its coordinates
(x, y, z) supplied by the components (x^2 + y^2, 2xy, z2).

Answer:
- Magnetic flux through a closed surface

 = ∭ 𝐵 𝑑𝑆

- Unit normal vector:


𝑛̅ = (x, y, z…)

 = ∭ 𝐵𝑛 𝑑𝑉

 = ∭(𝑥 2 + 𝑦 2 , 2𝑥𝑦, 𝑧 2 )(𝑥, 𝑦, 𝑧) 𝑑𝑉

- According to spherical coordinates:


2𝜋 𝜋 1
 = ∫0 ∫1 ∫0 (𝑟 2 𝑠𝑖𝑛2 𝜃𝑐𝑜𝑠 2 𝜑 + 𝑟 2 𝑠𝑖𝑛2 𝜃𝑠𝑖𝑛2 𝜑, 2 𝑟 2 𝑠𝑖𝑛𝜃𝑠𝑖𝑛𝜑, 𝑟 2 𝑐𝑜𝑠 2 𝜃)(𝑟 2 𝑠𝑖𝑛2 𝜃𝑐𝑜𝑠 2 𝜑,
𝑟 2 𝑠𝑖𝑛2 𝜃𝑐𝑜𝑠 2 𝜑, 𝑐𝑜𝑠𝜃)(𝑥𝑟 2 𝑠𝑖𝑛𝜃𝑑𝑟𝑑𝜃𝑑𝜑)

- By calculating, we get the result of magnetic flux is 0.073282.

27
HCMUT, Group 3 Calculus 2, Project 1

2. Gauss Law
- The electric flux D through any closed surface S is proportional to the
charge Q enclosed by the surface:

where D=𝜀𝜀0 𝐸, E is the magnitude of the electric field strength, 𝜀 is


permittivity of material, and 𝜀0 =8.85 × 10−12 𝐹/𝑚 is permittivity of free
space.
- For the discrete case the total charge Q is the sum over all the enclosed
charges. Gauss' Law is a general law applying to any closed surface. For
geometries of sufficient symmetry, it simplifies the calculation of electric field.
Gauss' Law is the first of Maxwell's equations, the four fundamental equations
for electricity and magnetism.

Example:
An infinite sheet has a uniform charge density of 5 μC/m². Calculate the electric
field at a point located 2 cm away from the sheet.
Solution:
Given:
Charge density (σ) = 5 μC/m² = 5 × 10^(-6) C/m²
Distance from the sheet (h) = 2 cm = 0.02 m

- To calculate the electric field using a surface integral, we can apply Gauss's
law as described earlier.
- The cylindrical Gaussian surface has a circular base with a radius larger than
the distance from the sheet (h). This ensures that the entire circular base lies
outside the sheet.

28
HCMUT, Group 3 Calculus 2, Project 1

- The charge enclosed by the Gaussian surface is zero since there is no charge
within the closed surface. This is because an infinite sheet has an infinite extent,
and any finite
- Choose a Gaussian surface that is a cylinder with its axis perpendicular to the
sheet and centered on the point of interest.
- The circular base of the Gaussian surface lies entirely within the sheet.
- Apply Gauss's law, which states that the electric flux (Φ) through a closed
surface is proportional to the charge enclosed by that surface.

Φ = ∮ E · dA = Q_enclosed / ε₀,

where Φ is the electric flux, E is the electric field, dA is an elemental area


vector, Q_enclosed is the charge enclosed by the Gaussian surface, and ε₀ is the
permittivity of free space.
- Since the electric field is constant and perpendicular to the circular base, the
dot product E · dA becomes E * dA.
Φ = E ∮ dA = E * A,
where A is the area of the circular base of the Gaussian surface.

- The charge enclosed by the Gaussian surface is given by Q_enclosed = σ * A,


where σ is the charge density and A is the area of the circular base.

- Substituting Q_enclosed and Φ into the equation, we have:


E * A = σ * A / ε₀.
Solving for E, we find:
E = σ / ε₀.

29
HCMUT, Group 3 Calculus 2, Project 1

- Now, let's substitute the given values into the equation to calculate the electric
field.
E = σ / ε₀
= (5 × 10^(-6) C/m²) / (8.854 × 10^(-12) C²/N·m²)
≈ 5.65 × 10^5 N/C.
- Therefore, the electric field at a point located 2 cm away from the infinite
sheet with a uniform charge density of 5 μC/m² is approximately 5.65 × 10^5
N/C, directed away from the sheet.

IV. Code on Matlab:


1. Magnetic Flux

Code:
% Define the magnetic field function
B = @(x, y, z) [x.^2 + y.^2, 2.*x.*y, z.^2];
% Define the closed surface equation
surface_equation = @(x, y, z) x.^2 + y.^2 + z.^2 - 1;
% Define the number of points for numerical integration
num_points = 100;
% Generate the meshgrid for integration
theta = linspace(0, pi, num_points);
phi = linspace(0, 2*pi, num_points);
[Theta, Phi] = meshgrid(theta, phi);
% Convert to Cartesian coordinates
x = cos(Phi) .* sin(Theta);
y = sin(Phi) .* sin(Theta);
z = cos(Theta);
% Calculate the magnetic flux through the closed surface
flux = 0;
for i = 1:num_points
for j = 1:num_points
flux = flux + dot(B(x(i, j), y(i, j), z(i, j)), [x(i, j), y(i, j), z(i, j)]) *
sin(Theta(i, j)) * (pi/num_points) * (2*pi/num_points);
end
end
% Display the magnetic flux
disp(['Magnetic Flux: ' num2str(flux)]);
% Create the figure
figure;
surf(x, y, z, 'FaceColor', 'none', 'EdgeColor', 'green');
title('Closed Surface');
xlabel('x');
ylabel('y');
zlabel('z');
axis equal;

30
HCMUT, Group 3 Calculus 2, Project 1

Result:

31
HCMUT, Group 3 Calculus 2, Project 1

2. Gauss Law
Code:
% Constants

sigma = 5*(10^-6); % Charge density in C/m^2


epsilon_0 = 8.86*(10^-12); % Permittivity of free space in F/m

% Create a grid of points


[x, y] = meshgrid(-1:0.1:1, -1:0.1:1); % Define the region of interest
z = zeros(size(x)); % Assume the sheet lies in the xy plane

% Calculate the electric field components


E_x = zeros(size(x));
E_y = zeros(size(x));
E_z = zeros(size(x));

% Calculate the electric field at each point


for i = 1:numel(x)
r = [x(i), y(i), z(i)]; % Position vector
r_norm = norm(r);
E_mag = sigma / (2 * epsilon_0);
E = E_mag * r_norm / sqrt(r_norm^2 + h^2);
E_direction = r / r_norm;
E_x(i) = E * E_direction(1);
E_y(i) = E * E_direction(2);
E_z(i) = E * E_direction(3);
end

% Create a quiver plot


figure;
quiver3(x, y, z, E_x, E_y, E_z, 'LineWidth', 1.5);
xlabel('X');
ylabel('Y');
zlabel('Z');
title('Electric Field of an Infinite Sheet');
grid on;
axis equal;

32
HCMUT, Group 3 Calculus 2, Project 1

Result:

Chapter 3: Conclusion
- This project helps us to understand more about the subject – Calculus 2.
Especially, the first exercise provides us with a clear overview of Calculus 2’s
applications in real life. How amazing that the old generations use Math to help
them have a distinguishing and unpredictable message to communicate to each
other. Besides that, we also learn how to use apps to make our learning better,
for example, Matlab helps us perform our project more clearly. With the code,
we can easily calculate an equation containing a large-value variable.

33
HCMUT, Group 3 Calculus 2, Project 1

Chapter 4: References:
[1] Mathinsight- Triple Integral and Examples.
[2] Math24.net Physical Applications of Triple Integrals.
[3] Stewart Calculus 7th Edition.
[4] Mathinsight- Line Integral and Example.
[5] Math24.net Physical Applications of Triple Integrals.
[6] Math24.net Physical Applications of Surface Integrals.
[7] Mathinsight- Surface Integral and Example.

34

You might also like