DoubleIntegrals.mw

restart; 1 

 

Setting up Double Integrals 

Let's look at how to compute the volume of a function in 3-space bounded by a region R in the plane. 

 

with(plots); 1 

[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
 

Look at the region R bounded by the line y = x, y = 2 - x, and x = 0. 

 

plot([x, 2-x], x = 0 .. 1); 1 

 

Plot 

 

The red and green lines will be the edges of the vertical surfaces. 

The top of the solid will be the paraboloid z = 4 - x^2 - y^2. 

 

 

Let's begin to create the object by generating the vertical portions of the figure. Here we do the vertical edge for the line y=x 

 

 

plot3d([x, x, z], x = 0 .. 1, z = 0 .. `+`(4, -x^2, -x^2), color = red, axes = normal); 1 

 

Plot 

 

 

And this is the vertical edge for the line y= 2-x 

plot3d([x, 2-x, z], x = 0 .. 1, z = 0 .. 4-x^2-(2-x)^2, color = green, axes = normal); 1
plot3d([x, 2-x, z], x = 0 .. 1, z = 0 .. 4-x^2-(2-x)^2, color = green, axes = normal); 1
 

 

Plot 

 

Now we put the two together... 

A1 := plot3d([x, x, z], x = 0 .. 1, z = 0 .. 4-2*x^2, color = red, axes = normal); -1 

A2 := plot3d([x, 2-x, z], x = 0 .. 1, z = 0 .. 4-x^2-(2-x)^2, color = green); -1
A2 := plot3d([x, 2-x, z], x = 0 .. 1, z = 0 .. 4-x^2-(2-x)^2, color = green); -1
 

display(A1, A2); 1 

 

Plot 

 

 

Here we add the surface z = 4-x^2 - y^2 

A3 := plot3d([x, y, 4-x^2-y^2], x = 0 .. 1, y = x .. 2-x, color = blue); -1 

display(A1, A2, A3); 1 

 

Plot 

 

Lastly we add the final edge, x = 0 

 

A4 := plot3d([0, y, z], y = 0 .. 2, z = 0 .. 4-y^2, color = magenta); -1 

display(A1, A2, A3, A4); 1 

 

Plot 

 

Now that we know what our solid looks like we can perform the double integration. Here we use the int(...) function to perform the integration. 

 

 

 

Start by doing the integration piecemeal, first integrating with respect to y and following that by x  

 

IntegralY := int(4-x^2-y^2, y = x .. 2-x); 1 

8-8*x-x^2*(2-2*x)-1/3*(2-x)^3+1/3*x^3 

IntegralYX := int(IntegralY, x = 0 .. 1); 1 

8/3 

Or we can perform the double integration and use evalf(...) to get a number result 

 

evalf(int(int(4-x^2-y^2, y = x .. 2-x), x = 0 .. 1)); 1 

2.666666667