0% found this document useful (0 votes)
135 views57 pages

Extreme Values in Calculus with MATLAB

The document provides information about a MATLAB project for the Calculus 2 subject being completed by students at HCMC University of Technology. It includes an introduction to MATLAB and its uses, as well as the group members and their student IDs working on the project. It then lists 7 calculation and graphing questions for the students to solve using MATLAB.

Uploaded by

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

Extreme Values in Calculus with MATLAB

The document provides information about a MATLAB project for the Calculus 2 subject being completed by students at HCMC University of Technology. It includes an introduction to MATLAB and its uses, as well as the group members and their student IDs working on the project. It then lists 7 calculation and graphing questions for the students to solve using MATLAB.

Uploaded by

teruaki ogawa
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

HCMC University of Technology MATLAB Project

Department of Applied Mathematics Subject: Calculus 2

1. Introduction
Currently, science is growing, with this development strength, the application of science and
scientific patents in schools is very feasible and significant. Since the first year, Ho Chi Minh
City University of Technology lecturers have helped technical students get acquainted with
programming applications such as MATLAB. MATLAB is a rising and programming
environment that allows calculating numbers with matrices, graphing functions or charting
information, implementing algorithms, creating user interfaces, and linking to computer
programs written in many other programming languages. MATLAB enables simulation of
calculations with the Toolbox library, experimenting with many models in practice and
techniques. With more than 40 years of establishment and development, MATLAB is an
effective calculation tool to solve technical problems today with a relatively simple and
universal design. Therefore, for the problems in Algebra, especially matrix problems, we can
use MATLAB's computing applications to solve most simply and understandably, helping us
get acquainted and add more skills to use programs application for students.

2. Group information
Student name Student ID
Đoàn Nhật Ân 2052856
Nguyễn Trọng Bằng 2052039
Phạm Thị Ngọc Linh 2053180
Trần Mai Phương 2053354
Phan Thanh Phước 2053356

3. Solutions:
Question 1: Find the extreme values of the function f(x; y) = x 2 + 2y2 on the circle x2 + y2 =
1. Sketch the given surface and show the extreme values.
fx = 2x ; fy = 4y, the only critical point is (0;0) and f(0;0) =0. To find the critical points on the
boundary

x 2+ y 2=1 we follow the method of Lagrange Multiplies with f( x,y) = x 2+ 2 y 2 and g(x;y) =
x 2+ y 2. We have the system
2x = 2x, 4y= lamda.2y, x 2+ y 2=1
Solving this system give us four extreme points: (0;1) (0;-1) (1;0) and (-1;0). The values for f
at these point are 2; 2; 1; 1. Therefore the maximum value is f ( 0 ; ± 1 )=2and the minimun
point is f ( 0 ; 0 )=0
Question 2: Find the extreme values of the function f(x; y) = x 2y on the curve x2 + 2y2 = 6:
Sketch the given surface and show the extreme values.
L(x , y )=f (x , y )+φ(x , y)=x2 y +( x 2 +2 y 2−6)
L' x =2 xy +2 x =0 α =0 ; ± 1

{L ' y =x 2 + 4 y=0
{ ¿0;±2
L ' =x +2 y =6 y =± √3 , ±1
α
2 2

We have 6 stationary points P1 ¿


d 2 L=L''xx ( x o , y o ) d 2 x +2 L'xy' ( xo , y o ) dxdy + L'yy' ( x o , y o )d 2 y
−x
φ (x , y )=x 2+2 y 2−6=0 dy = dx
2y
When ¿ 0 d 2 L(P¿ ¿1)<0 ¿, P1 is maximum point and d 2 L(P ¿¿ 2)>0 ¿ so P2 is minimum point.
¿ 1 d 2 L(P¿¿ 3), d2 L( P¿¿ 4)< 0 so P3 ; P 4 ¿ ¿is local maximum.
¿−1 d2 L(P¿¿ 5), d 2 L(P ¿¿ 6)> 0 so P5 ; P6 is local minimum . ¿ ¿
Question 3: Find the extreme values of the function f(x; y) = 6 - 5x - 4y on the curve x 2 + y2
= 9. Sketch the given surface and show the extreme values.
f x =−5

1|56
f y =−4

g ( x , y )=x 2 + y 2=9
→ ∇ f =λ ∇ g

{ { {
15 √ 41
x=±
41
f x =λ g x −5= λ 2 x
f y =λ g y → −4=λ 2 y → y=± 12 √ 41
2 2 2 2 41
x + y =9 x + y =9
λ=±
√ 41
6

f has possible extreme values at the points ( 1541√ 41 , 1241√ 41 ) ;( −1541√ 41 , −1241√ 41 );
f( 1541√ 41 , 1241√ 41 )=6−3 √ 41
−15 √ 41 −12 √ 41
f(
41 )
, =6+3 √ 41
41

The maximum value of f(x,y) is 6+3 √ 41 and the minimum is 6−3 √ 41


Question 4: Find the extreme values of the function f(x; y) = 1 - 4x - 8y on the curve x 2 + 8y2
= 8. Sketch the given surface and show the extreme values.
Solve equations ∇f= λ∇g and g(x,y)=8 using Lagrange multipliers
Constraint g(x,y) = x2 + 8y2 = 8
fx = λgx fy = λgy g(x,y) = 8
which become
−4
-4 = 2xλ => x = (1)

−8
-8 = 16yλ => y = (2)
16 λ
x2 + 8y2 = 8 (3)
subtitude (1) and (2) into (3), we have:
1 √3
¿)2 + 8( )2 = 8 => λ = ±
2λ 2
These values of λ then give the corresponding points (x,y)
4 √3 √3 4 √3 √3
(- ,- ) and ( , )
3 3 3 3
4 √3 √3
 f(- ,- ) = 1 + 8√ 3
3 3
4 √3 √3
 f( , ) = 1 – 8√ 3
3 3
4 √3 √3
Therefore the maximum value of f(x,y) on the curve x2 + 8y2 = 8 is f(- ,- ) = 1 + 8√ 3
3 3
4 √3 √3
and the minimum value is f( , ) = 1 - 8√ 3
3 3
Question 5: Find the extreme values of the function f(x; y) = x 2 + y2 + xy on the curve x2 +
2y2 = 8. Sketch the given surface and show the extreme values.
Consider Lagrange function:

L ( x , y , λ )=x 2+ y 2+ xy −λ(1−x 2−2 y 2)


Find stationary points:

2|56
−2 x+ y

{
L'x =0 λ=
2 x+ y+ 2 λx=0 2x

{ L'y =0
L'λ=0

{
2 y + x + 4 λy=0
2 2
x +2 y =1
λ=
2
−2 y + x
4y
2
x +2 y =1

−2 x + y −2 y + x
→ = ↔ 4 y ( 2 x+ y )=2 x( 2 y + x ) ↔ x=( 1+ √ 3 ) y, x=( 1−√ 3 ) y.
2x 4y

3−√ 3
x=( 1+ √ 3 ) y:
2
x 2+ 2 y 2=1 ↔ [ ( 1+ √ 3 ) y ] + 2 y 2=1 ↔ y=±
√ 12
.

3+ √ 13
x=( 1−√3 ) y :
2
x 2+ 2 y 2=1 ↔ [ ( 1− √ 3 ) y ] +2 y 2=1 ↔ y=±
√ 12
.

There are four stationary points.

L'xx' L''xy −φ 'x 2+ 2 λ 1 −2 x


'' '' '
Compute: ∆=−det ⁡( L xy L yy −φ y ) ↔ ∆=−det ⁡( 1 2+4 λ −2 y )
'
−φ x −φ y 0 ' −2 x −2 y 0

Stationary points ∆ Conclusion


3−√ 3 3−√ 3 <0 Maximum point
((1+ √3)

12
;

3− √3
12 √)

3−√ 3 <0 Maximum point


((1+ √3)(−

12
);−

3+ √13 3+ √ 13
12 √)
>0 Minimum point
((1−√ 3)
√12
;

3+ √ 13
12 √ )

3+ √ 13 >0 Minimum point


((1−√ 3)(−

12
) ;−
12 √ )

Question 6: Find the extreme values of the function f(x; y) = 2x 2 + 12xy + y2 on the curve x2
+ 4y2 = 25. Sketch the given surface and show the extreme values.
f ( x , y )=2 x2 +12 xy+ y 2

x 2+ y 2=25
fx = 4x+12y gx = 2x
fy = 12x+2y gy = 2y
fx = [Link] => 4x +12y = lamda.2x (1)
fy = [Link] => 12x +2y = lamda.2y (2)
4 x +12 y 12 x+2 y
1, 2 => =
2x 2y
 4 xy+ 12 y 2=12 x 2+ 2 xy
 6 y 2−6 x 2−xy =0
 We have 6 ( 25−x 2) −6 x 2−x √ 25−x2 =0
 x= 3.39 and x=-3.68
x y
Question 7: Find the extreme values of the function f ( x , y )=x 2+ y 2 on the plane + =1.
2 3
Sketch the given surface and show the extreme values.
x y
L(x , y )=f (x , y )+φ( x , y)=x2 + y 2− + −1
2 3 ( )

3|56
x 18
2 x− =0 x=

{
M
{ {
L ' x =0

L' α =0 x y
2
y
L' y =0 2 y− =0 y=
3
+ −1=0 ¿
2 3
13
12
13
42
13

( 1813 , 1213 ), is a stationary point


d 2 L=L''xx ( x o , y o ) d 2 x +2 L'xy' ( xo , y o ) dxdy + L'yy' ( x o , y o )d 2 y
x y −3
φ (x , y )= + −1=0 dy= dx
2 3 2
−3 2 9 2 5 22 2
d 2 L=L''xx ( x o , y o ) d 2 x +2 L'xy' ( xo , y o )
2 (
d x+ L'yy' (x o , y o ) d x=
4
+)
13 13
d x
18 12
Then d 2 L> 0 so M ( ,
3 3) is the minimum point

Question 8: Find the local maximum and minimum values and saddle points of
f ( x , y )=x 4 + y 4 −2 x 2 + 4 xy−2 y 2. Sketch the given surface and show the extreme values.
f x =4 x 3−4 x+ 4 y

f y =4 y 3+ 4 x−4 y
3
f x =0
{f y =0
→ 4 x 3−4 x+ 4 y =0 → x + y =0→( x + y )( x −xy + y )=0
{
4 y + 4 x−4 y=0
3 3 2 2

x + y=0∨x 2−xy + y 2=0

x=0 y=0 (0,0)

{
→ x=− y → x 3−x−x=0→ x=√ 2 → y =−√ 2 → ( √ 2,−√ 2)
x =−√ 2 y =√2 (−√ 2, √ 2)
{ {
∂2 f 2
l= 2
=12 x −4
∂x

∂2 f
m= =4
∂ x∂ y

∂2 f
n= =12 y−4
∂ y2
 At point (0,0)
l=12 ×0−4=−4< 0
m=4
n=12× 0−4=−4<0

ln −m 2=(−4 ) . (−4 )−4 2=0 → At ( 0,0 ) f has no extremes

 At point ( √ 2 ,−√ 2)
l=12 ×2−4=20> 0
m=4
n=12× 2−4=20>0

ln −m2=20.20−4 2=384> 0∧l>0 → f has a minimum value=−8


 At point(−√ 2 , √ 2)
l=12 ×2−4=20> 0

4|56
m=4
n=12× 2−4=20>0

 ln −m 2=20.20−4 2=384> 0∧l>0 → f has a minimum value=−8


Question 9: Find the local maximum and minimum values and saddle points of
f ( x , y )=2 x 4+ y 4−x 2−2 y 2. Sketch the given surface and show the extreme values.
fx = 8x3 – 2x = 0 => x = 0
1
x=
2
−1
x=
2
fy = 4y3 – 4y = 0 => y = 0
y=1
y = -1
fxx = 24x2 – 2
fyy = 12y2 – 4
fxy = 0
∆ = [Link] – fxy2 = 288x2y2 – 96x2 – 24y2 + 8
fxx fyy ∆ = [Link] – fxy2
(0,0) -2 -4 8 Local maximum
(0,1) -2 8 -16 Saddle point
(0,-1) -2 8 -16 Saddle point
1 4 -4 -16 Saddle point
( ,0)
2
1 4 8 32 Local minimum
( ,1)
2
1 4 8 32 Local minimum
( ,-1)
2
−1 4 -4 -16 Saddle point
( ,0)
2
−1 4 8 32 Local minimum
( ,1)
2
−1 4 8 32 Local minimum
( ,-1)
2

1 9 1 9 −1 9
Therefore, the maximum value of f is f(0,0) = 0, and f( ,1) = - , f( ,-1) = - , f( ,1) = - ,
2 8 2 8 2 8
−1 9
f( ,-1) = - are the minimum point.
2 8
Question 10: Find the local maximum and minimum values and saddle points of
f ( x , y )=( x 2−2 y 2 )e x− y . Sketch the given surface and show the extreme values.
Finding stationary points:
x− y
f 'x =0 ( 2 x ) e x− y + ( x 2−2 y 2) e
{f 'y =0

{
(−4 y ) e x− y 2 2
=0
x− y
+ ( x −2 y ) (−1 ) e =0

x=0 , y=0
{x=−4 , y=−2
.

The two stationary points are (0;0) and (-4;-2)

5|56
A=f 'xx' =( 2+2 x ) e x− y +(2 x + x 2−2 y 2)e x− y

'' {
Compute: B=f 'xy' = (−4 y ) e x− y + ( 2 x+ x 2−2 y 2 ) (−1 ) e x− y
x− y
C=f yy =−( 4−4 y ) e −(4 y+ x −2 y )e
2 2 x− y

Stationary A B C ∆=AC-B2 Conclusion


point
(0;0) 2 0 -4 <0 Saddle point
(-4;-2) e-2(-6) 8 e-2 -12 e-2 >0 Maximum
point
Question 11: Find the local maximum and minimum values and saddle points of
f ( x , y )=(x + y 2 +2 y)e 2 x . Sketch the given surface and show the extreme values.
Finding stationary points:

f 'x =0 e 2 x (1+ 2 x +2 y 2+ 4 y )=0


{f 'y =0

{ (2 y+ 2) e x =0
→ {x=0.5
y=−1
.

The two stationary points are (0;0) and (-1;-1)

A=f 'xx' =2 e2 x (2+ 2 x +2 y 2+ 4 y )


Compute:
{
B=f 'xy' =e 2 x (4 y+ 4)
C=f 'yy' =2e x

Stationary A B C ∆=AC-B2 Conclusion


point
(0.5;-1) >0 0 >0 >0 Maximum
point

Question 12: Find the local maximum and minimum values and saddle points of
x
f ( x , y )=(x + y 2 )e 2 . Sketch the given surface and show the extreme values.
x
2 2
f (x , y )=( x+ y ) e
x x
1

{
f ' x=e 2 + ( x+ y2 ) e 2 =0 x=−2
2
x
f ' y=2 y e 2 =0
M(-2,0) is a stationary point
y=0 {
A=f 'xx' 0.184
We have
{ B=f 'xy' =0 ∆= AC −B 2> 0∧ A> 0
C=f 'yy' =
2
e
So M(-2,0) is the minimum point
Question 13: Find the local maximum and minimum values and saddle points of
2 2

f ( x , y )=( x 2 + y 2 )( e−x − y −1). Sketch the given surface and show the extreme values.
f(x, y) = (x 2 + y 2 )(e −x 2−y 2 − 1).
2 2

f x =2 x . e− x − y . ( 1−x 2− y 2 ) −2 x
2 2

f y =2 y . e− x − y . ( 1−x 2− y 2 ) −2 y

f x =0
{f y =0
→ { x=0 , y=0

Question 14: Find the local maximum and minimum values and saddle points of
f ( x , y )=3 x 2−x3 +2 y 2 +4 y. Sketch the given surface and show the extreme values.
fx = 6x - 3x2 = 0 => x = 0

6|56
x=2
fy = 4y + 4 = 0 => y = -1
fxx = 6 – 6x
fyy = 4
fxy = 0
∆ = [Link] – fxy2 = 24 - 24x

fxx fyy ∆ = [Link] – fxy2


(0,-1) 6>0 4 24 > 0 Local minimum
(2,-1) -6 4 -24 < 0 Saddle point

Question 15: Find the local maximum and minimum values and saddle points of
f ( x , y )=x 3+ 3 xy + y 3 . Sketch the given surface and show the extreme values.
Finding stationary points:

f 'x =0 3 x 2 +3 y=0
{f 'y =0
↔ { 3 x +3 y 2=0

x=0 , y =0
{x=−1 , y =−1
.

The two stationary points are (0;0) and (-1;-1)

A=f 'xx' =6 x

{ ''
Compute: B=f xy =3
C=f 'yy' =6 y

Stationary A B C ∆=AC-B2 Conclusion


point
(0;0) 0 3 0 <0 Saddle point
(-1;-1) -6 3 -6 >0 Local
maximum
point

Question 16: Find the local maximum and minimum values and saddle points of
f ( x , y )=4 xy−x 4− y 4. Sketch the given surface and show the extreme values.
f ( x , y )=4 xy−x 4− y 4
fx= 4 y−4 x 3=0=¿y - x 3=0

fy= 4 x−4 y 3=0 → x− y 3=¿0


x=0, y=0
x=-1, y=-1
x=1, y=1
Critical points (0,0); (-1;1); (1;1)
fxy=-12x =A
fxy=4=B ∆= AC−B2
fyy= -12y =C

At (0;0) A=0, B=4, C=0

7|56
∆ <0 → ( 0 ; 0 ) is saddle point
At (-1;-1) A=12, B=4, C=12
∆ >0 , A >0 → ( 1 ; 1 ) is a local maximum
At (1;-1) A= -12, B=4, C=-12
∆ >0 , A <0 → ( 1 ; 1 ) is a local minimum

Question 17: Find the local maximum and minimum values and saddle points of
f ( x , y )=x 3+ 2 y 3−3 x 2−6 y. Sketch the given surface and show the extreme values.
f (x , y )=x 3+ 2 y 3 −3 x 2−6 y
f 'x =3 x 2−6 x=0 x=0
{ f 'y =6 y 2−6=0
x =2
y =±1
{[
We have 4 stationary points M 1(0,1), M 2(0,-1), M 3(2,1), M 4 (2,-1)
∆1< 0 So M 1 is a saddle point

{
A=f 'xx' =12 x −6
B=f 'xy' =0 ∆=AC −B 2
C=f ''yy =12 y {
2 ∆ >0∧ A>0 So M 2 is maximum point

∆ 3> 0∧ A< 0 So M 3 is minimum point


∆ 4 <0∧So M 2 is a saddle point

Question 18: Find the surface area of the part of the sphere x 2+ y 2+ z 2=4 that lies inside the
cylinder x 2+ y 2=2 y . Sketch the given surface.
z=f ( x , y )=√ 4−x 2− y 2

S=∬ √ 1+(f 'x )2+(f 'y )2 dA


D

D= {( x , y ) : x2 +( y−1)2 ≤ 1 }

Let x=rcosφ, y=rsinφ: D= { ( r , φ ) : 0≤ r ≤1 , 0 ≤ φ ≤ π }


2 2
−y
S=∬ 1+(
D

π
√ −x

π
) +(
√ 4−x 2− y 2 √ 4−x 2− y 2
) dA

S=2∫ ¿ ¿ = 2∫ 2.(2−√ 3 ¿ ) dφ=4 π .(2−√ 3)≈ 3,367 ¿


0 0

Question 19: Find the surface area of the sphere x 2+ y 2+ z 2=9. Sketch the given surface.
Since the sphere x2 + y2 + z2 = 9 can be divided into 2 parts with the same area, then the area
of the sphere x2 + y2 + z2 = 9 is:

2 2
'
√ '
S = 2∬ 1+ ( f x ) + ( f y ) dx dy,
D

where z = f (x,y) = √ 9−x2 − y 2.

D = {(x,y) : x2 + y2 ≤ 9}
Letting x = r cosφ, y = r sinφ, we get D = {(r,φ) : 0 ≤ r ≤ 3, 0 ≤ φ ≤ 2π}.
2 2
−y
S = 2∬


D √ 1+
( −x
√ 9−x 2− y 2 )(
+
√9−x 2− y 2) dA

= 2∫ ¿ ¿
0

= 36π

8|56
Question 20: Find the surface area of the part of the sphere x 2+ y 2+ z 2=2 that lies above the
cone z 2=x 2+ y 2. Sketch the given surface.
Since the part of the sphere x2+y2+z2=2 that lies above the cone z2= x2+y2, can be divided into
2 parts, which have the same area, thus the required surface area is

S=∬ √ 1+(f 'x )2+(f 'y )2 dA , z=f ( x , y )=√ 2−x 2− y 2 and D= {( x , y ) : x2 + y 2 ≤1 }


D

Let x=rcosφ, y=rsinφ: D= { ( r , φ ) : 0≤ r ≤1 , 0 ≤ φ ≤ π }


2 2
−y
S=∬ 1+(
D

π
√ π
−x
) +(
√ 2−x 2− y 2 √ 2−x 2− y 2
) dA

S=2∫ ¿ ¿ = 2∫ [−√ 2 ( 2−r 2 ) ¿ ] r =1 dφ ¿


0 0 r =0
π
S=2∫ ¿ ¿
0

Question 21: Find the surface area of the part of the surface z = xy that lies inside the
cylinder x2+ y2 = 1. Sketch the given surface.
2 2
A =∬ √ (f x ) +(f y ) +1 dA
D

fx =y ∫∫ √1+ x 2+ y 2 dA
fy= x solving that we have 3.229

Question 22: Evaluate the solid bounded by 2x + z = 2 and (x - 1)2 + y2 = z. Sketch the given
solid.
x=rcosφ
Let { |J |=r 0≤ φ ≤ 2 π
y=rsinφ 0 ≤ φ ≤1
( x−1) + y ≤ z ≤ 2−2 x (rcosφ−1)2+ rsinφ2 ≤ z ≤ 2−2 rcosφ
2 2

2π 1 2−2 rcosφ
V =∭ dxdydz=∫ dφ ∫ dr ∫ rdz
Ω 0 0 2
(rcosφ−1) +rsinφ
2

2π 1
1 π
¿ ∫ dφ ∫ r (2−2rcosφ−(rcosφ−1)2+rsinφ 2)dr=2 π =
0 0 4 2
Question 23: Evaluate the volume of the solid bounded by y = x; y = 2x; x = 1; z = x2 + y2; z
= x2 + 2y2. Sketch the given solid.
z =x2 + y 2
{z=x 2+2 y 2

The solid Ω lies under the paraboloid z=x 2 +2 y 2 and above z=x 2 + y 2.
The projection D is y=2x, y=2,x=1
D= { ( x , y ) : 0≤ x ≤ 1 , x ≤ y ≤ 2 x }

The volume V of the solid Ω is


1
V =∬ ( y 2 ) dA = ∫ ¿ ¿
D 0

Question 24: Evaluate the volume V of the solid Ω that lies under the paraboloid z=x 2 + y 2;
and above the circular region in the xy-plane x 2+ y 2=2 x . Sketch the given solid.
Letting x = r cosφ, y = r sinφ,
x2 + y2 = 2x  (x - 1)2 + y2 = 1

9|56
 0 ≤ r ≤ 2cosφ
π π
 - ≤φ≤
2 2
π π
We get D = {(r,φ) : 0 ≤ r ≤ 2cosφ, - ≤φ≤ }
2 2
π
2
2
V = ∬ (x ¿ ¿ 2+ y ) dA ¿= ∫ ¿ ¿dφ
D −π
2

π
2
4
= 4 ∫ [cos φ ]dφ
−π
2


=
2
Question 25: Evaluate the volume V of the solid Ω bounded by z = 1 – x2 – y2 and z = 0.
Sketch the given solid.
z=1−x 2− y 2 →
{ z=0
x 2+ y 2=1

The solid Ω lies under the paraboloid z=1− x2− y 2 and above z=0.

The projection D is x 2+ y 2 ≤ 1

Let x=rcosφ, y=rsinφ: D= { ( r , φ ) : 0≤ r ≤1 , 0 ≤ φ ≤2 π }

The volume V of the solid Ω is


2π 2 4 2π
V =∬ ( 1−x 2− y 2 ) dA = ∫ ¿ ¿ = ∫ [ r − r ] r=1 dφ
D
0 0 2 4 r =0

1 π
V =∫ dφ =
0 4 2

Question 26: Evaluate the volume of the solid bounded by y = 1 + x2; z = 3x; y = 5; z = 0
(where x > 0). Sketch the given solid.
The solid Ω lies under the surface z=3 x and above z=0.
The projection D is bounded by y=1+ x 2, y=5, x=0

Let x=rcosφ, y=rsinφ: D= { ( r , φ ) : 0≤ r ≤1 , 0 ≤ φ ≤2 π }

The volume V of the solid Ω is


2 2
V =∬ ( 3 x−0 ) dA = ∫ ¿ ¿ = ∫ [ 3 xy ] y=5
dx
D
0 0 y =1+ x2
2
V =∫ [ 3 x .5−3 x ( 1+ x2 ) ] dx = 12
0

Question 27: Find the volume of the tetrahedron Ω bounded by z = 0; x + 2y + z = 2; x =2y;


x = 0. Sketch the given solid.
The volume of the tetrahedron Ω is V =∬ (2−x−2 y) dxdy
D
1 1−x/ 2 1

=∫
0
1
[∫ x/2
]
( 2−x−2 y ) dy dx=∫ [ 2 y−xy − y 2 ] y =1−x /2 dx=
0 y=x /2 |
1
=∫ ¿ ¿dx=
0
3

10 | 5 6
1
So the volume of the tetrahedron is V =
3
π π
Question 28: Evaluate the area of the region D={( r , φ ) :− ≤ φ ≤ , 0 ≤ r ≤ cos 2 φ }. Sketch
4 4
the given region.
−π π
≤ φ ≤ , 0 ≤r ≤ cos 2 φ
4 4

π π
4 cos 2 φ 4
cos2 2 φ π
∫ ∫ r . dr . dφ= ∫ dφ=
−π 0 −π 2 8
4 4

Question 29: Evaluate the area of the region D bounded by y = (x+1)2; x = y-y3; x = -1; y =
-1. Sketch the given region.
The curve x = y – y3 goes through the origin and intersects the y-axis at the points (0;-1) and
(0; 1)
The curve x = y – y3 intersects the straight line y = -1 and the curve x = -1 + √ y at (0;-1) and
(0; 1) respectively, since they satisfy the equations:
y=1
-1 + √ y = y – y3 => {x=0
The curve x = -1 + √ y intersects the x-y coordinate at (-1; 0) and (0; 1). The curve x = -1 +
√ y intersects the straight line x = -1 at (-1; 0).

For {−1+√0y≤≤yx≤1≤ y – y 3

3
1 y –y 1
7
S1 =∫ ∫ dxdy = ∫ y – y 3 +1−√ y dy =
0 −1+ √ y 0
12

−1 ≤ y ≤ 0
For {−1≤ x ≤ y – y 3
3
0 y– y 0
3 3
S2 =∫ ∫ dxdy = ∫ y – y +1 dy =
−1 −1 −1
4

7 3 4
S = S1 + S2 = + =
12 4 3

Question 30: Evaluate ∬ 2 xdA where D={( x , y ) :2 x ≤ x 2 + y 2 ≤ 6 x , y ≤ x . Sketch the given


D
region.
(x −1)2 + y 2 ≥ 1
2
2 x ≤ x + y ≤6 x 2

{ 2 2
(x−3) + y ≤ 9

Let x=rcosφ, y=rsinφ: 2 cosφ ≤ r ≤ 6 cosφ


−π π −π π
y ≤x ↔ rsinφ ≤ rcosφ where φ ∈ [ ; →
2 2 2 ]
≤φ≤
4

2 cosφ ≤r ≤ 6 cosφ
So, the region is described as
{ −π
2
≤ φ≤
π
4

11 | 5 6
π
4

I=∫ ¿ ¿
−π
2

π π
4 3 4 3 3
2 r r=6 cosφ 2(6 cosφ) 2(2cosφ )
I = ∫ [cosφ ] dφ= ∫ (cosφ −cosφ )dφ ≈ 157.189
−π 3 r=2 cosφ −π 3 3
2 2

Question 31: Evaluate the area of the region D bounded by x + y2 =1; y - x = 1; x = 0. Sketch
the given region.
∬ 1 dA
D

x=1− y 2
x= y −1

⇒ 1− y 2= y−1
So y=1∧ y=−2

D= {( x ; y ) ; o ≤ x ≤1− y 2 ;−1 ≤ y ≤ 1 }
2
1 1− y 1
10
S=∫ ∫ 1dx dy=∫ 1− y 2−( y−1)dy=
−1 y−1 −1
3

Question 32: Evaluate ∬ (x + y )dA where D={( x , y ) :1≤ x 2+ y 2 ≤ 4 , x ≥ 0 , y ≥0 , y ≥ x }.


D
Sketch the given region.
By the spherical coordinate system, let {x=rcosφ
y=rsinφ
|J |=r
D={ ( r , φ ) :1≤ r ≤ 2,0≤ φ ≤ π }
π 2
2 2 2
So we have V=∬ (3 x +4 y )dxdy=∫ dφ ∫ [ (3 rcosφ+4 r sin φ)rdr ] =
D 0 1
π π

∫ ¿ ¿dφ=∫ [ r 3 cosφ +r 4 sin2 φ ] r=2


r=1
dφ=
0 0
π π
15
2
=∫ (7 cosφ+15 sin ¿ φ)dφ=∫ 7 cosφ + (1−cos 2 φ) ¿dφ=
0 0 2 [ ]
15 15 15 π
= 7 sinφ+ φ− sin 2 φ π =
[ ]
2 4 0 2
Question 33: Evaluate ∬ (3 x + y 2) dA where D={( x , y ) :1≤ x 2+ y 2 ≤ 4 , y ≥0 }. Sketch the
D
given region.
x2 + y2 ≥ 1
2
1≤x + y ≤4 2
↔ { x2 + y 2 ≤ 4

Let x=rcosφ, y=rsinφ: 1 ≤r ≤2


π π
x ≥ 0∧ y ≥ 0 → φ ∈ 0 ; [ ] 2
→ 0 ≤ φ≤
2

1 ≤ r ≤2
So, the region is described as
{
0 ≤ φ≤
π
2

12 | 5 6
π
2

I =∫ ¿ ¿
0

1 1
2
x
Question 34: Evaluate I =∫ dy ∫ e dx . Sketch the given region.
0 y
1 1
2
x
I =∫ dy ∫ e dx
0 y

1 x
2
x
=∫ ∫ e dydx
0 0

1
2
x
=∫ x e dx
0

e 1
= −
2 2
x
y
Question 35: Evaluate ∬e dA where D is the region bounded by y2 = x; x = 0; y = 1.
D
Sketch the given region.
The region D is bounded by {00≤≤ xy≤≤1y 2

Then I =∫ ¿ ¿.
0

Question 36: Evaluate ∬ xdA where D is a triangle OAB; O(0; 0); A(1; 1); B(0; 1). Sketch
D
the given region.
I =∬ xdA
D

D: 0≤ x≤1
{
x≤ y≤1
1 1 1 1

0 x 0 y =x 0
|
I =∫ ∫ x dy dx=∫ xy y=1 dx=∫ x −x2 dx=
1
6
π π
Question 37: Evaluate I=∬ (sin x cos y )dA ; where D={( x , y ) :0 ≤ x ≤ , 0 ≤ y ≤ }. Sketch
D 2 2
the given region.
π π
Evaluate I= ∬ (sinxcosy) dA where D= ( x , y ) : 0≤ x ≤
D { 2
,0≤ y ≤
2 }
π /2 π/2
π /2 [ siny ] π /2
I=∬ (sinxcosy) dA = ∫ sinxdx . ∫ cosydy=[ −cosx ] . =1x1=1
D
0 0
0 0
2
Question 38: Evaluate∬ (3 y −x )dA ; where D={( x , y ) :0 ≤ x ≤2 , 1≤ y ≤2 }. Sketch the
D
given region.
The region D is bounded by {1≤0 ≤ yx ≤≤ 22
2 2 2
I =∫ ∫ ( 3 y 2−x ) dx . dy =∫ (6 y 2−2) dy=12
1 0 1

13 | 5 6
Question 39: Evaluate ∭ xy z 2 dV ; where Ω is the rectangular box given by
Ω
Ω :0 ≤ x ≤1 ,−1≤ y ≤ 2 , 0 ≤ z ≤3. Sketch the given solid.
3 2 1
2
I =∫ z dz ∫ ydy ∫ xdx
0 −1 0

3 2
1 2
= ∫ z dz ∫ ydy
20 −1

3
3 2
= ∫ z dz
4 0

9
=
4

Question 40: Evaluate I =∭ ( x +2 y)dV e; where Ω is the solid bounded by


Ω

x 2 ≤ y ≤ x ,0 ≤ z ≤ x . Sketch the given solid.


I =∬ ¿ ¿
D

Where D= {( x , y ) :0 ≤ x ≤1 , x2 ≤ y ≤ x 3 }
1
I =∫ ¿ ¿
0

1
2
I =∫ ( x 3−x 4 + x 3−x 5 ) dx=
0 15
2 2
Question 41: Evaluate I =∭ √ x + z dV where Ω is the region bounded by x 2+ z2 ≤ y ≤ 4 .
Ω
Sketch the given solid.
x 2+ z2 ≤ y ≤ 4

→ z2 ≤ y −x 2
4

∫ √ x 2+ z2 dy=4 √ x 2+ z 2−( x2 + z 2 ) √ x 2 + z 2
2 2
x +z

2π 2

∫∫ r ( 4 √ r 2−r 2 √r ¿ ) dr dθ ¿
0 0

2π 9

∫ ( 13 4 r 3− 29 ¿ r 2 ) 20 dθ ¿ |
0

¿ 35 × 4 2

Question 42: Evaluate the triple integral with cylindrical coordinates I =∭ 2 xdV where
Ω
2
Ω={( x , y , z ) :0 ≤ y ≤ 2 ; 0 ≤ x ≤ √ 4− y ; 0 ≤ z ≤ x. Sketch the given solid.
Evaluate the triple intergral with cylindrical coordinates
I=∭ 2 xdxdydz where Ω={( x , y , z ) : 0≤ y ≤2 ; 0 ≤ x ≤ √ 4− y 2 ; 0 ≤ z ≤ x }
Ω
The region Ω is bounded by the upper face z=x , the lower face z=0 and the surrounding
face is a quarter circle 0 ≤ y ≤ 2 ; 0 ≤ x ≤ √ 4− y 2. According to the triple integral formula, we
have
I=∬ ¿ ¿
D

Where D= {( x , y ) :0 ≤ y ≤ 2; 0 ≤ x ≤ √ 4− y 2 }
x=rcosφ
By the spherical coordinate system, let
y=rsinφ
|J |=r {

14 | 5 6
π
{
Where D= ( r , φ ) : 0≤ r ≤2,0 ≤ φ ≤
2 }
π /2 2 π /2 φ/ 2
2 r 4 r=2
So, I= ∫
φ/ 2
0
[∫ 0
2 2
] [
2 r cos φrdr dφ= ∫
0
cos φ . 2
4 r=0 ] 2
dφ= ∫ 8 cos φdφ=
0

sin ⁡(2 φ) φ/2


= ∫ 4 ( 1+ cos ( 2 φ ) ) dφ=4. φ+
0
[ 2 0 ]
=2π
We have I =2 π
Question 43: Evaluate the triple integral with cylindrical coordinates I =∭ zdV where Ω is
Ω
the solid that lies within the cylinder x2 + y2 = 1; above the paraboloid z = x2 + y2 and below
the paraboloid z = 2x2 + y2. Sketch the given solid.
The region D is bounded by x 2+ y 2=1

Using cylindrical coordinates: x 2+ y 2=r 2, x=rcosφ, y=rsinφ

So, the region is described as {00≤≤rφ≤≤21π


2 2
2π 1 2x + y 2π 1
1
I =∫ ∫ ∫ 2
( z ) rdzdrdφ= ∫∫ r 5([Link] 2 x +sin2 x−1)drdφ
2 0 0
0 0 r


1 π
¿ ∫ ( 2. cos2 x +sin 2 x−1 ) dφ=
12 0 12

1
Question 44: Evaluate the triple integral with cylindrical coordinates I =∭ 2
dV 2
Ω x +y
where Ω is the solid bounded by z = 0; z = y; x2 + y2 = 1 and y ≥ 0. Sketch the given solid.
y
1
I =∬ 2 2 dA ∫ dz
D x +y 0

y
=∬ dA
x + y2
2
D

Letting x = r cosφ, y = r sinφ,


x2 + y2 = 1 => 0 ≤ r ≤ 1
y ≥ 0 => r sinφ ≥ 0 => 0 ≤ φ ≤ π
we get D = {(r,φ) : 0 ≤ r ≤ 1, 0 ≤ φ ≤ π}

y
I=∬ 22
dA
D x +y
π 1
r sin φ
= ∫∫ rdrd φ
0 0 r2
π 1

= ∫ sin φ dφ∫ dr
0 0

=2
2 2
Question 45: Evaluate the triple integral with cylindrical coordinates I =∭ z √ x + y dV
Ω

where Ω :0 ≤ z ≤1 , 0 ≤ y ≤ √ 2 x−x 2 .Sketch the given solid.


y 2=2 x−x 2 ↔ x 2+ y 2=2 x
Using cylindrical coordinates: x 2+ y 2=r 2, x=rcosφ, y=rsinφ

15 | 5 6
0 ≤r ≤ 2 cosφ
→ r =2r cosφ 2

{ 0≤φ≤
π
2
π π
2 2 cosφ 1 2 2 cosφ
z2
I =∫ ∫ ∫ ( z √ r 2 ) rdzdrdφ=∫ ∫ (r ¿¿ 2
2
)drdφ¿
0 0 0 0 0

π π
2 3 2
1 r r =2 cosφ 1 8
I= ∫
20 3 [ ]
r =0
dφ= ∫ 8(cosφ)3 dφ=
6 0 9
Question 46: Evaluate the triple integral with spherical coordinates I =∭ (x + z )dV where
Ω
Ω is the unit ball x + y + z ≤ 1. Sketch the given solid.
2 2 2

x=P cos α sinθ

0 ≤ α ≤2 π
y=P sinα sin θ
{
F: 0 ≤ θ ≤ π
0≤P≤1

z=P cos θ

π 2π 1
I =∫ ∫ ∫ P cos α sin θ+ P cos θ dP dα dθ
0 0 0

π 2π
P2 P2
cos α sin θ+ cos θ P=1 dα dθ
¿ ∫∫
0 0 2 2 P=0 |
π 2π
1 1
¿ ∫ ∫ cos α sin θ+ cos θ dx dθ
0 0 2 2
π
1
¿ ∫ cos θ ×2 π dθ
0 2

¿0

2 2
Question 47: Evaluate the triple integral with spherical coordinates I =∭ ( x + y ) dV where
Ω
Ω is the solid hemisphere x2 + y2 + z2 ≤ 1; z ≥ 0: Sketch the given solid.
Evaluate the triple intergral with spherical coordinates
2 2
I=∭ ( x + y ) dxdydz Where Ω is the solid hemishere x 2+ y 2+ z 2 ≤1∧z ≥ 0
Ω

π
The solid Ω in the spherical coordinate system is bounded by

π
2 2π 1
0≤ρ≤1
2
0 ≤φ ≤ 2 π { 0≤ θ ≤

I=∫ dθ ∫ dφ∫ ¿ ¿
0 0 0
π /2 2π 1 π/2 2π
ρ5 ρ=1
0
π /2
0 0

0
2

0
3
= ∫ dθ ∫ dφ ∫ sin θ ρ dρ=∫ dθ ∫ sin θ
π /2
4
5 ρ=0
dφ= [ ]
1 1 φ=2 π 4π
= . ∫ sin θdθ ∫ dφ= .[ φ ]
3 3
. ∫ sin θdθ=
5 0 0
5 φ=0 0 15

So I=
15

16 | 5 6
2 2 2
Question 48: Evaluate the triple integral with spherical coordinates I =∭ (x + y + z )dV
Ω
2 2 2 2 2 2
where Ω lies between the spheres x + y + z = 1 and x + y + z = 4 in the first octant. Sketch
the given solid.
Let x=rcosφ, y=rsinφ
π
In the first octant x ≥ 0∧ y ≥ 0 so 0 ≤ φ ≤
2
0≤r≤1

√ 1−r 2 ≤ z ≤ √ 4−r 2
π
2 1 √ 4−r2
I =∫ ∫ ∫ r 2+ z2 dz .r . drdφ≈ 0.507
0 0 √ 1−r2
1
Question 49: Evaluate the triple integral with spherical coordinates I =∭ 2
2 2
dV
Ω x + y +z

where Ω is the solid that lies within the sphere x2 + y2 + z2 = 4 and above the cone z=√ x 2+ y 2
.Sketch the given solid.
Letting x = ρsinθcosφ, y = ρsinθsinφ, z = ρ cosθ

0 ≤ z ≤ √ x 2+ y 2  z ≤ r

 cosθ ≤ sinθ
π
 0≤θ≤
4
π
we get Ω = {(ρ,φ , θ) : 0 ≤ ρ ≤ 2, 0 ≤ φ ≤ 2 π, 0 ≤ θ ≤ }
4
π
2π 4 2
I = ∫ ∫ ∫ 1 ρ2 sin θ dρdθd φ
2
0 0 0 ρ

π
2π 4 2
= ∫ d φ∫ sinθ dθ∫ dρ
0 0 0

= 4 π−2 √ 2 π
Question 50: Evaluate the triple integral with spherical coordinates where
Ω={( x , y , z ) ∈ R 3 : x 2 + y 2+ z2 ≤1 , z ≥ 0 }. Sketch the given solid.
Converting from Cartesian coordinate system to spherical coordinate system:

x 2 + y 2+ z2= ρ2

{ φ=tan −1 ( )

θ=tan−1 (
y
x
√ x + y2 )
2

Substituting in the given integral:



{
0≤ρ≤1
0 ≤ φ≤ 2 π , d V xyz = ρ2 sinθd V ρφθ
0≤θ≤π

π 2π 1 π
2
I =∫ ∫ ∫ (e ¿ ¿ ρ ρ sinθ)dρdφdθ=∫ sinθ ¿
0 0 0 0

Question 51: Use spherical coordinates to find the volume of the solid that lies above the
cone z=√ x 2+ y 2 and below the sphere x2 + y2 + z2 = z. Sketch the given solid.
x 2+ y 2+ z 2=z

x 2+ y 2+ z 2= ρ 2

17 | 5 6
x=ρ sin θ cos α
y= ρsin θ sin α
z=ρ cos θ

P2=P cos θ z=√ x 2+ y 2


π
P=cos θ ρ cosθ=ρ sin θ=¿θ=
4

0 ≤ ρ ≤ cos θ

{
π
π 2 π 4 cosα
0≤θ≤ →∭ 1 dV =∫ ∫ ∫ 1 dρdθdα=π √ 2
4
Ω 0 0 0
0≤ α ≤ 2 π

4. MATLAB code questions:


Question 1: Find the extreme values of the function f(x; y) = x 2 + 2y2 on the circle x2 + y2 =
1. Sketch the given surface and show the extreme values.
syms x y lamd real
f=x^2+2*y^2
phi=x^2+y^2-1
L=f-lamd*(phi)
[criticalx,criticaly,criticallamd]=solve(diff(L,x),diff(L,y),phi,
[x,y,lamd])
A=diff(L,x,2)
B=diff(diff(L,x),y)
C=-diff(phi,x)
D=-diff(phi,y)
E=diff(L,y,2)
Delta=-det([A B C;B E D;C D 0])
for i=1:4
Deltai=double(subs(Delta,[x,y,lamd],
[criticalx(i),criticaly(i),criticallamd(i)]));
if Deltai>0
sprintf('The point (%8.4f, %8.4f) is minimum
point',double(criticalx(i)),double(criticaly(i)))
elseif Deltai<0
sprintf('The point (%8.4f, %8.4f) is maximum
point',double(criticalx(i)),double(criticaly(i)))
else
sprintf('The point (%8.4f, %8.4f) is not extremum
point',double(criticalx(i)),double(criticaly(i)))
end
end
% Sketch the given surface and show the extreme values

x=linspace(-10,10,30); y=linspace(-10,10,30); [x,y]=meshgrid(x,y);

f=x.^2+2*y.^2; g=x.^2+y.^2;

surf(x,y,f,'facecolor','b','edgecolor','none','facealpha',.3)

hold on

contour(x,y,g, [1])

plot3(-1,0,1,'r*')

plot3(1,0,1,'r*')

plot3(0,-1,2,'r*')

plot3(0,1,2,'r*')

18 | 5 6
Question 2: Find the extreme values of the function f(x; y) = x 2y on the curve x2 + 2y2 = 6:
Sketch the given surface and show the extreme values.
syms x y lamd real
f=x^2*y
phi=x^2+2*y^2-6
L=f-lamd*(phi)
[criticalx,criticaly,criticallamd]=solve(diff(L,x),diff(L,y),phi,
[x,y,lamd])
A=diff(L,x,2)
B=diff(diff(L,x),y)
C=-diff(phi,x)
D=-diff(phi,y)
E=diff(L,y,2)
Delta=-det([A B C;B E D;C D 0])
for i=1:size(criticalx)
Deltai=double(subs(Delta,[x,y,lamd],
[criticalx(i),criticaly(i),criticallamd(i)]));
if Deltai>0
sprintf('The point (%8.4f, %8.4f) is minimum
point',double(criticalx(i)),double(criticaly(i)))
elseif Deltai<0
sprintf('The point (%8.4f, %8.4f) is maximum
point',double(criticalx(i)),double(criticaly(i)))
else
sprintf('The point (%8.4f, %8.4f) is not extremum
point',double(criticalx(i)),double(criticaly(i)))
end
end
% Sketch the given surface and show the extreme values
rotate3d on
x=linspace(-10,10,30); y=linspace(-10,10,30); [x,y]=meshgrid(x,y);
f=x.^2*y; g=x.^2+2*y.^2-6;
mesh(x,y,f,'facecolor','b','edgecolor','none','facealpha',.3)
hold on
contour(x,y,g)
hold on
plot3(2,1,4,'r*')
plot3(-2,-1,-4,'r*')
plot3(2,-1,-4,'r*')
plot3(-2,1,4,'r*')

19 | 5 6
Question 3: Find the extreme values of the function f(x; y) = 6 - 5x - 4y on the curve x 2 + y2
= 9. Sketch the given surface and show the extreme values.
syms x y lamd real
f=6-5*x-4*y
phi=x^2+y^2-9
L=f-lamd*(phi)
[criticalx,criticaly,criticallamd]=solve(diff(L,x),diff(L,y),phi,
[x,y,lamd])
A=diff(L,x,2)
B=diff(diff(L,x),y)
C=-diff(phi,x)
D=-diff(phi,y)
E=diff(L,y,2)
Delta=-det([A B C;B E D;C D 0])
for i=1:size(criticalx)
Deltai=double(subs(Delta,[x,y,lamd],
[criticalx(i),criticaly(i),criticallamd(i)]));
if Deltai>0
sprintf('The point (%8.4f, %8.4f) is minimum
point',double(criticalx(i)),double(criticaly(i)))
elseif Deltai<0
sprintf('The point (%8.4f, %8.4f) is maximum
point',double(criticalx(i)),double(criticaly(i)))
else
sprintf('The point (%8.4f, %8.4f) is not extremum
point',double(criticalx(i)),double(criticaly(i)))
end
end

% Sketch the given surface and show the extreme values


rotate3d on
x=linspace(-10,10,30); y=linspace(-10,10,30); [x,y]=meshgrid(x,y);
f=6-5*x-4*y; g=x.^2+y.^2-9;
mesh(x,y,f,'facecolor','b','edgecolor','none','facealpha',.3)
hold on
contour(x,y,g)
hold on
plot3(2.3426,1.8741,6-5*2.3426-4*1.841,'r*')
plot3(-2.3426,-1.8741,6-5*(-2.3426)-4*(-1.8741),'r*')
plot3(2,-1,-4,'r*')
plot3(-2,1,4,'r*')

20 | 5 6
Question 4: Find the extreme values of the function f(x; y) = 1 - 4x - 8y on the curve x 2 + 8y2
= 8. Sketch the given surface and show the extreme values.
syms x y lamd real
f=1-4*x-8*y
phi=x^2+8*y^2-8
L=f-lamd*(phi)
[criticalx,criticaly,criticallamd]=solve(diff(L,x),diff(L,y),phi,
[x,y,lamd])
A=diff(L,x,2)
B=diff(diff(L,x),y)
C=-diff(phi,x)
D=-diff(phi,y)
E=diff(L,y,2)
Delta=-det([A B C;B E D;C D 0])
for i=1:size(criticalx)
Deltai=double(subs(Delta,[x,y,lamd],
[criticalx(i),criticaly(i),criticallamd(i)]));
if Deltai>0
sprintf('The point (%8.4f, %8.4f) is minimum
point',double(criticalx(i)),double(criticaly(i)))
elseif Deltai<0
sprintf('The point (%8.4f, %8.4f) is maximum
point',double(criticalx(i)),double(criticaly(i)))
else
sprintf('The point (%8.4f, %8.4f) is not extremum
point',double(criticalx(i)),double(criticaly(i)))
end
end
% Sketch the given surface and show the extreme values
rotate3d on
x=linspace(-10,10,30); y=linspace(-10,10,30); [x,y]=meshgrid(x,y);
f=1-4*x-8*y; g=x.^2+8*y.^2-8;
mesh(x,y,f,'facecolor','b','edgecolor','none','facealpha',.3)
hold on
contour(x,y,g)
hold on
plot3(2.3094,0.5774,1-4*2.3094-8*0.5774,'r*')
plot3(-2.3094,-0.5774,1-4*(-2.3094)-8*(-0.5774),'r*')

21 | 5 6
Question 5: Find the extreme values of the function f(x; y) = x 2 + y2 + xy on the curve x2 +
2y2 = 8. Sketch the given surface and show the extreme values.
syms x y lamd real
f=x^2+y^2+x*y
phi=x^2+2*y^2-1
L=f-lamd*(phi)
[criticalx,criticaly,criticallamd]=solve(diff(L,x),diff(L,y),phi,
[x,y,lamd])
A=diff(L,x,2)
B=diff(diff(L,x),y)
C=-diff(phi,x)
D=-diff(phi,y)
E=diff(L,y,2)
Delta=-det([A B C;B E D;C D 0])
for i=1:size(criticalx)
Deltai=double(subs(Delta,[x,y,lamd],
[criticalx(i),criticaly(i),criticallamd(i)]));
if Deltai>0
sprintf('The point (%8.4f, %8.4f) is minimum
point',double(criticalx(i)),double(criticaly(i)))
elseif Deltai<0
sprintf('The point (%8.4f, %8.4f) is maximum
point',double(criticalx(i)),double(criticaly(i)))
else
sprintf('The point (%8.4f, %8.4f) is not extremum
point',double(criticalx(i)),double(criticaly(i)))
end
end
% Sketch the given surface and show the extreme values
rotate3d on
x=linspace(-10,10,30); y=linspace(-10,10,30); [x,y]=meshgrid(x,y);
f=x.^2+y.^2+x*y; g=x.^2+2*y.^2-1;
mesh(x,y,f,'facecolor','b','edgecolor','none','facealpha',.3)
hold on
contour(x,y,g)
hold on
plot3(0.4597,-0.628,0.31701649,'r*')
plot3(-0.4597,0.6280,0.31701649,'r*')
plot3(-0.881,-0.3251,1.16826411,'r*')
plot3(0.8881,0.3251,1.16826411,'r*')

Question 6: Find the extreme values of the function f(x; y) = 2x 2 + 12xy + y2 on the curve x2
+ 4y2 = 25. Sketch the given surface and show the extreme values.
syms x y lamd real
f=2*x^2+y^2+12*x*y
phi=x^2+4*y^2-25
L=f-lamd*(phi)
[criticalx,criticaly,criticallamd]=solve(diff(L,x),diff(L,y),phi,
[x,y,lamd])
A=diff(L,x,2)
B=diff(diff(L,x),y)
C=-diff(phi,x)
D=-diff(phi,y)

22 | 5 6
E=diff(L,y,2)
Delta=-det([A B C;B E D;C D 0])
for i=1:size(criticalx)
Deltai=double(subs(Delta,[x,y,lamd],
[criticalx(i),criticaly(i),criticallamd(i)]));
if Deltai>0
sprintf('The point (%8.4f, %8.4f) is minimum
point',double(criticalx(i)),double(criticaly(i)))
elseif Deltai<0
sprintf('The point (%8.4f, %8.4f) is maximum
point',double(criticalx(i)),double(criticaly(i)))
else
sprintf('The point (%8.4f, %8.4f) is not extremum
point',double(criticalx(i)),double(criticaly(i)))
end
end
% Sketch the given surface and show the extreme values
rotate3d on
x=linspace(-10,10,30); y=linspace(-10,10,30); [x,y]=meshgrid(x,y);
f=2*x.^2+y.^2+12*x*y; g=x.^2+4*y.^2-25
mesh(x,y,f,'facecolor','b','edgecolor','none','facealpha',.3)
hold on
contour(x,y,g)
hold on
plot3(4,1.5,106.25,'r*')
plot3(3,-2,-50,'r*')
plot3(-3,2,-50,'r*')
plot3(-4,-1.5,106.25,'r*')

x y
Question 7: Find the extreme values of the function f ( x , y )=x 2+ y 2 on the plane + =1.
2 3
Sketch the given surface and show the extreme values.
syms x y lamd real
f=x^2+y^2
phi=x/2+y/3-1
L=f-lamd*(phi)
[criticalx,criticaly,criticallamd]=solve(diff(L,x),diff(L,y),phi,
[x,y,lamd])
A=diff(L,x,2)
B=diff(diff(L,x),y)
C=-diff(phi,x)
D=-diff(phi,y)
E=diff(L,y,2)
Delta=-det([A B C;B E D;C D 0])
for i=1:size(criticalx)
Deltai=double(subs(Delta,[x,y,lamd],
[criticalx(i),criticaly(i),criticallamd(i)]));
if Deltai>0
sprintf('The point (%8.4f, %8.4f) is minimum
point',double(criticalx(i)),double(criticaly(i)))
elseif Deltai<0

23 | 5 6
sprintf('The point (%8.4f, %8.4f) is maximum
point',double(criticalx(i)),double(criticaly(i)))
else
sprintf('The point (%8.4f, %8.4f) is not extremum
point',double(criticalx(i)),double(criticaly(i)))
end
end
% Sketch the given surface and show the extreme values
rotate3d on
x=linspace(-10,10,30); y=linspace(-10,10,30); [x,y]=meshgrid(x,y);
f=x.^2+y.^2; g=x./2+y./3-1
mesh(x,y,f,'facecolor','b','edgecolor','none','facealpha',.3)
hold on
contour(x,y,g)
hold on
plot3(1.3846,0.9231,1.3846^2+0.9231^2,'r*')

Question 8: Find the local maximum and minimum values and saddle points of
f ( x , y )=x 4 + y 4 −2 x 2 + 4 xy−2 y 2. Sketch the given surface and show the extreme values.
syms x y real
f=x^4+y^4-2*x^2+4*x*y-2*y^2;
[criticalx,criticaly]=solve(diff(f,x),diff(f,y),[x,y]);
A=diff(f,x,2);
B=diff(diff(f,x),y);
C=diff(f,y,2);
Delta=A*C-B^2;
for i=1:size(criticalx)
Deltai=double(subs(Delta,[x,y],[criticalx(i),criticaly(i)]));
A1=double(subs(A,[x,y],[criticalx(i),criticaly(i)]));
B1=double(subs(B,[x,y],[criticalx(i),criticaly(i)]));
C1=double(subs(C,[x,y],[criticalx(i),criticaly(i)]));
if ((Deltai>0) && (A1>0))
sprintf('The point (%8.4f, %8.4f) is minimum
point',double(criticalx(i)),double(criticaly(i)))
end
if ((Deltai>0) && (A1<0))
sprintf('The point (%8.4f, %8.4f) is maximum
point',double(criticalx(i)),double(criticaly(i)))
end
if Deltai<0
sprintf('The point (%8.4f, %8.4f) is a saddle
point',double(criticalx(i)),double(criticaly(i)))
end
if Deltai==0
sprintf('No conclusion about the point (%8.4f,
%8.4f)',double(criticalx(i)),double(criticaly(i)))
end
end
% Sketch the given surface and show the extreme values
rotate3d on
x=linspace(-10,10,30); y=linspace(-10,10,30); [x,y]=meshgrid(x,y);
f=x.^4+y.^4-2*x.^2+4*x.*y-2*y.^2;
mesh(x,y,f,'facecolor','b','edgecolor','none','facealpha',.3)
hold on
plot3(-1.4142,1.4142,-4.242753437,'r*')

24 | 5 6
plot3(1.4142,-1.4142,-7.071153437,'r*')

Question 9: Find the local maximum and minimum values and saddle points of
f ( x , y )=2 x 4+ y 4−x 2−2 y 2. Sketch the given surface and show the extreme values.
syms x y real
f=2*x^4+y^4-x^2-2*y^2;
[criticalx,criticaly]=solve(diff(f,x),diff(f,y),[x,y]);
A=diff(f,x,2);
B=diff(diff(f,x),y);
C=diff(f,y,2);
Delta=A*C-B^2;
for i=1:size(criticalx)
Deltai=double(subs(Delta,[x,y],[criticalx(i),criticaly(i)]));
A1=double(subs(A,[x,y],[criticalx(i),criticaly(i)]));
B1=double(subs(B,[x,y],[criticalx(i),criticaly(i)]));
C1=double(subs(C,[x,y],[criticalx(i),criticaly(i)]));
if ((Deltai>0) && (A1>0))
sprintf('The point (%8.4f, %8.4f) is minimum
point',double(criticalx(i)),double(criticaly(i)))
end
if ((Deltai>0) && (A1<0))
sprintf('The point (%8.4f, %8.4f) is maximum
point',double(criticalx(i)),double(criticaly(i)))
end
if Deltai<0
sprintf('The point (%8.4f, %8.4f) is a saddle
point',double(criticalx(i)),double(criticaly(i)))
end
if Deltai==0
sprintf('No conclusion about the point (%8.4f,
%8.4f)',double(criticalx(i)),double(criticaly(i)))
end
end
% Sketch the given surface and show the extreme values
rotate3d on
x=linspace(-10,10,30); y=linspace(-10,10,30); [x,y]=meshgrid(x,y);
f=2*x.^4+y.^4-x.^2-2*y.^2;
mesh(x,y,f,'facecolor','b','edgecolor','none','facealpha',.3)
hold on
plot3(0,0,0,'r*')
plot3(0,-1,-1,'r*')
plot3(0,1,-1,'r*')
plot3(-0.5,-1,-1.125,'r*')
plot3(-0.5,1,-1.125,'r*')
plot3(-0.5,1,-1.125,'r*')
plot3(0.5,1,-1.125,'r*')

25 | 5 6
Question 10: Find the local maximum and minimum values and saddle points of
f ( x , y )=( x 2−2 y 2 )e x− y . Sketch the given surface and show the extreme values.
syms x y real
f=(x^2-2*y^2)*exp(x-y);
[criticalx,criticaly]=solve(diff(f,x),diff(f,y),[x,y]);
A=diff(f,x,2);
B=diff(diff(f,x),y);
C=diff(f,y,2);
Delta=A*C-B^2;
for i=1:size(criticalx)
Deltai=double(subs(Delta,[x,y],[criticalx(i),criticaly(i)]));
A1=double(subs(A,[x,y],[criticalx(i),criticaly(i)]));
B1=double(subs(B,[x,y],[criticalx(i),criticaly(i)]));
C1=double(subs(C,[x,y],[criticalx(i),criticaly(i)]));
if ((Deltai>0) && (A1>0))
sprintf('The point (%8.4f, %8.4f) is minimum
point',double(criticalx(i)),double(criticaly(i)))
end
if ((Deltai>0) && (A1<0))
sprintf('The point (%8.4f, %8.4f) is maximum
point',double(criticalx(i)),double(criticaly(i)))
end
if Deltai<0
sprintf('The point (%8.4f, %8.4f) is a saddle
point',double(criticalx(i)),double(criticaly(i)))
end
if Deltai==0
sprintf('No conclusion about the point (%8.4f,
%8.4f)',double(criticalx(i)),double(criticaly(i)))
end
end
% Sketch the given surface and show the extreme values
rotate3d on
x=linspace(-10,10,30); y=linspace(-10,10,30); [x,y]=meshgrid(x,y);
f=(x.^2-2*y.^2)*exp(x-y);
mesh(x,y,f,'facecolor','b','edgecolor','none','facealpha',.3)
hold on
plot3(-4,-2,((-4)^2-2*(-2)^2)*exp(-4--2),'r*')

26 | 5 6
Question 11: Find the local maximum and minimum values and saddle points of
f ( x , y )=(x + y 2 +2 y)e 2 x . Sketch the given surface and show the extreme values.
syms x y real
f=(x+y^2+2*y)*exp(2*x);
[criticalx,criticaly]=solve(diff(f,x),diff(f,y),[x,y]);
A=diff(f,x,2);
B=diff(diff(f,x),y);
C=diff(f,y,2);
Delta=A*C-B^2;
for i=1:size(criticalx)
Deltai=double(subs(Delta,[x,y],[criticalx(i),criticaly(i)]));
A1=double(subs(A,[x,y],[criticalx(i),criticaly(i)]));
B1=double(subs(B,[x,y],[criticalx(i),criticaly(i)]));
C1=double(subs(C,[x,y],[criticalx(i),criticaly(i)]));
if ((Deltai>0) && (A1>0))
sprintf('The point (%8.4f, %8.4f) is minimum
point',double(criticalx(i)),double(criticaly(i)))
end
if ((Deltai>0) && (A1<0))
sprintf('The point (%8.4f, %8.4f) is maximum
point',double(criticalx(i)),double(criticaly(i)))
end
if Deltai<0
sprintf('The point (%8.4f, %8.4f) is a saddle
point',double(criticalx(i)),double(criticaly(i)))
end
if Deltai==0
sprintf('No conclusion about the point (%8.4f,
%8.4f)',double(criticalx(i)),double(criticaly(i)))
end
end
% Sketch the given surface and show the extreme values
rotate3d on
x=linspace(-10,10,30); y=linspace(-10,10,30); [x,y]=meshgrid(x,y);
f=(x+y.^2+2*y)*exp(2*x);
mesh(x,y,f,'facecolor','b','edgecolor','none','facealpha',.3)
hold on
plot3(0.5,-1,(0.5+(-1)^2+2*(-1))*exp(2*0.5),'r*')

27 | 5 6
Question 12: Find the local maximum and minimum values and saddle points of
x
f ( x , y )=(x + y 2 )e 2 . Sketch the given surface and show the extreme values.
syms x y real
f=(x+y^2)*exp(x/2);
[criticalx,criticaly]=solve(diff(f,x),diff(f,y),[x,y]);
A=diff(f,x,2);
B=diff(diff(f,x),y);
C=diff(f,y,2);
Delta=A*C-B^2;
for i=1:size(criticalx)
Deltai=double(subs(Delta,[x,y],[criticalx(i),criticaly(i)]));
A1=double(subs(A,[x,y],[criticalx(i),criticaly(i)]));
B1=double(subs(B,[x,y],[criticalx(i),criticaly(i)]));
C1=double(subs(C,[x,y],[criticalx(i),criticaly(i)]));
if ((Deltai>0) && (A1>0))
sprintf('The point (%8.4f, %8.4f) is minimum
point',double(criticalx(i)),double(criticaly(i)))
end
if ((Deltai>0) && (A1<0))
sprintf('The point (%8.4f, %8.4f) is maximum
point',double(criticalx(i)),double(criticaly(i)))
end
if Deltai<0
sprintf('The point (%8.4f, %8.4f) is a saddle
point',double(criticalx(i)),double(criticaly(i)))
end
if Deltai==0
sprintf('No conclusion about the point (%8.4f,
%8.4f)',double(criticalx(i)),double(criticaly(i)))
end
end
% Sketch the given surface and show the extreme values
rotate3d on
x=linspace(-10,10,30); y=linspace(-10,10,30); [x,y]=meshgrid(x,y);
f=(x+y.^2)*exp(x/2);
mesh(x,y,f,'facecolor','b','edgecolor','none','facealpha',.3)
hold on
plot3(-2,0,(-2+(0)^2)*exp(-2/2),'r*')

28 | 5 6
Question 13: Find the local maximum and minimum values and saddle points of
2 2

f ( x , y )=( x 2 + y 2 )( e−x − y −1). Sketch the given surface and show the extreme values.
syms x y real
f=(x^2+y^2)*(exp(-x^2-y^2)-1);
[criticalx,criticaly]=solve(diff(f,x),diff(f,y),[x,y]);
A=diff(f,x,2);
B=diff(diff(f,x),y);
C=diff(f,y,2);
Delta=A*C-B^2;
for i=1:size(criticalx)
Deltai=double(subs(Delta,[x,y],[criticalx(i),criticaly(i)]));
A1=double(subs(A,[x,y],[criticalx(i),criticaly(i)]));
B1=double(subs(B,[x,y],[criticalx(i),criticaly(i)]));
C1=double(subs(C,[x,y],[criticalx(i),criticaly(i)]));
if ((Deltai>0) && (A1>0))
sprintf('The point (%8.4f, %8.4f) is minimum
point',double(criticalx(i)),double(criticaly(i)))
end
if ((Deltai>0) && (A1<0))
sprintf('The point (%8.4f, %8.4f) is maximum
point',double(criticalx(i)),double(criticaly(i)))
end
if Deltai<0
sprintf('The point (%8.4f, %8.4f) is a saddle
point',double(criticalx(i)),double(criticaly(i)))
end
if Deltai==0
sprintf('No conclusion about the point (%8.4f,
%8.4f)',double(criticalx(i)),double(criticaly(i)))
end
end
% Sketch the given surface and show the extreme values
rotate3d on
x=linspace(-10,10,30); y=linspace(-10,10,30); [x,y]=meshgrid(x,y);
f=(x.^2+y.^2)*(exp(-x.^2-y.^2)-1);
mesh(x,y,f,'facecolor','b','edgecolor','none','facealpha',.3)

29 | 5 6
Question 14: Find the local maximum and minimum values and saddle points of
f ( x , y )=3 x 2−x3 +2 y 2 +4 y. Sketch the given surface and show the extreme values.
syms x y real
f=(3*x^2-x^3+2*y^2+4*y);
[criticalx,criticaly]=solve(diff(f,x),diff(f,y),[x,y]);
A=diff(f,x,2);
B=diff(diff(f,x),y);
C=diff(f,y,2);
Delta=A*C-B^2;
for i=1:size(criticalx)
Deltai=double(subs(Delta,[x,y],[criticalx(i),criticaly(i)]));
A1=double(subs(A,[x,y],[criticalx(i),criticaly(i)]));
B1=double(subs(B,[x,y],[criticalx(i),criticaly(i)]));
C1=double(subs(C,[x,y],[criticalx(i),criticaly(i)]));
if ((Deltai>0) && (A1>0))
sprintf('The point (%8.4f, %8.4f) is minimum
point',double(criticalx(i)),double(criticaly(i)))
end
if ((Deltai>0) && (A1<0))
sprintf('The point (%8.4f, %8.4f) is maximum
point',double(criticalx(i)),double(criticaly(i)))
end
if Deltai<0
sprintf('The point (%8.4f, %8.4f) is a saddle
point',double(criticalx(i)),double(criticaly(i)))
end
if Deltai==0
sprintf('No conclusion about the point (%8.4f,
%8.4f)',double(criticalx(i)),double(criticaly(i)))
end
end
% Sketch the given surface and show the extreme values
rotate3d on
f = @(x,y) (3*x.^2-x.^3+2*y.^2+4*y); % Your Function
x = linspace(-10, 10, 150); % X-Range
y = linspace(-10, 10, 150); % Y-Range
[X,Y] = meshgrid(x,y); % Create Matrix
Arguments
figure(1)
sh = surf(X, Y, f(X,Y));
set(sh, 'EdgeColor','none')
grid on
hold on
plot3(0,-1,-2,'r*')

30 | 5 6
Question 15: Find the local maximum and minimum values and saddle points of
f ( x , y )=x 3+ 3 xy + y 3 . Sketch the given surface and show the extreme values.
syms x y real
f=x^3+3*x*y+y^3;
[criticalx,criticaly]=solve(diff(f,x),diff(f,y),[x,y]);
A=diff(f,x,2);
B=diff(diff(f,x),y);
C=diff(f,y,2);
Delta=A*C-B^2;
for i=1:size(criticalx)
Deltai=double(subs(Delta,[x,y],[criticalx(i),criticaly(i)]));
A1=double(subs(A,[x,y],[criticalx(i),criticaly(i)]));
B1=double(subs(B,[x,y],[criticalx(i),criticaly(i)]));
C1=double(subs(C,[x,y],[criticalx(i),criticaly(i)]));
if ((Deltai>0) && (A1>0))
sprintf('The point (%8.4f, %8.4f) is minimum
point',double(criticalx(i)),double(criticaly(i)))
end
if ((Deltai>0) && (A1<0))
sprintf('The point (%8.4f, %8.4f) is maximum
point',double(criticalx(i)),double(criticaly(i)))
end
if Deltai<0
sprintf('The point (%8.4f, %8.4f) is a saddle
point',double(criticalx(i)),double(criticaly(i)))
end
if Deltai==0
sprintf('No conclusion about the point (%8.4f,
%8.4f)',double(criticalx(i)),double(criticaly(i)))
end
end
% Sketch the given surface and show the extreme values
rotate3d on
x=linspace(-10,10,30); y=linspace(-10,10,30); [x,y]=meshgrid(x,y);
f=x.^3+3.*x.*y+y.^3;
mesh(x,y,f,'facecolor','b','edgecolor','none','facealpha',.3)
hold on
plot3(-1,-1,1,'r*')

31 | 5 6
Question 16: Find the local maximum and minimum values and saddle points of
f ( x , y )=4 xy−x 4− y 4. Sketch the given surface and show the extreme values.
syms x y real
f=4*x*y-x^4-y^4;
[criticalx,criticaly]=solve(diff(f,x),diff(f,y),[x,y]);
A=diff(f,x,2);
B=diff(diff(f,x),y);
C=diff(f,y,2);
Delta=A*C-B^2;
for i=1:size(criticalx)
Deltai=double(subs(Delta,[x,y],[criticalx(i),criticaly(i)]));
A1=double(subs(A,[x,y],[criticalx(i),criticaly(i)]));
B1=double(subs(B,[x,y],[criticalx(i),criticaly(i)]));
C1=double(subs(C,[x,y],[criticalx(i),criticaly(i)]));
if ((Deltai>0) && (A1>0))
sprintf('The point (%8.4f, %8.4f) is minimum
point',double(criticalx(i)),double(criticaly(i)))
end
if ((Deltai>0) && (A1<0))
sprintf('The point (%8.4f, %8.4f) is maximum
point',double(criticalx(i)),double(criticaly(i)))
end
if Deltai<0
sprintf('The point (%8.4f, %8.4f) is a saddle
point',double(criticalx(i)),double(criticaly(i)))
end
if Deltai==0
sprintf('No conclusion about the point (%8.4f,
%8.4f)',double(criticalx(i)),double(criticaly(i)))
end
end
% Sketch the given surface and show the extreme values
rotate3d on
x=linspace(-10,10,30); y=linspace(-10,10,30); [x,y]=meshgrid(x,y);
f=4.*x.*y-x.^4-y.^4;
mesh(x,y,f,'facecolor','b','edgecolor','none','facealpha',.3)
hold on
plot3(-1,-1,2,'r*')
plot3(1,1,2,'r*')

32 | 5 6
Question 17: Find the local maximum and minimum values and saddle points of
f ( x , y )=x 3+ 2 y 3−3 x 2−6 y. Sketch the given surface and show the extreme values.
syms x y real
f=x^3+2*y^3-3*x^2-6*y;
[criticalx,criticaly]=solve(diff(f,x),diff(f,y),[x,y]);
A=diff(f,x,2);
B=diff(diff(f,x),y);
C=diff(f,y,2);
Delta=A*C-B^2;
for i=1:size(criticalx)
Deltai=double(subs(Delta,[x,y],[criticalx(i),criticaly(i)]));
A1=double(subs(A,[x,y],[criticalx(i),criticaly(i)]));
B1=double(subs(B,[x,y],[criticalx(i),criticaly(i)]));
C1=double(subs(C,[x,y],[criticalx(i),criticaly(i)]));
if ((Deltai>0) && (A1>0))
sprintf('The point (%8.4f, %8.4f) is minimum
point',double(criticalx(i)),double(criticaly(i)))
end
if ((Deltai>0) && (A1<0))
sprintf('The point (%8.4f, %8.4f) is maximum
point',double(criticalx(i)),double(criticaly(i)))
end
if Deltai<0
sprintf('The point (%8.4f, %8.4f) is a saddle
point',double(criticalx(i)),double(criticaly(i)))
end
if Deltai==0
sprintf('No conclusion about the point (%8.4f,
%8.4f)',double(criticalx(i)),double(criticaly(i)))
end
end
% Sketch the given surface and show the extreme values
rotate3d on
x=linspace(-10,10,30); y=linspace(-10,10,30); [x,y]=meshgrid(x,y);
f=x.^3+2.*y^3-3.*x.^2-6.*y;
mesh(x,y,f,'facecolor','b','edgecolor','none','facealpha',.3)
hold on
plot3(0,-1,4,'r*')
plot3(2,1,-8,'r*')

33 | 5 6
Question 18: Find the surface area of the part of the sphere x 2+ y 2+ z 2=4 that lies inside the
cylinder x 2+ y 2=2 y . Sketch the given surface.
%Calculation
>> syms x y
>> z = sqrt(4-x^2-y^2)
>> diff(z,1,x)
ans =
-x/(- x^2 - y^2 + 4)^(1/2)
>> diff(z,1,y)
ans =
-y/(- x^2 - y^2 + 4)^(1/2)

fun = @(x,y) 2.*sqrt(1+(-x./sqrt(4-x.^2-y.^2)).^2+(-y./sqrt(4-x.^2-


y.^2)).^2);
polarfun = @(phi,r) fun(r.*cos(phi),r.*sin(phi)).*r;
rmax = @(phi) 2*sin(phi);
q = integral2(polarfun,0,pi,0,rmax)
area=double(q);
fprintf('The surface area is %6.2f',area)
%Sketch the figure %Rotate to observe the surface
syms phi theta z2
x1 = 2*sin(phi)*cos(theta), y1 = 2*sin(phi)*sin(theta), z1 = 2*cos(phi)
x2 = cos(theta), y2 = 1+sin(theta)
x2 = cos(theta), y2 = 1+sin(theta)
figure; rotate3d on
fsurf(x1, y1, z1, [0 pi 0 2*pi], 'MeshDensity', 20); hold on
x1 = 2*cos(theta), y1 = 2*sin(theta)
fplot3(x1, y1, sym(0), [0 2*pi], 'r')
s1 = sym(sqrt(4)), y1 = s1*cos(theta), z1 = s1*sin(theta)
fplot3(sym(0), y1, z1, [0 2*pi], 'm')
hold on;
fsurf(x2, y2, z2, [0 2*pi -3 3], 'MeshDensity', 12)
axis equal; alpha 0.2
xlabel('x'); ylabel('y'); zlabel('z')

34 | 5 6
Question 19: Find the surface area of the sphere x 2+ y 2+ z 2=9. Sketch the given surface.
%Calculation
>> syms x y
>> z = sqrt(9-x^2-y^2)
>> diff(z,1,x)
ans =
-x/(- x^2 - y^2 + 9)^(1/2)
>> diff(z,1,y)
ans =
-y/(- x^2 - y^2 + 9)^(1/2)

fun = @(x,y) 2.*sqrt(1+(-x./sqrt(9-x.^2-y.^2)).^2+(-y./sqrt(9-x.^2-


y.^2)).^2);
polarfun = @(phi,r) fun(r.*cos(phi),r.*sin(phi)).*r;
q = integral2(polarfun,0,2*pi,0,3)
area=double(q);
fprintf('The surface area is %6.2f',area)

%Sketch the figure %Rotate to observe the surface


syms phi theta
x = 3*sin(phi)*cos(theta), y = 3*sin(phi)*sin(theta), z = 3*cos(phi)
figure
fsurf(x, y, z, [0 pi 0 2*pi], 'MeshDensity', 20); hold on
x = 3*cos(theta), y = 2*sin(theta)
fplot3(x, y, sym(0), [0 2*pi], 'r')
s1 = sym(sqrt(9)), y = s1*cos(theta), z = s1*sin(theta)
fplot3(sym(0), y, z, [0 2*pi], 'm')
axis equal; alpha 0.2
xlabel('x'); ylabel('y'); zlabel('z')

Question 20: Find the surface area of the part of the sphere x 2+ y 2+ z 2=2 that lies above the
cone z 2=x 2+ y 2. Sketch the given surface.
%Calculation
>> syms x y
>> z = sqrt(2-x^2-y^2)
z =
(- x^2 - y^2 + 2)^(1/2)
>> diff(z,1,x)
ans =
-x/(- x^2 - y^2 + 2)^(1/2)
>> diff(z,1,y)
ans =
-y/(- x^2 - y^2 + 2)^(1/2)

fun = @(x,y) sqrt(1+(-x./sqrt(2-x.^2-y.^2)).^2+(-y./sqrt(2-x.^2-y.^2)).^2);


polarfun = @(phi,r) fun(r.*cos(phi),r.*sin(phi)).*r;
q = integral2(polarfun,0,2*pi,0,1)
area=double(q);
fprintf('The surface area is %6.2f',area)
%Sketch the figure %Rotate to observe the surface
syms phi theta z2 r x y z
x1 = sqrt(2)*sin(phi)*cos(theta), y1 = sqrt(2)*sin(phi)*sin(theta), z1 =
sqrt(2)*cos(phi)

35 | 5 6
eq = z^2 == x^2 + y^2
figure
fsurf(x1, y1, z1, [0 pi 0 2*pi], 'MeshDensity', 20); hold on
x1 = sqrt(2)*cos(theta), y1 = 2*sin(theta)
fplot3(x1, y1, sym(0), [0 2*pi], 'r')
s1 = sym(sqrt(2)), y1 = s1*cos(theta), z1 = s1*sin(theta)
fplot3(sym(0), y1, z1, [0 2*pi], 'm')
hold on;
fsurf(r*cos(theta), r*sin(theta), r, [-3 3 0 2*pi], 'MeshDensity', 16)
axis equal;alpha 0.2
xlabel('x'); ylabel('y'); zlabel('z')

Question 21: Find the surface area of the part of the surface z = xy that lies inside the
cylinder x2+ y2 = 1. Sketch the given surface.
%Calculation
>> syms x y
>> z = x*y
z =
x*y
>> diff(z,1,x)
ans =
y
>> diff(z,1,y)
ans =
x

fun = @(x,y) sqrt(1+x.^2+y.^2);


polarfun = @(phi,r) fun(r.*cos(phi),r.*sin(phi)).*r;
q = integral2(polarfun,0,2*pi,0,1)
area=double(q);
fprintf('The surface area is %6.2f',area)
%Sketch the figure %Rotate to observe the surface
syms z theta
x = cos(theta), y = sin(theta)
figure
fsurf(x, y, z, [0 2*pi -5 5], 'MeshDensity', 12)
axis equal; alpha 0.2
xlabel('x'); ylabel('y'); zlabel('z')
hold on
x=linspace(-1,1,30); y=linspace(-5,5,30); [x,y]=meshgrid(x,y);
f=x.*y
mesh(x,y,f)

36 | 5 6
Question 22: Evaluate the solid bounded by 2x + z = 2 and (x - 1)2 + y2 = z. Sketch the given
solid.
%Calculation
fun = @(x,y) (2-2.*x)-((x-1).^2+y.^2);
polarfun = @(phi,r) fun(r.*cos(phi),r.*sin(phi)).*r;
v = integral2(polarfun,0,2*pi,0,1)
volume=double(v);
fprintf('The volume V of the solid is %6.2f',volume)
%Sketch the figure
phi = linspace (0, 2*pi, 30);
r = linspace(0, 2, 30);
[r, p] = meshgrid(r, phi);
x = r.*cos(p);
y = r.*sin(p);
z = (x-1).^2 + y.^2;
surf(x, y, z, 'FaceColor', 'g', 'FaceAlpha', 0.3);
hold on
x=linspace(-2,2,30); y=linspace(-2,2,30); [x,y]=meshgrid(x,y);
f=2-2.*x;
mesh(x,y,f)
rotate3d on

Question 23: Evaluate the volume of the solid bounded by y = x; y = 2x; x = 1; z = x2 + y2; z
= x2 + 2y2. Sketch the given solid.
%Calculation
fun = @(x,y) (x.^2+2.*y.^2)-(x.^2+y.^2)
ymax = @(x) 2.*x;
ymin = @(x) x
q = integral2(fun,0,1,ymin,ymax)
volume=double(q)
fprintf('The volume of the solid is %6.2f',volume)
%Sketch the solid
[x,y]=meshgrid(-2:.025:2);
z=x.^2+y.^2;
for i=1:length(x)

37 | 5 6
for j=1:length(x)
if z(i,j)> 10^2 || z(i,j) > 10^2
z(i,j)=NaN;x(i,j)=NaN;y(i,j)=NaN;
end
end
end
set(surf(x,y,z),'facecolor','b','edgecolor','non','facealpha',.3);

hold on
[x,y]=meshgrid(-2:.025:2);
z=x.^2+2*y.^2;
for i=1:length(x)
for j=1:length(x)
if z(i,j)> 10^2 || z(i,j) > 10^2/(1/2)
z(i,j)=NaN;x(i,j)=NaN;y(i,j)=NaN;
end
end
end
set(surf(x,y,z),'facecolor','b','edgecolor','non','facealpha',.3);
xlabel('x axis')
ylabel('y axis')
zlabel('z axis')

x=0:0.025:1
y=1:0.025:2
z=0:0.025:12
[Y,Z] = meshgrid(y,z)
X=1+0*Y+0*Z
surf(X,Y,Z,'facecolor','g','edgecolor','non','facealpha',.3);

hold on
x=0:0.025:1
y=0:0.025:2
z=0:0.025:12
[X,Z]=meshgrid(x,z)
Y=X+0*Z
surf(X,Y,Z,'facecolor','g','edgecolor','non','facealpha',.3);

hold on
x=0:0.025:1
y=0:0.025:1
z=0:0.025:12
[X,Z] = meshgrid(x,z)
Y1=2*X+Z*0
surf(X,Y1,Z,'facecolor','g','edgecolor','non','facealpha',.3);

Question 24: Evaluate the volume V of the solid Ω that lies under the paraboloid z=x 2 + y 2;
and above the circular region in the xy-plane x 2+ y 2=2 x . Sketch the given solid.
%Calculation
fun = @(x,y) x.^2+y.^2;
polarfun = @(phi,r) fun(r.*cos(phi),r.*sin(phi)).*r;
rmax = @(phi) 2.*cos(phi);
v = integral2(polarfun,0,2*pi,0,rmax)

38 | 5 6
volume=double(v);
fprintf('The volume V of the solid is %6.2f',volume)
%draw the paraboloid
phi = linspace (0, 2*pi, 30);
r = linspace(0, 2, 30);
[r, p] = meshgrid(r, phi);
x = r.*cos(p);
y = r.*sin(p);
z = x.^2 + y.^2;
surf(x, y, z, 'FaceColor', 'g', 'FaceAlpha', 0.3);
hold on
%draw the cylinder
x1 = linspace(0, 2, 500);
z1 = linspace(0, 4, 500);
[x1,z1] = meshgrid(x1,z1);
y1 = sqrt(-x1.^2 + 2.*x1);
y2 = -sqrt(-x1.^2 + 2.*x1);
surf(x1, real(y1), z1,'FaceColor','b','FaceAlpha',0.5,'EdgeColor','none');
%real for drawing complex number
hold on;
surf(x1, real(y2), z1,'FaceColor','b','FaceAlpha',0.5,'EdgeColor','none');
hold on;
xlabel('x');
ylabel('y');
zlabel('z');
rotate3d on

Question 25: Evaluate the volume V of the solid Ω bounded by z = 1 – x2 – y2 and z = 0.


Sketch the given solid.
%Calculation
%Calculation
fun = @(x,y) 1-x.^2-y.^2;
polarfun = @(phi,r) fun(r.*cos(phi),r.*sin(phi)).*r;
v = integral2(polarfun,0,2*pi,0,1)
volume=double(v);
fprintf('The volume V of the solid is %6.2f',volume)
%Sketch the given solid
clf
hold on
phi=linspace(0,2*pi,30);
r=linspace(0,sqrt(2),30);
[r phi] = meshgrid(r,phi);
x=r.*cos(phi); y=r.*sin(phi);
z = 1-x.^2-y.^2;z1 = 0*x;
surf(x,y,z,'FaceColor','g','FaceAlpha',0.3);
surf(x,y,z1,'FaceColor','b','FaceAlpha',0.3);

39 | 5 6
Question 26: Evaluate the volume of the solid bounded by y = 1 + x2; z = 3x; y = 5; z = 0
(where x > 0). Sketch the given solid.
%Calculation
syms x y z
V=int(int(3*x,y,1+x^2,5),x,0,2)
volume=double(V);
fprintf('The volume V of the solid is %6.2f',volume)
%Sketch the solid
%Observe the solid more easily by rotating the figure
x=0:0.1:2
y=0:0.1:5
z=0:0.1:6
[x,y] = meshgrid(x,y)
z1=3.*x+0*y; z2=0*x+0*y
surf(x,y,z1,'facecolor','g','edgecolor','non','facealpha',.3);
surf(x,y,z2,'facecolor','g','edgecolor','non','facealpha',.3);

hold on
x=0:0.1:2
y=0:0.1:5
z=0:0.1:6
[x z]=meshgrid(x,z);
y1=1+x.^2+0*z; y2=5+0*x+0*z;
mesh(x,y1,z,'facecolor','b','edgecolor','none','facealpha',.5)
mesh(x,y2,z,'facecolor','b','edgecolor','none','facealpha',.5)

Question 27: Find the volume of the tetrahedron Ω bounded by z = 0; x + 2y + z = 2; x =2y;


x = 0. Sketch the given solid.
%Calculation
syms x y z
V=int(int(2-x-2*y,y,x/2,1-x/2),x,0,1)
volume=double(V);

40 | 5 6
fprintf('The volume V of the solid is %6.2f',volume)
%Sketch the solid
pointA = [0,0,2];
pointB = [1,0.5,0];
pointC = [0,1,0];
points=[pointA' pointB' pointC'];
fill3(points(1,:),points(2,:),points(3,:),'r')
grid on
alpha(0.5)

hold on
pointA = [0,0,2];
pointB = [0,0,0];
pointC = [0,1,0];
points=[pointA' pointB' pointC'];
fill3(points(1,:),points(2,:),points(3,:),'r')
grid on
alpha(0.5)

hold on
pointA = [0,0,2];
pointB = [0,0,0];
pointC = [1,0.5,0];
points=[pointA' pointB' pointC'];
fill3(points(1,:),points(2,:),points(3,:),'r')

hold on
pointA = [0,1,0];
pointB = [0,0,0];
pointC = [1,0.5,0];
points=[pointA' pointB' pointC'];
fill3(points(1,:),points(2,:),points(3,:),'r')
axis equal
grid on
alpha(0.5)
xlabel('x axis')
ylabel('y axis')
zlabel('z axis')

π π
Question 28: Evaluate the area of the region D={( r , φ ) :− ≤ φ ≤ , 0 ≤ r ≤ cos 2 φ }. Sketch
4 4
the given region.
%Calculation
fun = @(x,y) 1;
polarfun = @(phi,r) fun(r.*cos(phi),r.*sin(phi)).*r;
rmax = @(phi) cos(2*phi);
v = integral2(polarfun,-pi/4,pi/4,0,rmax)
v=double(v);
fprintf('The result is %6.2f',v)
%Sketch the region
% For the red outer plot [0, 2pi]
theta1 = 0:0.01:2*pi;
rho1 = cos(2*theta1);
% For the blue plot [-pi/4, pi/4]

41 | 5 6
theta2 = -pi/4:0.01:pi/4;
rho2 = cos(2*theta2);
% Plotting the red polar plot
polarplot(theta1,rho1,'r')
hold on
% Plotting multiple blue plots to graph the inequality
for r=0:0.0075:1
polarplot(theta2,r*rho2,'b')
end
hold off

Question 29: Evaluate the area of the region D bounded by y = (x+1)2; x = y-y3; x = -1; y =
-1. Sketch the given region.
%Calculation
syms x y z
I=int(int(1+0*x+0*y,x,-1,y-y^3),y,-1,0) + int(int(1+0*x+0*y,x,-1+sqrt(y),y-
y^3),y,0,1)
result =double(I);
fprintf('The result is %6.2f', result)
%Sketch the region
x1=linspace(-1,0)
y1=(x1+1).^2;
y2=linspace(-1,1)
x2=y2-y2.^3;
x3=linspace(-1,0)
y3=-1+0.*x3;
y4=linspace(-1,0)
x4=-1+0.*y4;
plot(x1,y1);
hold on
plot(x2,y2);
hold on
plot(x3,y3);
hold on
plot(x4,y4)
axis equal

42 | 5 6
Question 30: Evaluate ∬ 2 xdA where D={( x , y ) :2 x ≤ x 2 + y 2 ≤ 6 x , y ≤ x . Sketch the given
D
region.
%Calculation
fun = @(x,y) 2.*x;
polarfun = @(phi,r) fun(r.*cos(phi),r.*sin(phi)).*r;
rmax = @(phi) 6.*cos(phi);
rmin = @(phi) 2.*cos(phi);
I = integral2(polarfun,-pi/2,pi/4,rmin,rmax)
result=double(I);
fprintf('The result is %6.2f',result)
%Sketch the region
ang=-pi:0.01:pi/2;
xp=1*cos(ang);
yp=1*sin(ang);
plot(1+xp,yp);

hold on
ang=-pi:0.01:pi/2;
xp=3*cos(ang);
yp=3*sin(ang);
plot(3+xp,yp)

hold on
x1=linspace(0,3);
y1=x1;
plot(x1,y1);
axis equal

Question 31: Evaluate the area of the region D bounded by x + y2 =1; y - x = 1; x = 0. Sketch
the given region.
%Calculation
syms x y z
I=int(int(1+0*x+0*y,x,y-1,1-y^2),y,-1,1)
result =double(I);
fprintf('The result is %6.2f', result)
%Sketch the region
y1=linspace(-2,-1)
x1=1-y1.^2;
plot(x1,y1);

hold on
x2=linspace(-3,0)
y2=1+x2;
plot(x2,y2);

hold on
y3=linspace(-1,1)
x3=0+0.*y3;
plot(x3,y3,'g--');

43 | 5 6
Question 32: Evaluate ∬ (x + y )dA where D={( x , y ) :1≤ x 2+ y 2 ≤ 4 , x ≥ 0 , y ≥0 , y ≥ x }.
D
Sketch the given region.
%Calculation
fun = @(x,y) x+y;
polarfun = @(phi,r) fun(r.*cos(phi),r.*sin(phi)).*r;
I = integral2(polarfun,pi/4,pi/2,1,2)
result =double(I);
fprintf('The result is %6.2f', result)
%Sketch the region
ang=pi/4:0.01:pi/2;
xp=1*cos(ang);
yp=1*sin(ang);
plot(xp,yp);

hold on
ang=pi/4:0.01:pi/2;
xp=2*cos(ang);
yp=2*sin(ang);
plot(xp,yp)

y1=linspace(0,2)
x1=0+0*y1;
plot(x1,y1);

hold on
x2=linspace(0,sqrt(2))
y2=x2;
plot(x2,y2);
axis equal

44 | 5 6
Question 33: Evaluate ∬ (3 x + y 2) dA where D={( x , y ) :1≤ x 2+ y 2 ≤ 4 , y ≥0 }. Sketch the
D
given region.
%Calculation
fun = @(x,y) 3.*x+4.*y.^2;
polarfun = @(phi,r) fun(r.*cos(phi),r.*sin(phi)).*r;
I = integral2(polarfun,0,pi,1,2)
result =double(I);
fprintf('The result is %6.2f', result)
%Sketch the region
ang=0:0.01:pi;
xp=1*cos(ang);
yp=1*sin(ang);
plot(xp,yp);

hold on
ang=0:0.01:pi;
xp=2*cos(ang);
yp=2*sin(ang);
plot(xp,yp)
axis equal

hold on
x1=linspace(-2,2)
y1=0+0*x1
plot(x1,y1);

1 1
2
x
Question 34: Evaluate I =∫ dy ∫ e dx . Sketch the given region.
0 y
%Calculation
syms x y z
I=int(int(exp(x^2),y,0,x),x,0,1)
result =double(I);
fprintf('The result is %6.2f', result)
%Sketch the region
x1=linspace(0,1)
y1=x1;
plot(x1,y1);

hold on
y2=linspace(0,1)
x2=1+0.*y2;
plot(x2,y2,'r*');

hold on
x3=linspace(0,1)
y3=0+0.*x3;
plot(x3,y3,'g*');

45 | 5 6
x
Question 35: Evaluate ∬ e y dA where D is the region bounded by y2 = x; x = 0; y = 1.
D
Sketch the given region.
%Calculation
syms x y z
I=int(int(exp(x/y),x,0,y^2),y,0,1)
Evaluation=double(I)
fprintf('The result is %6.2f',Evaluation)
%Sketch the region
x1=linspace(0,1)
y1=1+0.*x1;
plot(x1,y1,'b--');

hold on
y2=linspace(0,1)
x2=y2.^2;
plot(x2,y2,'r--');

hold on
y3=linspace(0,1)
x3=0+0.*y3
plot(x3,y3,'g--');
axis equal

Question 36: Evaluate ∬ xdA where D is a triangle OAB; O(0; 0); A(1; 1); B(0; 1). Sketch
D
the given region.
%Calculation
syms x y z
I=int(int(x,y,x,1),x,0,1)
Evaluation=double(I)
fprintf('The result is %6.2f',Evaluation)

46 | 5 6
%Sketch the region
x1=linspace(0,1)
y1=1+0.*x1;
plot(x1,y1,'b--');

hold on
y2=linspace(0,1)
x2=y2;
plot(x2,y2,'r--');

hold on
y3=linspace(0,1)
x3=0+0.*y3
plot(x3,y3,'g--');
axis equal

π π
Question 37: Evaluate I=∬ (sin x cos y )dA ; where D={( x , y ) :0 ≤ x ≤ , 0 ≤ y ≤ }. Sketch
D 2 2
the given region.
%Calculation
syms x y z
I=int(int(sin(x)*cos(y),y,0,pi/2),x,0,pi/2)
Evaluation=double(I)
fprintf('The result is %6.2f',Evaluation)
%Sketch the region
x1=linspace(0,pi/2)
y1=0+0.*x1
plot(x1,y1,'b--');

hold on
y2=linspace(0,pi/2)
x2=0+0.*y2;
plot(x2,y2,'b--');

hold on
x3=linspace(0,pi/2)
y3=pi/2+0.*x3
plot(x3,y3,'g--');

hold on
y4=linspace(0,pi/2)
x4=pi/2+0.*y4;
plot(x4,y4,'r--');
axis equal

47 | 5 6
2
Question 38: Evaluate∬ (3 y −x )dA ; where D={( x , y ) :0 ≤ x ≤2 , 1≤ y ≤2 }. Sketch the
D
given region.
%Calculation
syms x y z
I=int(int(3*y^2-x,y,1,2),x,0,2)
Evaluation=double(I)
fprintf('The result is %6.2f',Evaluation)
%Sketch the region
x1=linspace(0,2)
y1=1+0.*x1
plot(x1,y1,'b--');

hold on
y2=linspace(1,2)
x2=0+0.*y2;
plot(x2,y2,'b--');

hold on
x3=linspace(0,2)
y3=2+0.*x3
plot(x3,y3,'g--');

hold on
y4=linspace(1,2)
x4=2+0.*y4;
plot(x4,y4,'r--');
axis equal

Question 39: Evaluate ∭ xy z 2 dV ; where Ω is the rectangular box given by


Ω
Ω :0 ≤ x ≤1 ,−1≤ y ≤ 2 , 0 ≤ z ≤3. Sketch the given solid.
%Calculation
syms x y z

48 | 5 6
I=int(int(int(x*y*z^2,z,0,3),y,-1,2),x,0,1)
Evaluation=double(I)
fprintf('The result is %6.2f',Evaluation)
%Sketch the solid
x = linspace(0, 1, 50);y = linspace(-1, 2, 50);
z = linspace(0, 3, 50);
[X,Y ] = meshgrid(x,y);
surf (X,Y,3+0*X)
hold on
mesh(X,Y,0*X)
[X,Z] = meshgrid(x,z);
surf (X, -1+0*X,Z,'FaceColor','g','EdgeColor','b','FaceAlpha', 0.1);
surf (X,2+0*X,Z,'FaceColor','g','EdgeColor','g','FaceAlpha', 0.1);
[Y ,Z] = meshgrid(y,z);
surf (0*Y ,Y ,Z,'FaceColor','b','EdgeColor','g','FaceAlpha', 0.1);
surf (1+0*Y ,Y ,Z,'FaceColor','b','EdgeColor','g','FaceAlpha', 0.1);
axis([-1 1 -2 2 0 8])
view(120,12)
grid on

Question 40: Evaluate I =∭ ( x +2 y)dV e; where Ω is the solid bounded by


Ω

x 2 ≤ y ≤ x ,0 ≤ z ≤ x . Sketch the given solid.


%Calculation
syms x y z
I=int(int(int(x+2*y,z,0,x),y,x^2,x),x,0,1)
Calculation=double(I)
fprintf('The result is %6.2f',Calculation)
%Sketch the solid
x=linspace(0,1);z=linspace(0,1);
[x z]=meshgrid(x,z);
for i=1:length(x)
for j=1:length(z)
if z(i,j)- x(i,j) > 0
x(i,j)= NaN;
y1(i,j)= NaN;
end;
end;
end;
y1= x.^2;
mesh(x,y1,z);
hold on;
y2=x;
mesh(x,y2,z);

49 | 5 6
2 2
Question 41: Evaluate I =∭ √ x + z dV where Ω is the region bounded by x 2+ z2 ≤ y ≤ 4 .
Ω
Sketch the given solid.
%Calculation
>> syms x y z

>> I=int(int(int(sqrt(x^2+z^2),y,x^2+y^2,4),x),z)

I = int(int(-(x^2 + z^2)^(1/2)*(x^2 + y^2 - 4), x), z)

>> fun = @(x,y) -sqrt(x.^2+y.^2).*(x.^2+y.^2-4);


polarfun = @(phi,r) fun(r.*cos(phi),r.*sin(phi)).*r;
I = integral2(polarfun,0,2*pi,0,2)
Calculation=double(I)
fprintf('The result is %6.2f',Calculation)
%Sketch the solid
phi = linspace (0, 2*pi, 30);
r = linspace(0, 2, 30);
[r, p] = meshgrid(r, phi);
x = r.*cos(p);
z = r.*sin(p);
y = x.^2 + z.^2;
surf(x, y, z, 'FaceColor', 'g', 'FaceAlpha', 0.3);

hold on
phi=linspace(0,2*pi,30);
r=linspace(0,2,30);
[r phi] = meshgrid(r,phi);
x=r.*cos(phi); z=r.*sin(phi);
y = 4+0.*x+0.*z; y1 = 0+0.*x+0.*z
surf(x,y,z,'FaceColor','b','FaceAlpha',0.3);
surf(x,y1,z,'FaceColor','b','FaceAlpha',0.3);

50 | 5 6
Question 42: Evaluate the triple integral with cylindrical coordinates I =∭ 2 xdV where
Ω
2
Ω={( x , y , z ) :0 ≤ y ≤ 2 ; 0 ≤ x ≤ √ 4− y ; 0 ≤ z ≤ x. Sketch the given solid.
%Calculation
>>syms x y z
>>I=int(2*x,z,0,x)
I = 2*x^2
>>fun = @(x,y) 2.*x.^2;
polarfun = @(phi,r) fun(r.*cos(phi),r.*sin(phi)).*r;
I = integral2(polarfun,0,pi/2,0,2)
Calculation=double(I)
fprintf('The result is %6.2f',Calculation)
%Sketch the figure
clc; close all; clear all; %clears command window
x=-5:0.05:5;
y=-5:0.05:5;
z=-5:0.05:5;
[X,Y,Z] = meshgrid(x,y,z);
Omega = (Y>=0) & (Y<=2) & (X>=0) & (X <= sqrt(4 - Y.^2)) & (Z==0);
scatter3(X(Omega),Y(Omega),Z(Omega),'filled');
xlabel('X'); ylabel('Y'); zlabel('Z');

Question 43: Evaluate the triple integral with cylindrical coordinates I =∭ zdV where Ω is
Ω
the solid that lies within the cylinder x2 + y2 = 1; above the paraboloid z = x2 + y2 and below
the paraboloid z = 2x2 + y2. Sketch the given solid.
%Calculation
>>syms x y z
>>I=int(z,z,x^2+y^2,2*x^2+y^2)
I = (3*x^4)/2 + x^2*y^2
>>fun = @(x,y) (3.*x.^4)./2+x.^2.*y.^2 ;
polarfun = @(phi,r) fun(r.*cos(phi),r.*sin(phi)).*r;
I = integral2(polarfun,0,2*pi,0,1)
Calculation=double(I)
fprintf('The result is %6.2f',Calculation)
%Sketch the figure
syms z theta
x = cos(theta), y = sin(theta)
figure
fsurf(x, y, z, [0 2*pi 0 4], 'MeshDensity', 12)
axis equal; alpha 0.2
xlabel('x'); ylabel('y'); zlabel('z')
hold on
phi = linspace (0, 2*pi, 30);
r = linspace(0, 2, 30);
[r, p] = meshgrid(r, phi);
x = r.*cos(p);
y = r.*sin(p);
z1 = x.^2 + y.^2;
surf(x, y, z1, 'FaceColor', 'g', 'FaceAlpha', 0.3);
hold on
z2 = 2.*x.^2 + y.^2;
surf(x, y, z2, 'FaceColor', 'r', 'FaceAlpha', 0.3);

51 | 5 6
1
Question 44: Evaluate the triple integral with cylindrical coordinates I =∭ 2 2
dV
Ω x +y
where Ω is the solid bounded by z = 0; z = y; x2 + y2 = 1 and y ≥ 0. Sketch the given solid.
%Calculation
>>syms x y z
>>I=int(1/(x^2+y^2),z,0,y)
I = y/(x^2 + y^2)
>>fun = @(x,y) y./(x.^2 + y.^2) ;
polarfun = @(phi,r) fun(r.*cos(phi),r.*sin(phi)).*r;
I = integral2(polarfun,0,2*pi,0,1)
Result=double(I)
%Sketch the figure
% Please wait for the figure. It is so long that result is displayed on the
screen
clc
clf
hold on
grid on
rotate3d on
syms z theta
x = cos(theta), y = sin(theta)
fsurf(x, y, z, [0 2*pi 0 1], 'MeshDensity', 12)
axis equal; alpha 0.2
y=linspace(0,1,100); x=linspace(-1,1,100);
[x y]=meshgrid(x,y);
z2=y; z3=0+0*x+0*y
for i=1:length(x)
for j=1:length(y)
if (x(i,j))^2+ (y(i,j))^2 > 1
z2(i,j)=NaN; z3(i,j)=NaN
end
end
end
mesh(x,y,z2,'facecolor','b','edgecolor','none','facealpha',.5)
mesh(x,y,z3,'facecolor','b','edgecolor','none','facealpha',.3)

52 | 5 6
2 2
Question 45: Evaluate the triple integral with cylindrical coordinates I =∭ z √ x + y dV
Ω
2
where Ω :0 ≤ z ≤1 , 0 ≤ y ≤ √ 2 x−x .Sketch the given solid.
%Calculation
>>syms x y z
>>I=int(z*sqrt(x^2+y^2),z,0,1)
I =

(x^2 + y^2)^(1/2)/2
>>fun = @(x,y) (x.^2 + y.^2).^(1./2)./2 ;
polarfun = @(phi,r) fun(r.*cos(phi),r.*sin(phi)).*r;
rmax = @(phi) 2.*cos(phi)
I = integral2(polarfun,0,pi/2,0,rmax)
Result=double(I)
%Sketch the figure
clc;
clear
close all;
syms x
y = sqrt(2*x-x^2);
fsurf(y,[0 1])

Question 46: Evaluate the triple integral with spherical coordinates I =∭ (x + z )dV where
Ω
Ω is the unit ball x2 + y2 + z2 ≤ 1. Sketch the given solid.
%Calculation
fun = @(x,y,z) x+z+0.*y;
sphericalfun = @(theta,phi,rho)
fun(rho.*sin(theta).*cos(phi),rho.*sin(theta).*sin(phi),rho.*cos(theta)).*r
ho.^2.*sin(theta);
I = int(int(int(sphericalfun,rho,0,1),phi,0,2*pi),theta,0,pi)
Result=double(I)
%Sketch the solid
syms phi theta

53 | 5 6
x = sin(phi)*cos(theta), y = sin(phi)*sin(theta), z = cos(phi)
figure
fsurf(x, y, z, [0 pi 0 2*pi], 'MeshDensity', 20); hold on
x = cos(theta), y = sin(theta)
fplot3(x, y, sym(0), [0 2*pi], 'r')
s1 = sym(sqrt(1)), y = s1*cos(theta), z = s1*sin(theta)
fplot3(sym(0), y, z, [0 2*pi], 'm')
axis equal; alpha 0.2
xlabel('x'); ylabel('y'); zlabel('z')

2 2
Question 47: Evaluate the triple integral with spherical coordinates I =∭ ( x + y ) dV where
Ω
Ω is the solid hemisphere x + y + z ≤ 1; z ≥ 0: Sketch the given solid.
2 2 2

%Calculation
fun = @(x,y,z) x.^2+y.^2+z.*0;
sphericalfun = @(theta,phi,rho)
fun(rho.*sin(theta).*cos(phi),rho.*sin(theta).*sin(phi),rho.*cos(theta)).*r
ho.^2.*sin(theta);
I = int(int(int(sphericalfun,rho,0,1),phi,0,2*pi),theta,0,pi/2)
Result=double(I)
%Sketch the solid
syms phi theta
x = sin(phi)*cos(theta), y = sin(phi)*sin(theta), z = cos(phi)
figure
fsurf(x, y, z, [0 pi/2 0 2*pi], 'MeshDensity', 20);

2 2 2
Question 48: Evaluate the triple integral with spherical coordinates I =∭ (x + y + z )dV
Ω
2 2 2 2 2 2
where Ω lies between the spheres x + y + z = 1 and x + y + z = 4 in the first octant. Sketch
the given solid.
%Calculation
fun = @(x,y,z) x.^2+y.^2+z.^2;
sphericalfun = @(theta,phi,rho)
fun(rho.*sin(theta).*cos(phi),rho.*sin(theta).*sin(phi),rho.*cos(theta)).*r
ho.^2.*sin(theta);
I = int(int(int(sphericalfun,rho,1,2),phi,0,pi/2),theta,0,pi/2)

54 | 5 6
Result=double(I)
%Sketch the given solid
clf
phi=linspace(0,pi/2,30);
theta=linspace(0,pi/2,30);
[p t]=meshgrid(phi,theta);
x=sin(t).*cos(p); y=sin(t).*sin(p); z=cos(t);
hold on
x2=2*sin(t).*cos(p);
y2=2*sin(t).*sin(p);
z2=2*cos(t);
mesh(x2,y2,z2,'FaceColor','g','FaceAlpha',0.3);
r=linspace(1,2,30)
[r th]=meshgrid(r,theta);
x3=sin(th).*r.*cos(0);
y3=sin(th).*r.*sin(0);
z3=r.*cos(th);
mesh(x3,y3,z3,'FaceColor','b','FaceAlpha',0.3);
x4=sin(th).*r.*cos(pi/2);
y4=sin(th).*r.*sin(pi/2);
z4=r.*cos(th);
mesh(x4,y4,z4,'FaceColor','b','FaceAlpha',0.3);
[r phi]=meshgrid(r,phi);
x5=sin(pi/2).*r.*cos(phi);
y5=sin(pi/2).*r.*sin(phi);
z5=r.*cos(pi/2);
mesh(x5,y5,z5,'FaceColor','r','FaceAlpha',0.3);
rotate3d on
xlabel('x'); ylabel('y'); zlabel('z');

1
Question 49: Evaluate the triple integral with spherical coordinates I =∭ 2 2 2
dV
Ω x + y +z

where Ω is the solid that lies within the sphere x2 + y2 + z2 = 4 and above the cone z=√ x 2+ y 2
.Sketch the given solid.
%Calculation
fun = @(x,y,z) 1./(x.^2+y.^2+z.^2);
sphericalfun = @(theta,phi,rho)
fun(rho.*sin(theta).*cos(phi),rho.*sin(theta).*sin(phi),rho.*cos(theta)).*r
ho.^2.*sin(theta);
I = int(int(int(sphericalfun,rho,0,2),phi,0,2*pi),theta,0,pi/4)
Result=double(I)
%Sketch the figure
syms phi theta z2 r x y z
x1 = 2*sin(phi)*cos(theta), y1 = 2*sin(phi)*sin(theta), z1 = 2*cos(phi)
figure
fsurf(x1, y1, z1, [0 pi 0 2*pi], 'MeshDensity', 20); hold on
x1 = 2*cos(theta), y1 = 2*sin(theta)
fplot3(x1, y1, sym(0), [0 2*pi], 'r')
s1 = sym(sqrt(4)), y1 = s1*cos(theta), z1 = s1*sin(theta)
fplot3(sym(0), y1, z1, [0 2*pi], 'm')
hold on;
fsurf(r*cos(theta), r*sin(theta), r, [0 3 0 2*pi], 'MeshDensity', 16)
axis equal;alpha 0.2
xlabel('x'); ylabel('y'); zlabel('z')

55 | 5 6
Question 50: Evaluate the triple integral with spherical coordinates where
Ω={( x , y , z ) ∈ R 3 : x 2 + y 2+ z2 ≤1 , z ≥ 0 }. Sketch the given solid.
%Calculation
syms x y z theta phi rho;
fun = @(x,y,z) exp(sqrt(x.^2+y.^2+z.^2));
sphericalfun = @(theta,phi,rho)
fun(rho.*sin(theta).*cos(phi),rho.*sin(theta).*sin(phi),rho.*cos(theta)).*r
ho.^2.*sin(theta);
I = int(int(int(sphericalfun,rho,0,1),phi,0,2*pi),theta,0,pi)
Result=double(I)
% Please wait for result. It is so long that result is displayed on the
screen
%Sketch the solid
syms phi theta
x = sin(phi)*cos(theta), y = sin(phi)*sin(theta), z = cos(phi)
figure
fsurf(x, y, z, [0 pi/2 0 2*pi], 'MeshDensity', 20);

Question 51: Use spherical coordinates to find the volume of the solid that lies above the
cone z=√ x 2+ y 2 and below the sphere x2 + y2 + z2 = z. Sketch the given solid.
%Calculation
syms x y z theta phi rho;
fun = @(x,y,z) 0.*x+0*y+0.*z+1;
sphericalfun = @(theta,phi,rho)
fun(rho.*sin(theta).*cos(phi),rho.*sin(theta).*sin(phi),rho.*cos(theta)).*r
ho.^2.*sin(theta);
I = int(int(int(sphericalfun,rho,0,cos(theta)),phi,0,2*pi),theta,0,pi/4)
Result=double(I)
%Sketch the figure
syms phi theta
x = 0.5*sin(phi)*cos(theta), y = 0.5*sin(phi)*sin(theta), z = 1/2 +
0.5*cos(phi)
figure
fsurf(x, y, z, [0 pi/2 0 2*pi], 'MeshDensity', 20); hold on

56 | 5 6
x = 0*cos(theta), y = 0*sin(theta)
fplot3(x, y, sym(0), [0 2*pi], 'r')
s1 = sym(sqrt(1/4)), y = s1*cos(theta), z = 1/2 + s1*sin(theta)
fplot3(sym(0), y, z, [0 2*pi], 'm')
axis equal; alpha 0.2
hold on
fsurf(r*cos(theta), r*sin(theta), r, [0 0.5 0 2*pi], 'MeshDensity', 16)
axis equal;alpha 0.2
xlabel('x'); ylabel('y'); zlabel('z')

-The end-

57 | 5 6

Common questions

Powered by AI

To identify different types of critical points on a function of two variables, you calculate the first partial derivatives and set them to zero to find critical points. Then, the second derivatives are used to compute the Hessian determinant (Delta = AC - B^2, where A, C are second derivatives with respect to x and y, B is the mixed derivative). A positive Delta with A > 0 indicates a local minimum, Delta > 0 with A < 0 indicates a local maximum, and Delta < 0 indicates a saddle point. If Delta is zero, the test is inconclusive .

To determine the extreme values of a function f(x, y) on a given constraint, such as x^2 + y^3 = 1, you need to use the method of Lagrange multipliers. This involves defining a Lagrangian L=f-λ(φ) where φ is the constraint equation. You compute the partial derivatives of L with respect to x, y, and λ, and solve the resulting system of equations. For the function f(x, y) = x^2 + y^2 on x^2 + y^3 = 1, critical points are found and analyzed using the second derivative test to determine if they correspond to maxima, minima, or saddle points .

When evaluating the integral of a function over a hemisphere using spherical coordinates, you need to consider specific bounds for the angles and radial distance. The radial coordinate ρ ranges from 0 to the hemisphere's radius. The polar angle θ is typically from 0 to π/2 to cover only the top half (z ≥ 0) of the sphere. The azimuthal angle φ extends from 0 to 2π. This setup ensures the integration covers the entire hemispherical volume .

The procedure to evaluate a triple integral using cylindrical coordinates involves transforming the Cartesian coordinates (x, y, z) into cylindrical coordinates (r, θ, z), where x = rcos(θ), y = rsin(θ), and z = z. The volume element dV in cylindrical coordinates is r dr dθ dz. For the given region, set up the integral by determining the bounds for r, θ, and z. For example, evaluating I=∭ z dV for a solid within x^2+y^2=1 and bounded by z=x^2+y^2 and z=2x^2+y^2 involves using r, θ limits from 0 to 1 and 0 to 2π, respectively, and integration of the z term over appropriate z bounds .

For shapes with radial symmetry in a three-dimensional space, using spherical coordinates enables efficient evaluation of integrals. This approach takes advantage of radial symmetry, where the volume element dV becomes ρ^2 sin(φ) dρ dφ dθ, aligning with the natural symmetries of spheres. Consequently, integration bounds simplify substantially, reducing the complexity associated with Cartesian or cylindrical coordinates. This approach is particularly effective for regions like spheres or spherical caps, where symmetry makes transformations and operations straightforward .

To determine if a point within a constrained region is optimal, apply the Kuhn-Tucker conditions (generalization of Lagrange multipliers). Start by setting up the Lagrangian with the function and constraints and find the critical points where the gradient of the function and the weighted gradient of the constraints are equal. Evaluate the second derivatives to form the Hessian, and use the second derivative test for constrained optimization to determine the nature of each critical point. The point is optimal (local maximum or minimum) if these tests satisfy necessary conditions (i.e., positive semidefiniteness for minima).

Spherical coordinates are preferred over Cartesian or cylindrical coordinates in triple integrals when the region of integration is spherical or involves spheres or spherical caps. This is because spherical coordinates (ρ, θ, φ) naturally align with the symmetry of spheres, simplifying the integration process. For example, in a volume described by x^2 + y^2 + z^2 ≤ 1 or when the region is a part of a sphere (such as a hemisphere), spherical coordinates are more efficient. They allow for straightforward integration by simplifying the volume element and making it easier to set up bounds .

The method of Lagrange multipliers helps in optimizing functions with constraints by converting a constrained optimization problem into a system of equations that can be solved simultaneously. By introducing a Lagrange multiplier λ for each constraint, the method forms a new function L = f(x, y) - λ(g(x, y) - c), where g(x, y) = c is the constraint. Solving the equations derived from the gradients of L (∂L/∂x = 0, ∂L/∂y = 0, ∂L/∂λ = 0) finds critical points that are candidate solutions for the extremum of f under the given constraint .

To analyze and classify stationary points of the function f(x, y) = (x^2 - 2y^2) * e^(x-y), first calculate the partial derivatives with respect to x and y, set them to zero, and solve the resulting equations to find the stationary points. Next, compute the second derivatives to form the Hessian matrix and evaluate the discriminant Delta. If Delta > 0 and A > 0, the point is a local minimum; if Delta > 0 and A < 0, it's a local maximum. A negative Delta indicates a saddle point, and Delta = 0 suggests inconclusive results .

To visualize a solid region in a triple integral problem using computational tools, such as MATLAB, you would create a grid of points over the region of interest, typically using meshgrid for the variables x, y, and sometimes z. Define logical conditions to identify points within the solid volume, then use these conditions to plot the region using functions like mesh or surf with transparency to illustrate the volume clearly. For example, in a region within a cylinder and between two paraboloids, use meshgrid to plot these surfaces and adjust their face color and alpha values for clear visualization .

You might also like