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.