(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 4.0, MathReader 4.0, or any compatible application. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 13571, 397]*) (*NotebookOutlinePosition[ 14472, 426]*) (* CellTagsIndexPosition[ 14428, 422]*) (*WindowFrame->Normal*) Notebook[{ Cell[BoxData[{\(Double\ Integrals\), "\[IndentingNewLine]", StyleBox[\(by\ Dan\ Bach\ - \ Diablo\ Valley\ College\), FontSize->19]}], "Input", CellFrame->True, CellMargins->{{18, 57}, {Inherited, Inherited}}, TextAlignment->Center, FontFamily->"Times", FontSize->33, FontSlant->"Italic", FontColor->RGBColor[1, 0, 0], Background->GrayLevel[0.849989]], Cell[BoxData[ \(Last\ Modified\ \(3/27\)/01\ - \ See\ also\ "\"\)], "Input"], Cell[CellGroupData[{ Cell["\<\ Let's look at a double integral as a bundle of french fries. Pick your shape then go to the next blue-titled cell.\ \>", "Section"], Cell[BoxData[{ RowBox[{\(f[x_, y_]\ := \ 3 x\ + \ 2 y\ + \ 2\), StyleBox[ RowBox[{" ", StyleBox[" ", FontWeight->"Plain"]}]], StyleBox[\( (*\ flat\ plane\ *) \), FontWeight->"Plain"]}], "\[IndentingNewLine]", \(n = 6\ ; \ {xo, x1} = {0, 1}\ ; \ {yo, y1} = {0, 2}\ ;\), "\n", \(sheet\ = \ Plot3D[f[x, y], \ {x, xo, x1}, {y, yo, y1}, \n\t\tPlotPoints \[Rule] n, PlotRange \[Rule] {0, 10}, \n\tBoxRatios -> {2, 2, 3}, ViewPoint -> {3, \(-4\), 1}];\)}], "Input", CellLabel->"In[68]:="], Cell[BoxData[{ RowBox[{\(f[x_, y_]\ := \ x^2\ + \ y^2\), StyleBox[ RowBox[{" ", StyleBox[" ", FontWeight->"Plain"]}]], StyleBox[\( (*\ bowl\ shape\ *) \), FontWeight->"Plain"]}], "\[IndentingNewLine]", \(n = 10\ ; \ {xo, x1} = {0, 3}\ ; \ {yo, y1} = {0, 2}\ ;\), "\n", \(sheet\ = \ Plot3D[f[x, y], \ {x, xo, x1}, {y, yo, y1}, \n\t\tPlotPoints \[Rule] n, PlotRange \[Rule] {0, 13}, \n\tBoxRatios -> {2, 2, 3}, ViewPoint -> {3, \(-4\), 1}];\)}], "Input", CellLabel->"In[22]:="], Cell[BoxData[{ RowBox[{\(f[x_, y_]\ := \ x^2\ - \ y^2\ + 4\), StyleBox[ RowBox[{" ", StyleBox[" ", FontWeight->"Plain"]}]], StyleBox[\( (*\ saddle\ shape\ *) \), FontWeight->"Plain"]}], "\n", \(n = 20\ ; \ {xo, x1} = {\(-1\), 2}\ ; \ {yo, y1} = {\(-1\), 2}\ ;\), "\n", \(sheet\ = \ Plot3D[f[x, y], \ {x, xo, x1}, {y, yo, y1}, \n\t\tPlotPoints \[Rule] n, PlotRange \[Rule] {0, 8}, \n\tBoxRatios -> {2, 2, 3}, ViewPoint -> {3, \(-4\), 1}];\)}], "Input", CellLabel->"In[1]:="], Cell[BoxData[{ RowBox[{\(f[x_, y_] := x*y + Sin[3 x] Sin[2 y] + 3\), " ", StyleBox[\( (*\ wiggly\ shape\ *) \), FontWeight->"Plain"]}], "\n", \(n = 17\ ; \ {xo, x1} = {\(-1\), 2}\ ; \ {yo, y1} = {\(-1\), 2}\ ;\), "\n", \(sheet\ = \ Plot3D[f[x, y], \ \ {x, xo, x1}, {y, yo, y1}, \n\t\tPlotPoints \[Rule] n, PlotRange \[Rule] {0, 8}, \n\t BoxRatios -> {2, 2, 3}, ViewPoint -> {3, \(-4\), 1}];\)}], "Input", CellLabel->"In[42]:="], Cell[CellGroupData[{ Cell["Here's a convenient projection function and some other stuff", "Subsection"], Cell[BoxData[{ \(Off[General::spell1]\), "\[IndentingNewLine]", \(pr[{x_, y_, z_}]\ := \ {x, y, 0}\), "\n", \(sp[a_, c_] := {PointSize[ .015], Hue[0], Point[\((a + c)\)/2]}\), "\n", \(bp[a_, c_] := {PointSize[ .015], Hue[0], \n\t\tPoint[pr[\((a + c)\)/2]]}\), "\n", \(li[a_, c_] := {GrayLevel[ .5], Thickness[ .007], \n\t\tLine[{\((a + c)\)/2, pr[\((a + c)\)/2]}]}\), "\n", \(fr[a_, b_, c_, d_]\ := {Hue[0], \n\t\tPolygon[{a, b, pr[b], pr[a]}], Polygon[{b, c, pr[c], pr[b]}], Polygon[{c, d, pr[d], pr[c]}], Polygon[{d, a, pr[a], pr[d]}]}\)}], "Input", CellLabel->"In[30]:="] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Now we start replacing parts of the surface to include center \ points\ \>", "Subsection"], Cell[BoxData[{ \(\(Show[Graphics3D[sheet]];\)\), "\n", \(\(Show[ Graphics3D[ sheet]\ /. \ \n\t\tPolygon[{a_, b_, c_, d_}]\ :> \n\t\t\t{bp[a, c], Polygon[{a, b, c, d}]}];\)\), "\n", \(\(Show[ Graphics3D[ sheet]\ /. \ \n\t\tPolygon[{a_, b_, c_, d_}]\ :> \n\t\t\t{Polygon[{a, b, c, d}], sp[a, c], bp[a, c]}];\)\), "\n", \(\(Show[ Graphics3D[ sheet]\ /. \ \n\t\tPolygon[{a_, b_, c_, d_}]\ :> \n\t\t\t{Polygon[{a, b, c, d}], sp[a, c], li[a, c], bp[a, c]}];\)\)}], "Input", CellLabel->"In[9]:="] }, Open ]], Cell[CellGroupData[{ Cell["What about giving all the french fries flat-tops?", "Subsection"], Cell[BoxData[ \(f[X, Y]\)], "Input", CellLabel->"In[13]:="], Cell[BoxData[ \(fl[a_, b_, c_, d_]\ := {z\ = \ {0, 0, \((a/2 + c/2)\)[\([3]\)]}; Hue[0], \n\t\tPolygon[{pr[a] + z, pr[b] + z, pr[c] + z, pr[d] + z}], \n\t\tPolygon[{pr[a] + z, pr[b] + z, pr[b], pr[a]}], Polygon[{pr[b] + z, pr[c] + z, pr[c], pr[b]}], Polygon[{pr[c] + z, pr[d] + z, pr[d], pr[c]}], Polygon[{pr[d] + z, pr[a] + z, pr[a], pr[d]}]}\)], "Input", CellLabel->"In[14]:="], Cell[BoxData[ \(\(Show[ Graphics3D[ sheet]\ /. \ \n\t\tPolygon[{a_, b_, c_, d_}]\ :> \n\t\t\t{Polygon[{a, b, c, d}], sp[a, c], fr[a, b, c, d]}, \nViewPoint -> {\(-2\), 2, 2}];\)\)], "Input", CellLabel->"In[15]:="], Cell[BoxData[ \(\(Show[ Graphics3D[ sheet]\ /. \ \n\t\tPolygon[{a_, b_, c_, d_}]\ :> \n\t\t\t{sp[a, c], fl[a, b, c, d]}, \n ViewPoint -> {\(-2\), 2, 2}];\)\)], "Input", CellLabel->"In[18]:="], Cell[BoxData[ \(Do[Show[ Graphics3D[ sheet]\ /. \ \n\t\tPolygon[{a_, b_, c_, d_}]\ :> \n\t\t\t{sp[a, c], fl[a, b, c, d]}, \n\t ViewPoint -> {\(-2\) Cos[t], 2 Sin[t], 2}, SphericalRegion \[Rule] True, Axes \[Rule] None], \[IndentingNewLine]{t, 0, \[Pi]/2, \[Pi]/20}]\)], "Input", CellLabel->"In[19]:=", AnimationCycleOffset->1, AnimationCycleRepetitions->Infinity] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Let's compare the Riemann sum with the true volume.", "Section"], Cell[BoxData[{ \(dx = \((x1 - xo)\)/n\ ; \ dy = \((y1 - yo)\)/n\ ;\ \), "\[IndentingNewLine]", \(Vapprox = \[Sum]\+\(k = 1\)\%n\(\[Sum]\+\(j = 1\)\%n f[ xo + \((k - .5)\)\ dx, yo + \((j - .5)\)\ dy] dy\ dx\)\)}], "Input", CellLabel->"In[20]:="], Cell[BoxData[ \(Vtrue = \[Integral]\_xo\%x1\(\[Integral]\_yo\%y1 f[x, y] \[DifferentialD]y \[DifferentialD]x\)\)], "Input", CellLabel->"In[22]:="] }, Open ]], Cell[CellGroupData[{ Cell["I want to draw regions based on their coordinates.", "Section"], Cell[CellGroupData[{ Cell["Type I regions defined by top and bottom functions of x", "Subsection"], Cell[BoxData[{ \(vo[x_] := x^2\ ; \ v1[x_] := x + 2\ ;\), "\[IndentingNewLine]", \({xo, x1} = {\(-3\), 4}\ ; \ {yo, y1} = {\(-2\), 5}\ ;\), "\[IndentingNewLine]", \(vline[a_] := Graphics[{Hue[0], Line[{{a, vo[a]}, {a, v1[a]}}]}]\)}], "Input", CellLabel->"In[23]:="], Cell[BoxData[ \(\(Show[ Table[vline[a], {a, xo, x1, dx}], \[IndentingNewLine]AspectRatio \[Rule] 1, Frame \[Rule] True];\)\)], "Input", CellLabel->"In[41]:="] }, Open ]], Cell[CellGroupData[{ Cell["and Type II regions with left and right functions of y.", "Subsection"], Cell[BoxData[{ \(ho[y_] := 2 y\ ; \ h1[y_] := y + 2\ ;\), "\[IndentingNewLine]", \({xo, x1} = {\(-3\), 4}\ ; \ {yo, y1} = {\(-2\), 5}\ ;\), "\[IndentingNewLine]", \(hline[c_] := Graphics[{Hue[0], Line[{{ho[c], c}, {h1[c], c}}]}]\)}], "Input", CellLabel->"In[36]:="], Cell[BoxData[ \(\(Show[ Table[hline[c], {c, yo, y1, dy}], \[IndentingNewLine]AspectRatio \[Rule] 1, Frame \[Rule] True];\)\)], "Input", CellLabel->"In[40]:="] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Now for regions defined by polar coordinates. This turns any function into a parametric cylindrical plot.\ \>", "Section"], Cell[BoxData[ \(f[x_, y_]\ := 2\ x^2\ + \ y^2\)], "Input", CellLabel->"In[82]:="], Cell[BoxData[ \(\(viz\ = \ DisplayFunction -> $DisplayFunction;\)\)], "Input", CellLabel->"In[83]:="], Cell[BoxData[{ \(\(cylPlot[f_]\ := \ ParametricPlot3D[{x = r\ Cos[\[Theta]], y = r\ Sin[\[Theta]], z = f[x, y]}, {r, 0, 2}, {\[Theta], 0, 2 \[Pi]}, \n BoxRatios -> {1, 1, 1}, DisplayFunction -> Identity];\)\), "\n", \(\(cylPlot[f_, m_, n_]\ := \ ParametricPlot3D[{x = r\ Cos[\[Theta]], y = r\ Sin[\[Theta]], z = f[x, y]}, {r, 0, 2}, {\[Theta], 0, 2 \[Pi]}, \n\t PlotPoints -> {m, n}, \ BoxRatios -> {1, 1, 1}, DisplayFunction -> Identity];\)\)}], "Input", CellLabel->"In[84]:="], Cell[BoxData[ \(\(Plot3D[f[x, y], {x, \(-2\), 2}, {y, \(-2\), 2}, BoxRatios -> {1, 1, 1}];\)\)], "Input", CellLabel->"In[86]:="], Cell[BoxData[ \(\(Show[cylPlot[f], viz];\)\)], "Input", CellLabel->"In[87]:="], Cell[BoxData[ \(\(Show[cylPlot[f, 70, 40], viz];\)\)], "Input", CellLabel->"In[88]:="], Cell[BoxData[ \(Options[Graphics3D]\)], "Input", CellLabel->"In[50]:="], Cell[BoxData[{ \(\(f[x_, y_]\ := \ 2 x^2\ + \ y^2;\)\), "\n", \(\(Show[ cylPlot[f]\ /. Polygon[{a_, b_, c_, d_}]\ :> \n\t\t\t\ {Hue[ .6], Point[a], Point[c]}, \ BoxRatios -> {1, 1, 1}, viz];\)\), "\n", \(\(Show[ cylPlot[f]\ /. Polygon[{a_, b_, c_, d_}]\ :> {Hue[ .6], Point[a], Point[c], Hue[0], Point[\((a + c)\)/2]}, \ BoxRatios -> {1, 1, 1}, viz];\)\), "\n", \(\(Show[ cylPlot[f]\ /. Polygon[{a_, b_, c_, d_}]\ :> \n\t\t\t{Hue[ .6], Point[a], Point[c], Hue[0], Point[\((a + c)\)/2], \n\t\t\t\tLine[{a, c}]}, \ BoxRatios -> {1, 1, 1}, viz];\)\), "\n", \(\(Show[ cylPlot[f]\ /. Polygon[{a_, b_, c_, d_}]\ :> \n\t\t\t{Polygon[{a, b, c}], Hue[ .6], Point[a], Point[c], Hue[0], \n\t\t\t\tPoint[\((a + c)\)/2], Line[{a, c}]}, \ BoxRatios -> {1, 1, 1}, viz];\)\)}], "Input", CellLabel->"In[89]:="] }, Closed]], Cell[CellGroupData[{ Cell["Here's a big parabolic light-emitting bowl.", "Section"], Cell[BoxData[{ \(\(f[x_, y_]\ := \ x^2\ + \ y^2;\)\), "\n", \(\(Show[ cylPlot[f, 10, 20]\ /. Polygon[{a_, b_, c_, d_}]\ :> {Polygon[{a, b, c, d}], PointSize[ .015], Point[\((a + c)\)/2], Hue[0], Point[pr[\((a + c)\)/2]]}, viz];\)\)}], "Input", CellLabel->"In[94]:="], Cell[BoxData[{ \(f[x_, y_]\ := x^2\ + \ y^2\), "\n", \(\(Show[ cylPlot[f, 15, 30]\ /. Polygon[{a_, b_, c_, d_}]\ :> {Polygon[{a, b, c, d}], Line[{pr[a], pr[b], pr[c], pr[d]}], PointSize[ .015], Point[m = \((a + c)\)/2], Hue[0], PointSize[ .01], Point[pr[\((a + c)\)/2]], \n\t\t\tHue[ .2], Line[{m, pr[m]}]}, viz];\)\)}], "Input", CellLabel->"In[96]:="], Cell[CellGroupData[{ Cell["The \"leaky hat\" function", "Subsection"], Cell[BoxData[{ \(\(f[x_, y_]\ := \ 3 - Sin[ .5 x^2\ + \ .8 y^2];\)\), "\n", \(\(Show[ cylPlot[f, 15, 30]\ /. Polygon[{a_, b_, c_, d_}]\ :> {Polygon[{a, b, c, d}], Line[{pr[a], pr[b], pr[c], pr[d]}], PointSize[ .015], Point[m = \((a + c)\)/2], Hue[0], PointSize[ .018], Point[pr[\((a + c)\)/2]], \n\t\t\tHue[ .62], Line[{m, pr[m]}]}, ViewPoint -> {2, 1, 1}, viz];\)\)}], "Input", CellLabel->"In[98]:="] }, Open ]] }, Closed]] }, FrontEndVersion->"4.0 for Macintosh", ScreenRectangle->{{0, 800}, {0, 580}}, WindowToolbars->{}, WindowSize->{632, 539}, WindowMargins->{{4, Automatic}, {Automatic, 1}}, StyleDefinitions -> "TutorialBook.nb", MacintoshSystemPageSetup->"\<\ AVU/IFiQKFD000000cFGH0" ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1717, 49, 378, 10, 103, "Input"], Cell[2098, 61, 103, 2, 29, "Input"], Cell[CellGroupData[{ Cell[2226, 67, 141, 3, 115, "Section"], Cell[2370, 72, 595, 13, 109, "Input"], Cell[2968, 87, 586, 13, 109, "Input"], Cell[3557, 102, 588, 13, 109, "Input"], Cell[4148, 117, 500, 9, 129, "Input"], Cell[CellGroupData[{ Cell[4673, 130, 85, 1, 41, "Subsection"], Cell[4761, 133, 665, 13, 269, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[5463, 151, 100, 3, 41, "Subsection"], Cell[5566, 156, 657, 16, 249, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[6260, 177, 71, 0, 41, "Subsection"], Cell[6334, 179, 65, 2, 29, "Input"], Cell[6402, 183, 436, 7, 169, "Input"], Cell[6841, 192, 273, 6, 109, "Input"], Cell[7117, 200, 244, 6, 89, "Input"], Cell[7364, 208, 448, 11, 129, "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[7861, 225, 70, 0, 92, "Section"], Cell[7934, 227, 289, 6, 86, "Input"], Cell[8226, 235, 167, 3, 54, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[8430, 243, 69, 0, 92, "Section"], Cell[CellGroupData[{ Cell[8524, 247, 77, 0, 41, "Subsection"], Cell[8604, 249, 297, 6, 89, "Input"], Cell[8904, 257, 194, 5, 49, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[9135, 267, 78, 0, 41, "Subsection"], Cell[9216, 269, 298, 6, 89, "Input"], Cell[9517, 277, 194, 5, 49, "Input"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[9760, 288, 132, 3, 115, "Section"], Cell[9895, 293, 89, 2, 29, "Input"], Cell[9987, 297, 108, 2, 29, "Input"], Cell[10098, 301, 568, 10, 189, "Input"], Cell[10669, 313, 143, 3, 29, "Input"], Cell[10815, 318, 84, 2, 29, "Input"], Cell[10902, 322, 92, 2, 29, "Input"], Cell[10997, 326, 77, 2, 29, "Input"], Cell[11077, 330, 1023, 23, 329, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[12137, 358, 62, 0, 60, "Section"], Cell[12202, 360, 330, 7, 109, "Input"], Cell[12535, 369, 440, 9, 149, "Input"], Cell[CellGroupData[{ Cell[13000, 382, 48, 0, 41, "Subsection"], Cell[13051, 384, 492, 9, 169, "Input"] }, Open ]] }, Closed]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)