0% found this document useful (0 votes)
2 views

Calculus2_7_CC14

BTLGT

Uploaded by

vietvvv2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Calculus2_7_CC14

BTLGT

Uploaded by

vietvvv2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

VIETNAM NATIONAL UNIVERSITY HO CHI MINH CITY

HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY


FACULTY OF APPLIED SCIENCE

CAlCULUS 2 (MT1005)

Project Report

INSTRUCTOR: M.S. Lê Thái Thanh


Class: CC14
Group: 7

MEMBERS

Nguyễn Hữu Phước 2352964 100%


Trương Anh Phan 2352881 100%
Đinh Tiến 2353174 100%
La Hoàng Thiên Hải 2352305 100%
Võ Anh Việt 2353325 100%

Ho Chi Minh City, May 2024


Ho Chi Minh City University of Technology
Faculty of Applied Science

ACKNOWLEDGEMENT

First of all, we are grateful to M.S. Lê Thái Thanh for assigning this project and teaching us the
exercise lectures on Calculus 2. Then, we would like to express our gratitude to everyone who assisted
us with their help and guidance in this project; it would not have been possible otherwise. We are proud
to present the result of our research and work. We have made every effort to produce the best outcome,
even though there may be some limitations in our results.

Project Report (MT1005) 2023-2024 Page /15


Ho Chi Minh City University of Technology
Faculty of Applied Science

PREFACE

Calculus is an essential subject for all engineers. The study of change has proven valuable in a variety
of real-world applications. As a result, each engineer must understand not only theory but also how to use
that theory to solve real-world situations. This report has been written to fulfill the Calculus 2 subject
requirement, which is one of the prerequisites for the Calculus 2 final exam. This report focuses on the
use of double integrals to solve problems, with Matlab commands serving as our primary programming
language.

Project Report (MT1005) 2023-2024 Page /15


Ho Chi Minh City University of Technology
Faculty of Applied Science

TABLE OF CONTENTS

1 Assignment 1

1.1 Theory of Double Integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.1.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.1.2 Types of Double Integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.1.3 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.2 Problems and Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.2.1 Problem (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.2.2 Problem (b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

1.2.3 Problem (c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2 Programming 6

2.1 Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2.2 Matlab code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2.3 Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2.3.1 Sample 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2.3.2 Sample 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3 Applications 10

3.1 Applications in Computer Science . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

3.1.1 Image Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

3.1.2 Probability Density Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3.1.3 Surface Area in 3D Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.2 Applications in Mechanics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

3.2.1 Center of Mass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

3.2.2 Moment of Inertia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

Project Report (MT1005) 2023-2024 Page /15


Ho Chi Minh City University of Technology
Faculty of Applied Science

1 Assignment

1.1 Theory of Double Integrals

1.1.1 Definition

A double integral over a region D in the plane is denoted as


ZZ
f (x, y) dA
D

where f (x, y) is the integrand and dA represents the area element.

1.1.2 Types of Double Integrals

• Iterated Integrals: The double integral is expressed as an iterated integral of the form
ZZ Z b Z d
f (x, y) dA = f (x, y) dy dx
D a c

or
ZZ Z dZ b
f (x, y) dA = f (x, y) dx dy
D c a

This method breaks down the double integral into two separate integrals, one with respect to x and
the other with respect to y, and integrates over the respective intervals.

• Polar Coordinates: In certain cases, using polar coordinates can simplify the integration process.
The transformation is given by 
x = r cos(θ)
.
y = r sin(θ)

The area element transforms as dA = r dr dθ, and the limits of integration also change accordingly.

1.1.3 Properties

• Linearity: The double integral is linear, meaning it satisfies the property


ZZ ZZ ZZ
(af (x, y) + bg(x, y)) dA = a f (x, y) dA + b g(x, y) dA
D D D

for constants a and b.

• Change of Order: Under certain conditions, the order of integration can be changed without
affecting the result. This property is useful for simplifying calculations. For example, if f (x, y) is
continuous on a rectangular region D = [a, b] × [c, d], then
ZZ Z b Z d Z d Z b
f (x, y) dA = f (x, y) dy dx = f (x, y) dx dy
D a c c a

• Area Preservation: If f (x, y) is non-negative over D, then the double integral represents the
volume under the surface z = f (x, y) and above D. The value of the double integral gives the
volume.

Project Report (MT1005) 2023-2024 Page 1/15


Ho Chi Minh City University of Technology
Faculty of Applied Science

1.2 Problems and Solutions

Solve the following problems:

(a) Find y ′ and y ′′ of the function y = y(x) given implicitly by ln x2 + y 2 = arctan xy .


p

RR p
(b) Evaluate I = | y − x2 | dx dy where D = {|x| ⩽ 1; 0 ⩽ y ⩽ 2}.
D

x2 y2
(c) Find the area of the part of the sphere x2 + y 2 + z 2 = a2 that lies inside the cylinder a2 + b2 =1
where 0 < b ≤ a.

1.2.1 Problem (a)

Problem

x2 + y 2 = arctan xy
p
Find y ′ and y ′′ of the function y = y(x) given implicitly by ln

Solution

First, differentiate the implicit equation with respect to x:

1 2x + 2yy ′ 1 y ′ .x − y
· p = ·
1 + ( xy )2 x2
p
x2 + y 2 2 x2 + y 2

x + y · y′ = y′ · x − y

y ′ (x − y) = x + y

Simplifying and solving for y ′ :

x+y
y′ =
x−y

Next, differentiate y ′ with respect to x to find y ′′ :

(1 + y ′ )(x − y) − (1 − y ′ )(x + y)
y ′′ =
(x − y)2

x − y + x · y′ − y · y′ − x − y + x · y′ + y · y′
y ′′ =
(x − y)2

−2(y − x · y ′ )
y ′′ =
(x − y)2

Project Report (MT1005) 2023-2024 Page 2/15


Ho Chi Minh City University of Technology
Faculty of Applied Science

1.2.2 Problem (b)

Problem

RR p
Evaluate I = | y − x2 | dx dy where D = {|x| ⩽ 1; 0 ⩽ y ⩽ 2}.
D

Figure 1: Illustration for problem b

Solution

p
This integral represents the area under the curve | y − x2 | over the region D, with
D = {|x| ≤ 1; 0 ≤ y ≤ 2}.

First, we rewrite the integral in terms of the absolute value function:

ZZ p ZZ p ZZ p
|y − x2 | dx dy = (y − x2 ) dx dy + (x2 − y) dx dy
D D1 D2

With D1 = {x2 ≤ y ≤ 2; −1 ≤ x ≤ 1}; D2 = {0 ≤ y ≤ x2 ; −1 ≤ x ≤ 1}

Project Report (MT1005) 2023-2024 Page 3/15


Ho Chi Minh City University of Technology
Faculty of Applied Science

Z 1 Z 2 p Z 1 Z x2 p
I= y− x2 dy dx + x2 − y dy dx
−1 x2 −1 0
Z 1 Z 1
2 3 2 3
= (2 − x2 ) 2 dx + (x2 ) 2 dx
3 −1 3 −1
1
2 1
Z Z
2 2 3
= (2 − x ) dx + 2 |x|3 dx
3 −1 3 −1
Z 1 Z 1 
2 3
= (2 − x2 ) 2 dx + |x|3 dx
3 −1 −1

Z 1
3
Denote A = (2 − x2 ) 2 dx
−1
Z 1
3
A=2 (2 − x2 ) 2 dx
0
√ π
x= 2 sin t, with 0 ≤ t ≤
4
π
√ Z 4 3
A=2 2 (2 − 2(sin t2 )) 2 cos t dt
0
Z π
4
= 8(cos t)4 dt
0
3·π+8
=
32

Z 1
Denote B = |x|3 dx
−1
Z 1
B=2 x3 dx
0
1
B=
2
2
(2) = (A + B)
3
= 3.237

I = 3.237

Project Report (MT1005) 2023-2024 Page 4/15


Ho Chi Minh City University of Technology
Faculty of Applied Science

1.2.3 Problem (c)

Problem

x2 y2
Find the area of the part of the sphere x2 + y 2 + z 2 = a2 that lies inside the cylinder a2 + b2 =1
where 0 < b ≤ a

Figure 2: Illustration for problem c

Solution
p
With the above Oxy: z = a2 − x2 − y 2
x2 y2
Because of: + =1
a2 b2
We denote: x = a cos t; y = b sin t (0 ≤ t ≤ 2π)

So the area above:


Z p
I= a2 − x2 − y 2 dl
Z 2π p p
I= a2 − a2 cos2 t − b2 sin2 t. (x(t)′ )2 + (y(t)′ )2 dt
0
Z 2π p p
I= a2 sin2 t − b2 sin2 t. a2 sin2 t + b2 cos2 t dt
0

p Z 2π p
I= a2 − b2 a2 sin4 t + b2 cos2 t sin2 t dt
0

And the area is:

p Z 2π p
S = 2I = 2 a2 − b2 a2 sin4 t + b2 cos2 t sin2 t dt
0

Project Report (MT1005) 2023-2024 Page 5/15


Ho Chi Minh City University of Technology
Faculty of Applied Science

2 Programming

2.1 Task

Write a Matlab or Python code that calculates and graphically describes the geometric meaning of
the partial derivative of the function f (x, y) at M0 (x0 , y0 ). Allows users to enter f (x, y), x0 , y0 .

2.2 Matlab code


1 % Prompt user to enter the function f (x , y )
2 disp ( ' Enter the function f (x , y ) : ') ;
3 f_string = input ( 'f (x , y ) = ' , 's ') ;
4

5 % Define the symbolic variables


6 syms x y ;
7

8 % Convert the entered string into a symbolic function


9 f = str2func ([ '@ (x , y ) ' f_string ]) ;
10 disp ( f )
11

12 % Prompt user to enter the point ( x0 , y0 )


13 x0 = input ( ' Enter the x - coordinate of the point : ') ;
14 y0 = input ( ' Enter the y - coordinate of the point : ') ;
15

16 % Calculate the partial derivatives of f with respect to x and y


17 df_dx = diff ( f (x , y ) , x ) ;
18 df_dy = diff ( f (x , y ) , y ) ;
19

20 % Evaluate the partial derivatives at the point ( x0 , y0 )


21 df_dx_value = double ( subs ( df_dx , {x , y } , { x0 , y0 }) ) ;
22 df_dy_value = double ( subs ( df_dy , {x , y } , { x0 , y0 }) ) ;
23

24 % Display the calculated partial derivatives


25 disp ([ ' Partial derivative of f with respect to x at ( ' , num2str ( x0 ) , ' ,
' , num2str ( y0 ) , ') : ' , num2str ( df_dx_value ) ]) ;
26 disp ([ ' Partial derivative of f with respect to y at ( ' , num2str ( x0 ) , ' ,
' , num2str ( y0 ) , ') : ' , num2str ( df_dy_value ) ]) ;
27

28 % Plot the geometric meaning of the partial derivatives


29 [X , Y ] = meshgrid ( -10:0.5:10 , -10:0.5:10) ;
30 Z = f (X , Y ) ;
31 z0 = f ( x0 , y0 ) ;
32 o = surf (X , Y , Z ) ;
33 o . EdgeColor = ' interp ';
34 hold on ;

Project Report (MT1005) 2023-2024 Page 6/15


Ho Chi Minh City University of Technology
Faculty of Applied Science

35 plot3 ( x0 , y0 , f ( x0 , y0 ) , ' ro ' , ' MarkerSize ' , 10 , ' MarkerFaceColor ' , 'r ')
;
36 % Define different directional vectors in the tangent plane
37 directions = [
38 1 , 0; % along x - axis
39 0 , 1; % along y - axis
40 ];
41 % Plot the tangent lines
42 t = linspace ( -10 , 10 , 100) ;
43 for i = 1: size ( directions , 1)
44 direction = directions (i , :) ;
45 x_tangent = x0 + t * direction (1) ;
46 y_tangent = y0 + t * direction (2) ;
47 z_tangent = z0 + t * ( df_dx_value * direction (1) + df_dy_value *
direction (2) ) ;
48 plot3 ( x_tangent , y_tangent , z_tangent , ' LineWidth ' , 2) ;
49 end
50 xlabel ( 'x ') ;
51 ylabel ( 'y ') ;
52 zlabel ( 'f (x , y ) ') ;
53 title ( ' Geometric Meaning of Partial Derivatives ') ;
54 grid on ;
55

56 % Plot the tangent plane


57 syms t ;
58 tangent_plane = f ( x0 , y0 ) + df_dx_value * ( x - x0 ) + df_dy_value * ( y -
y0 ) ;
59 tangent_plane = simplify ( tangent_plane ) ;
60 ta ng en t_p la ne _fu nc = matlabFunction ( tangent_plane ) ;
61 t a n g e n t _ p l a n e_ v a l u e s = t an gen t_ pl ane _f un c (X , Y ) ;
62 hold on ;
63 surf (X , Y , tangent_plane_values , ' FaceAlpha ' , 0.5 , ' EdgeColor ' , ' none ') ;
64 legend ( ' Function ' , ' Point ( x0 , y0 ) ' , ' Tangent Plane ') ;

Project Report (MT1005) 2023-2024 Page 7/15


Ho Chi Minh City University of Technology
Faculty of Applied Science

2.3 Result

2.3.1 Sample 1

INPUT

f(x, y) = x.^3 + y.^3 - 3.*x - 3.*y


Enter the x-coordinate of the point: 2
Enter the y-coordinate of the point: -2

OUTPUT

Figure 3: Sample 1 Result

Project Report (MT1005) 2023-2024 Page 8/15


Ho Chi Minh City University of Technology
Faculty of Applied Science

2.3.2 Sample 2

INPUT

f(x, y) = x.^2 .* y.^2


Enter the x-coordinate of the point: -1
Enter the y-coordinate of the point: 1

OUTPUT

Figure 4: Sample 2 Result

Project Report (MT1005) 2023-2024 Page 9/15


Ho Chi Minh City University of Technology
Faculty of Applied Science

3 Applications

3.1 Applications in Computer Science

3.1.1 Image Processing

Problem Introduction: In image processing, we often need to calculate the average brightness of
an image over a specific region.
Explaining and Expressing the Solution: We can use a double integral to calculate the average
brightness B̄ over a rectangular region R in an image, where B(x, y) represents the brightness at point
(x, y). The solution involves integrating the brightness function over the region R and then dividing by
the area of R.

ZZ
1
B̄ = B(x, y) dA
Area(R) R

Mathematical Equation:
ZZ
1
B̄ = B(x, y) dx dy
Area(R) R

Conclusion: This application allows us to analyze the brightness distribution in images, which is
useful for tasks like object recognition, contrast enhancement, and quality assessment.
Source: Digital Image Processing by Rafael C. Gonzalez and Richard E. Woods.

Figure 5: Illustration for Image Processing

Project Report (MT1005) 2023-2024 Page 10/15


Ho Chi Minh City University of Technology
Faculty of Applied Science

3.1.2 Probability Density Functions

Problem Introduction: In probabilistic modeling, we often deal with continuous random variables
and need to compute probabilities over regions in the variable space.
Explaining and Expressing the Solution: To find the probability that a continuous random
variable X lies within a region D, we use a double integral over that region, where the integrand represents
the probability density function f (x, y) of X.

ZZ
P (X ∈ D) = f (x, y) dA
D

Mathematical Equation:
ZZ
P (X ∈ D) = f (x, y) dx dy
D

Conclusion: Double integrals help us calculate probabilities over continuous domains, which is
fundamental in statistical analysis and machine learning.
Source: Probability and Statistics for Computer Scientists by Michael Baron.

Figure 6: Illustration for Probability Density

Project Report (MT1005) 2023-2024 Page 11/15


Ho Chi Minh City University of Technology
Faculty of Applied Science

3.1.3 Surface Area in 3D Modeling

Problem Introduction: In computer graphics and 3D modeling, we often need to calculate the
surface area of complex shapes.
Explaining and Expressing the Solution: By representing a 3D surface as a function z = f (x, y),
we can calculate its surface area over a region D using a double integral.

s  2  2
ZZ
∂f ∂f
Surface Area = 1+ + dA
D ∂x ∂y

Mathematical Equation:
s  2  2
ZZ
∂f ∂f
Surface Area = 1+ + dx dy
D ∂x ∂y

Conclusion: This application is crucial for accurately representing and rendering complex surfaces
in computer graphics.
Source: Computer Graphics: Principles and Practice by John F. Hughes et al.

Figure 7: Illustration for Surface Area in 3D Modeling

Project Report (MT1005) 2023-2024 Page 12/15


Ho Chi Minh City University of Technology
Faculty of Applied Science

3.2 Applications in Mechanics

3.2.1 Center of Mass

Problem Introduction: In mechanics, determining the center of mass of a solid object is essential
for understanding its stability and motion.
Explaining and Expressing the Solution: The center of mass (xcm , ycm ) of a 2D object with
variable density is given by a double integral over its region D, where ρ(x, y) represents the density
function.

ZZ
1
xcm = xρ(x, y) dA
M D
ZZ
1
ycm = yρ(x, y) dA
M D

Mathematical Equations:
ZZ
1
xcm = xρ(x, y) dx dy
M D
ZZ
1
ycm = yρ(x, y) dx dy
M D
RR
where M = D
ρ(x, y) dA is the total mass.
Conclusion: Double integrals help us determine the center of mass, which is crucial in mechanics
for studying equilibrium and motion of objects.
Source: Classical Mechanics by John R. Taylor.

Figure 8: Illustration for Center of Mass

Project Report (MT1005) 2023-2024 Page 13/15


Ho Chi Minh City University of Technology
Faculty of Applied Science

3.2.2 Moment of Inertia

Problem Introduction: The moment of inertia of an object measures its resistance to rotational
motion.
Explaining and Expressing the Solution: The moment of inertia I about an axis can be cal-
culated using a double integral over the object’s region D, where ρ(x, y) represents the density function
and d is the perpendicular distance from the axis of rotation.

ZZ
I= ρ(x, y)d2 dA
D

Mathematical Equation: ZZ
I= ρ(x, y)d2 dx dy
D

Conclusion: Double integrals play a key role in computing moments of inertia, aiding in the analysis
of rotational dynamics and stability in mechanics.
Source: Engineering Mechanics: Dynamics by J. L. Meriam and L. G. Kraige.

Figure 9: Illustration for Moment of Inertia

Project Report (MT1005) 2023-2024 Page 14/15


Ho Chi Minh City University of Technology
Faculty of Applied Science

CONCLUSION

Through this large assignment, we learned how to work together and also about Matlab symbolism.
We learned how to solve double integrals problems and learn about the applications of them in real life.

REFERENCES

[1] Nguyễn Đình Huy (Ed) - Lê Xuân Đại - Ngô Thu Lương - Nguyễn Bá Thi - Trần Ngọc Diễm - Đậu
Thế Phiệt (2018) Calculus 2 Textbook, Ho Chi Minh City National University, 1st ed.

[2] J. Steward (2012) Calculus. Concepts and Contexts, Thomson Learning, 7th ed.

[3] Rafael C. Gonzalez and Richard E. Woods (2018) Digital Image Processing, Pearson, 4th ed.

[4] Michael Baron (2013) Probability and Statistics for Computer Scientists, Chapman and Hall/CRC,
2nd ed.

[5] John F. Hughes et al (2013) Computer Graphics: Principles and Practice, Addison-Wesley Profes-
sional, 3rd ed.

[6] John R. Taylor (2005) Classical Mechanics, University Science Books, null ed.

[7] J. L. Meriam and L. G. Kraige (2012) Engineering Mechanics: Dynamics, Wiley, 7th ed.

Project Report (MT1005) 2023-2024 Page 15/15

You might also like