MAT 201, Lab #4, Spring 2016
Name _____________________________________________
Directions: The labs for this course will require the use of MatLab (mostly). Instructions on how to
access MatLab can be found under a separate document posted in the course. Use the listed example
code to complete the following exercises. Print the resulting MatLab worksheet. Circle and number the
solutions to the problems on the printout. Or, copy and paste the contents of the MatLab worksheet
into a file, note the problem numbers in the code, to submit the problems electronically.
Example Code File: 201lab_ex4.pdf
The code file begins by declaring variables. You will need to declare any variables you intend to use
before you use them. The file declares the variables: ๐ฅ, ๐ฆ, ๐ง. Then we define a function ๐(๐ฅ, ๐ฆ) =
sin(๐ฅ๐ฆ) + cos(๐ฅ๐ฆ 2 ) and take the partial derivatives with respect to both ๐ฅ and ๐ฆ.
If we want to compute a derivative like ๐๐ฅ๐ฆ๐ฆ , that code follows with embedded derivative commands.
Recall the inside command is the one that gets executed first.
2
4
Integration works similarly. To compute the double integral ∫1 ∫−3 ๐ฅ๐ฆ๐๐ฆ๐๐ฅ , we define the function, and
use embedded integration commands. Or we can create integrals with variable limits of integration,
which follows in the code. You can do this in one stage or two, with the intermediate stage being a
function. You will need to save the result using the define function code. We will use this when we find
potential functions.
The last bit of code creates a gradient vector ∇โ for โ(๐ฅ, ๐ฆ, ๐ง) = ๐ฅ๐ฆ๐ง + 2 cos ๐ฅ − 3๐ง 2 − arcsin ๐ฆ, and
then expresses it as a column vector.
Use these examples to complete the following:
1. Find the indicated partial derivatives.
a. ๐(๐ฅ, ๐ฆ, ๐ง) = ๐ฅ 2 ๐ฆ + arctan(2๐ง) , ๐๐ฅ , ๐๐ง , ๐๐ฆ๐ง
b. ๐(๐ฅ, ๐ฆ, ๐ง) = ๐ฅ๐ ๐ฆ๐ง − cos(๐ฅ ln ๐ฆ) , ๐๐ฅ๐ฆ , ๐๐ง๐ฆ๐ฅ
2. Find the values of the double integrals.
4 2
a. ∫0 ∫−1 cos 2(๐ฅ) sin(๐ฆ) ๐๐ฆ๐๐ฅ
1
๐ฅ2
b. ∫−1 ∫0 ๐ฅ 2 ๐ฆ 3 ๐๐ฆ๐๐ฅ
3. For the function ๐(๐ฅ, ๐ฆ, ๐ง), and the vector field ๐นโ (๐ฅ, ๐ฆ, ๐ง) = (๐ฅ + ๐ฆ)๐ฬ + (tan ๐ฆ + ๐ฅ๐ง)๐ฬ +
(๐ง 2 − 1)๐ฬ, find the following:
a. ∇๐
b. ∇ × ๐นโ
c. ∇ โ ๐นโ
d. ∇2 ๐
To submit your solutions, copy and paste the graphs and the code into a file for printing or to submit by
email. Mark the sections of your code that correspond to which problems, and label your graphs.