Mathematica Lesson 10: Double and Triple Integrals
Mathematica Lesson 10: Double and Triple Integrals
In the menu at the top, click Make Your Own Copy to work in Mathematica Online, or click Download to use it in Mathematica.
When asked "Do you want to automatically evaluate all the initialization cells in the notebook...?" I recommend "No" so that you can work through each cell one-at-a-time.
In the menu at the top, click Make Your Own Copy to work in Mathematica Online, or click Download to use it in Mathematica.
When asked "Do you want to automatically evaluate all the initialization cells in the notebook...?" I recommend "No" so that you can work through each cell one-at-a-time.
When asked "Do you want to automatically evaluate all the initialization cells in the notebook...?" I recommend "No" so that you can work through each cell one-at-a-time.
Double Integration
Double Integration
Question 1
Question 1
It is easy to do both indefinite and definite integrals in Mathematica. The syntax for a single indefinite integral isIntegrate[the function,the variable]For example, to do ∫ x³ dx , type
Integrate[x^3,x]
The syntax for a single definite integral isIntegrate[the function,{the variable, lower bound, upper bound}]For example, to do ∫ sin³(x) dx from x=0 to x=1, do
Integrate[Sin[x]^3,{x,0,1}]
You will see the exact answer. Try //N or N[%] to provide the answer on Moodle to the nearest hundredth:
Question 2
Question 2
To do double and triple integrals, we just iterate this procedure (thanks to Fubini's theorem!).To compute ∫₀⁴∫₃⁶ sin(x+y) dx dy, try
Integrate[Integrate[Sin[x+y],{x,3,6}],{y,0,4}]
What is the answer to the nearest hundredth?
Question 3
Question 3
You can set up double and triple integrals in Mathematica over domains which are not rectangular.
Write the code that would compute the double integral of g(x,y)=exp(xy) over the domain in the first quadrant enclosed between the graphs of
y = x² and y = sqrt(x).
Write the code that would compute the double integral of g(x,y)=exp(xy) over the domain in the first quadrant enclosed between the graphs of
y = x² and y = sqrt(x).
The result uses functions which are not "elementary functions" -- this cannot be done by hand. Use //N to get the result to the nearest hundredth
Question 4
Question 4
Let Ω be the subset of ℝ² enclosed in the first quadrant between y=0, x=1, and y=x.
Set up the integral of f(x,y)=4ycos(x) over Ω, with differentials ordered dy dx.
Next, use Mathematica to evaluate the integral to the nearest hundredth:
Set up the integral of f(x,y)=4ycos(x) over Ω, with differentials ordered dy dx.
Next, use Mathematica to evaluate the integral to the nearest hundredth:
Question 5
Question 5
Let Ω be the subset of ℝ² enclosed in the first quadrant between x=0, y=2, and y=sqrt(x).
Set up the integral of f(x,y)=x³y⁵ - 3 over Ω, with differentials ordered dx dy.
Next, use Mathematica to evaluate the integral to the nearest hundredth:
Set up the integral of f(x,y)=x³y⁵ - 3 over Ω, with differentials ordered dx dy.
Next, use Mathematica to evaluate the integral to the nearest hundredth:
Question 6
Question 6
Set up the integral to compute the volume of the region in the first octant bounded by the parabolic cylinder z=36−x² and y=5.
Next, use Mathematica to evaluate the integral to compute the volume:
Next, use Mathematica to evaluate the integral to compute the volume:
Triple Integration
Triple Integration
Question 7
Question 7
Triple integrals are similar, just with an extra round of Integrate.
Let Ω be the subset of ℝ³ which is in the first octant, under the graph of z = x and over the rectangle in the xy-plane given by 1 ≤ x ≤ 4, 2 ≤ y ≤ 6.
Set up the integral of f(x,y,z)=1−xyz over Ω with differentials ordered dz dx dy.
Next, use Mathematica to evaluate the integral:
Let Ω be the subset of ℝ³ which is in the first octant, under the graph of z = x and over the rectangle in the xy-plane given by 1 ≤ x ≤ 4, 2 ≤ y ≤ 6.
Set up the integral of f(x,y,z)=1−xyz over Ω with differentials ordered dz dx dy.
Next, use Mathematica to evaluate the integral:
Question 8
Question 8
Let Ω be the subset of ℝ³ which is in the first octant, under the graph of z = x² + y² and over the triangle in the xy-plane with vertices at (0,0), (1,0) and (0,1).
Set up the integral of f(x,y,z)=15xz over Ω with differentials ordered dz dy dx.
Next, use Mathematica to evaluate the integral:
Set up the integral of f(x,y,z)=15xz over Ω with differentials ordered dz dy dx.
Next, use Mathematica to evaluate the integral:
RegionPlot and RegionPlot3D
RegionPlot and RegionPlot3D
Information
Information
After we learn Fubini's Theorem, we realize that the act of anti-differentiation for higher dimensional integrals is not usually harder than for Calculus 1 -- we just need to do it two or three times.
I find that the challenge of higher dimensional integrals is setting up the bounds for each integral. Setting up the bounds correctly requires understanding the domain of integration.
To check if you are describing a region correctly in ℝ², you can use RegionPlot. The following example plots the rectangular region 0<x<1, 0<y<3 in a window which is sized larger: −5 ≤ x ≤ 5,−5 ≤ y ≤ 5.
I find that the challenge of higher dimensional integrals is setting up the bounds for each integral. Setting up the bounds correctly requires understanding the domain of integration.
To check if you are describing a region correctly in ℝ², you can use RegionPlot. The following example plots the rectangular region 0<x<1, 0<y<3 in a window which is sized larger: −5 ≤ x ≤ 5,−5 ≤ y ≤ 5.
In[]:=
RegionPlot[0<x<1&&0<y<3,{x,-5,5},{y,-5,5}]
Question 10
Question 10
Which of the following graphs the solid upper semicircle of radius 1 in the xy-plane? Additionally, try to recognize what shapes the others are describing.
RegionPlot[0≤y≤Sqrt[1-x^2]&&-1≤x≤1,{x,-2,2},{y,-2,2}]
RegionPlot[x^2+y^2≤1,{x,-2,2},{y,-2,2}]
RegionPlot[y≤Sqrt[1-x^2],{x,-2,2},{y,-2,2}]
RegionPlot[-Sqrt[1-x^2]≤y≤0&&-1≤x≤1,{x,-2,2},{y,-2,2}]
RegionPlot[x^2+y^2≤1&&y>0,{x,-2,2},{y,-2,2}]
Question 11
Question 11
You can also visualize regions in ℝ³ with RegionPlot3D. From Moodle, match the integral bounds and region descriptions with the correct visualizations below.
(I have added PlotPoints to help fill in "missing white space" in the images. Do not go overboard with PlotPoints, it can really slow down the program. You'll notice PlotPoints->100 is particularly slow.)
(I have added PlotPoints to help fill in "missing white space" in the images. Do not go overboard with PlotPoints, it can really slow down the program. You'll notice PlotPoints->100 is particularly slow.)
(*A*)RegionPlot3D[x^2+y^2≤z≤1&&-Sqrt[1-x^2]≤y≤Sqrt[1-x^2]&&-1≤x≤1,{x,-1,1},{y,-1,1},{z,0,1},PlotPoints60](*B*)RegionPlot3D[0≤z≤x^2+y^2&&-Sqrt[1-x^2]≤y≤Sqrt[1-x^2]&&-1≤x≤1,{x,-1,1},{y,-1,1},{z,0,1},PlotPoints100](*C*)RegionPlot3D[x^2+y^2≤z≤1&&0≤y≤Sqrt[1-x^2]&&0≤x≤1,{x,-1,1},{y,-1,1},{z,0,1},PlotPoints60](*D*)RegionPlot3D[0≤z≤x^2+y^2&&0≤y≤Sqrt[1-x^2]&&0≤x≤1&&-1≤x≤1,{x,-1,1},{y,-1,1},{z,0,1},PlotPoints100]
Question 12
Question 12
Can you visualize the domain from Question 8 with RegionPlot3D?