Evaluating Double Integrals Analytically And Numerically A Comprehensive Comparison

by ADMIN 84 views

In calculus, double integrals are used to calculate the volume under a surface or the area of a region in the plane. They extend the concept of single integrals to functions of two variables. This article will delve into the evaluation of a specific double integral both analytically and numerically, comparing the results obtained through different numerical methods. The integral we will be evaluating is:

I=∫−22∫04(x2−3y2+xy3) dx dy\qquad I = \int_{-2}^{2} \int_{0}^{4} (x^2 - 3y^2 + xy^3) \, dx \, dy

We will first find the exact solution using analytical methods. Then, we will employ numerical techniques such as the multiple application trapezoidal rule and Simpson's 1/3 rule to approximate the integral's value. Finally, we will compare the results obtained from each method and discuss their accuracy and efficiency.

To analytically evaluate the double integral, we will perform the integration step by step. First, we integrate with respect to xx, treating yy as a constant, and then we integrate the result with respect to yy.

I=∫−22[∫04(x2−3y2+xy3) dx]dy\qquad I = \int_{-2}^{2} \left[ \int_{0}^{4} (x^2 - 3y^2 + xy^3) \, dx \right] dy

Let's evaluate the inner integral:

∫04(x2−3y2+xy3) dx=[x33−3y2x+x2y32]04\qquad \int_{0}^{4} (x^2 - 3y^2 + xy^3) \, dx = \left[ \frac{x^3}{3} - 3y^2x + \frac{x^2y^3}{2} \right]_{0}^{4}

Substitute the limits of integration:

=(433−3y2(4)+42y32)−(033−3y2(0)+02y32)\qquad = \left( \frac{4^3}{3} - 3y^2(4) + \frac{4^2y^3}{2} \right) - \left( \frac{0^3}{3} - 3y^2(0) + \frac{0^2y^3}{2} \right)

=643−12y2+8y3\qquad = \frac{64}{3} - 12y^2 + 8y^3

Now, we integrate this expression with respect to yy:

I=∫−22(643−12y2+8y3)dy\qquad I = \int_{-2}^{2} \left( \frac{64}{3} - 12y^2 + 8y^3 \right) dy

=[643y−4y3+2y4]−22\qquad = \left[ \frac{64}{3}y - 4y^3 + 2y^4 \right]_{-2}^{2}

Substitute the limits of integration:

=(643(2)−4(2)3+2(2)4)−(643(−2)−4(−2)3+2(−2)4)\qquad = \left( \frac{64}{3}(2) - 4(2)^3 + 2(2)^4 \right) - \left( \frac{64}{3}(-2) - 4(-2)^3 + 2(-2)^4 \right)

=(1283−32+32)−(−1283+32+32)\qquad = \left( \frac{128}{3} - 32 + 32 \right) - \left( -\frac{128}{3} + 32 + 32 \right)

=1283+1283−64\qquad = \frac{128}{3} + \frac{128}{3} - 64

=2563−64\qquad = \frac{256}{3} - 64

=256−1923\qquad = \frac{256 - 192}{3}

=643\qquad = \frac{64}{3}

Thus, the analytical solution of the double integral is 643≈21.333\frac{64}{3} \approx 21.333.

The trapezoidal rule is a numerical integration technique that approximates the definite integral by dividing the area under the curve into trapezoids. The multiple application trapezoidal rule extends this by dividing the interval into multiple subintervals and applying the trapezoidal rule to each. For a double integral, we apply the trapezoidal rule first to the inner integral and then to the outer integral.

The formula for the multiple application trapezoidal rule is:

∫abf(x) dx≈h2[f(x0)+2∑i=1n−1f(xi)+f(xn)]\qquad \int_{a}^{b} f(x) \, dx \approx \frac{h}{2} \left[ f(x_0) + 2\sum_{i=1}^{n-1} f(x_i) + f(x_n) \right]

Where:

  • h=b−anh = \frac{b - a}{n} is the width of each subinterval.
  • nn is the number of subintervals.
  • xi=a+ihx_i = a + ih are the points at which the function is evaluated.

Let's apply the trapezoidal rule to our double integral:

I=∫−22∫04(x2−3y2+xy3) dx dy\qquad I = \int_{-2}^{2} \int_{0}^{4} (x^2 - 3y^2 + xy^3) \, dx \, dy

First, we integrate with respect to xx. Let's divide the interval [0,4][0, 4] into nx=4n_x = 4 subintervals. Thus, hx=4−04=1h_x = \frac{4 - 0}{4} = 1.

The points are x0=0x_0 = 0, x1=1x_1 = 1, x2=2x_2 = 2, x3=3x_3 = 3, x4=4x_4 = 4.

Applying the trapezoidal rule for the inner integral:

∫04(x2−3y2+xy3) dx≈12[f(0,y)+2(f(1,y)+f(2,y)+f(3,y))+f(4,y)]\qquad \int_{0}^{4} (x^2 - 3y^2 + xy^3) \, dx \approx \frac{1}{2} \left[ f(0, y) + 2(f(1, y) + f(2, y) + f(3, y)) + f(4, y) \right]

Where f(x,y)=x2−3y2+xy3f(x, y) = x^2 - 3y^2 + xy^3.

Let's calculate the values:

  • f(0,y)=02−3y2+0y3=−3y2f(0, y) = 0^2 - 3y^2 + 0y^3 = -3y^2
  • f(1,y)=12−3y2+1y3=1−3y2+y3f(1, y) = 1^2 - 3y^2 + 1y^3 = 1 - 3y^2 + y^3
  • f(2,y)=22−3y2+2y3=4−3y2+2y3f(2, y) = 2^2 - 3y^2 + 2y^3 = 4 - 3y^2 + 2y^3
  • f(3,y)=32−3y2+3y3=9−3y2+3y3f(3, y) = 3^2 - 3y^2 + 3y^3 = 9 - 3y^2 + 3y^3
  • f(4,y)=42−3y2+4y3=16−3y2+4y3f(4, y) = 4^2 - 3y^2 + 4y^3 = 16 - 3y^2 + 4y^3

Substitute these values into the trapezoidal rule formula:

≈12[−3y2+2(1−3y2+y3+4−3y2+2y3+9−3y2+3y3)+16−3y2+4y3]\qquad \approx \frac{1}{2} \left[ -3y^2 + 2(1 - 3y^2 + y^3 + 4 - 3y^2 + 2y^3 + 9 - 3y^2 + 3y^3) + 16 - 3y^2 + 4y^3 \right]

=12[−3y2+2(14−9y2+6y3)+16−3y2+4y3]\qquad = \frac{1}{2} \left[ -3y^2 + 2(14 - 9y^2 + 6y^3) + 16 - 3y^2 + 4y^3 \right]

=12[−3y2+28−18y2+12y3+16−3y2+4y3]\qquad = \frac{1}{2} \left[ -3y^2 + 28 - 18y^2 + 12y^3 + 16 - 3y^2 + 4y^3 \right]

=12[44−24y2+16y3]\qquad = \frac{1}{2} \left[ 44 - 24y^2 + 16y^3 \right]

=22−12y2+8y3\qquad = 22 - 12y^2 + 8y^3

Now, we integrate this expression with respect to yy using the trapezoidal rule. Let's divide the interval [−2,2][-2, 2] into ny=4n_y = 4 subintervals. Thus, hy=2−(−2)4=1h_y = \frac{2 - (-2)}{4} = 1.

The points are y0=−2y_0 = -2, y1=−1y_1 = -1, y2=0y_2 = 0, y3=1y_3 = 1, y4=2y_4 = 2.

Let g(y)=22−12y2+8y3g(y) = 22 - 12y^2 + 8y^3.

Applying the trapezoidal rule for the outer integral:

∫−22(22−12y2+8y3) dy≈12[g(−2)+2(g(−1)+g(0)+g(1))+g(2)]\qquad \int_{-2}^{2} (22 - 12y^2 + 8y^3) \, dy \approx \frac{1}{2} \left[ g(-2) + 2(g(-1) + g(0) + g(1)) + g(2) \right]

Let's calculate the values:

  • g(−2)=22−12(−2)2+8(−2)3=22−48−64=−90g(-2) = 22 - 12(-2)^2 + 8(-2)^3 = 22 - 48 - 64 = -90
  • g(−1)=22−12(−1)2+8(−1)3=22−12−8=2g(-1) = 22 - 12(-1)^2 + 8(-1)^3 = 22 - 12 - 8 = 2
  • g(0)=22−12(0)2+8(0)3=22g(0) = 22 - 12(0)^2 + 8(0)^3 = 22
  • g(1)=22−12(1)2+8(1)3=22−12+8=18g(1) = 22 - 12(1)^2 + 8(1)^3 = 22 - 12 + 8 = 18
  • g(2)=22−12(2)2+8(2)3=22−48+64=38g(2) = 22 - 12(2)^2 + 8(2)^3 = 22 - 48 + 64 = 38

Substitute these values into the trapezoidal rule formula:

≈12[−90+2(2+22+18)+38]\qquad \approx \frac{1}{2} \left[ -90 + 2(2 + 22 + 18) + 38 \right]

=12[−90+2(42)+38]\qquad = \frac{1}{2} \left[ -90 + 2(42) + 38 \right]

=12[−90+84+38]\qquad = \frac{1}{2} \left[ -90 + 84 + 38 \right]

=12[32]\qquad = \frac{1}{2} \left[ 32 \right]

=16\qquad = 16

Thus, the numerical approximation using the multiple application trapezoidal rule is 1616.

Simpson's 1/3 rule is another numerical integration technique that provides a more accurate approximation than the trapezoidal rule by using quadratic polynomials to approximate the function. For a double integral, we apply Simpson's 1/3 rule first to the inner integral and then to the outer integral.

The formula for Simpson's 1/3 rule is:

∫abf(x) dx≈h3[f(x0)+4∑i=1,3,5,...n−1f(xi)+2∑i=2,4,6,...n−2f(xi)+f(xn)]\qquad \int_{a}^{b} f(x) \, dx \approx \frac{h}{3} \left[ f(x_0) + 4\sum_{i=1, 3, 5, ...}^{n-1} f(x_i) + 2\sum_{i=2, 4, 6, ...}^{n-2} f(x_i) + f(x_n) \right]

Where:

  • h=b−anh = \frac{b - a}{n} is the width of each subinterval.
  • nn is the number of subintervals (must be even).
  • xi=a+ihx_i = a + ih are the points at which the function is evaluated.

Let's apply Simpson's 1/3 rule to our double integral:

I=∫−22∫04(x2−3y2+xy3) dx dy\qquad I = \int_{-2}^{2} \int_{0}^{4} (x^2 - 3y^2 + xy^3) \, dx \, dy

First, we integrate with respect to xx. Let's divide the interval [0,4][0, 4] into nx=4n_x = 4 subintervals. Thus, hx=4−04=1h_x = \frac{4 - 0}{4} = 1.

The points are x0=0x_0 = 0, x1=1x_1 = 1, x2=2x_2 = 2, x3=3x_3 = 3, x4=4x_4 = 4.

Applying Simpson's 1/3 rule for the inner integral:

∫04(x2−3y2+xy3) dx≈13[f(0,y)+4(f(1,y)+f(3,y))+2f(2,y)+f(4,y)]\qquad \int_{0}^{4} (x^2 - 3y^2 + xy^3) \, dx \approx \frac{1}{3} \left[ f(0, y) + 4(f(1, y) + f(3, y)) + 2f(2, y) + f(4, y) \right]

Where f(x,y)=x2−3y2+xy3f(x, y) = x^2 - 3y^2 + xy^3.

Let's calculate the values (we already computed these in the trapezoidal rule section):

  • f(0,y)=−3y2f(0, y) = -3y^2
  • f(1,y)=1−3y2+y3f(1, y) = 1 - 3y^2 + y^3
  • f(2,y)=4−3y2+2y3f(2, y) = 4 - 3y^2 + 2y^3
  • f(3,y)=9−3y2+3y3f(3, y) = 9 - 3y^2 + 3y^3
  • f(4,y)=16−3y2+4y3f(4, y) = 16 - 3y^2 + 4y^3

Substitute these values into Simpson's 1/3 rule formula:

≈13[−3y2+4(1−3y2+y3+9−3y2+3y3)+2(4−3y2+2y3)+16−3y2+4y3]\qquad \approx \frac{1}{3} \left[ -3y^2 + 4(1 - 3y^2 + y^3 + 9 - 3y^2 + 3y^3) + 2(4 - 3y^2 + 2y^3) + 16 - 3y^2 + 4y^3 \right]

=13[−3y2+4(10−6y2+4y3)+8−6y2+4y3+16−3y2+4y3]\qquad = \frac{1}{3} \left[ -3y^2 + 4(10 - 6y^2 + 4y^3) + 8 - 6y^2 + 4y^3 + 16 - 3y^2 + 4y^3 \right]

=13[−3y2+40−24y2+16y3+8−6y2+4y3+16−3y2+4y3]\qquad = \frac{1}{3} \left[ -3y^2 + 40 - 24y^2 + 16y^3 + 8 - 6y^2 + 4y^3 + 16 - 3y^2 + 4y^3 \right]

=13[64−36y2+24y3]\qquad = \frac{1}{3} \left[ 64 - 36y^2 + 24y^3 \right]

Now, we integrate this expression with respect to yy using Simpson's 1/3 rule. Let's divide the interval [−2,2][-2, 2] into ny=4n_y = 4 subintervals. Thus, hy=2−(−2)4=1h_y = \frac{2 - (-2)}{4} = 1.

The points are y0=−2y_0 = -2, y1=−1y_1 = -1, y2=0y_2 = 0, y3=1y_3 = 1, y4=2y_4 = 2.

Let g(y)=13(64−36y2+24y3)g(y) = \frac{1}{3}(64 - 36y^2 + 24y^3).

Applying Simpson's 1/3 rule for the outer integral:

∫−2213(64−36y2+24y3) dy≈13[g(−2)+4(g(−1)+g(1))+2g(0)+g(2)]\qquad \int_{-2}^{2} \frac{1}{3}(64 - 36y^2 + 24y^3) \, dy \approx \frac{1}{3} \left[ g(-2) + 4(g(-1) + g(1)) + 2g(0) + g(2) \right]

Let's calculate the values:

  • g(−2)=13(64−36(−2)2+24(−2)3)=13(64−144−192)=13(−272)g(-2) = \frac{1}{3}(64 - 36(-2)^2 + 24(-2)^3) = \frac{1}{3}(64 - 144 - 192) = \frac{1}{3}(-272)
  • g(−1)=13(64−36(−1)2+24(−1)3)=13(64−36−24)=13(4)g(-1) = \frac{1}{3}(64 - 36(-1)^2 + 24(-1)^3) = \frac{1}{3}(64 - 36 - 24) = \frac{1}{3}(4)
  • g(0)=13(64−36(0)2+24(0)3)=13(64)g(0) = \frac{1}{3}(64 - 36(0)^2 + 24(0)^3) = \frac{1}{3}(64)
  • g(1)=13(64−36(1)2+24(1)3)=13(64−36+24)=13(52)g(1) = \frac{1}{3}(64 - 36(1)^2 + 24(1)^3) = \frac{1}{3}(64 - 36 + 24) = \frac{1}{3}(52)
  • g(2)=13(64−36(2)2+24(2)3)=13(64−144+192)=13(112)g(2) = \frac{1}{3}(64 - 36(2)^2 + 24(2)^3) = \frac{1}{3}(64 - 144 + 192) = \frac{1}{3}(112)

Substitute these values into Simpson's 1/3 rule formula:

≈13[−2723+4(43+523)+2(643)+1123]\qquad \approx \frac{1}{3} \left[ \frac{-272}{3} + 4(\frac{4}{3} + \frac{52}{3}) + 2(\frac{64}{3}) + \frac{112}{3} \right]

=19[−272+4(56)+128+112]\qquad = \frac{1}{9} \left[ -272 + 4(56) + 128 + 112 \right]

=19[−272+224+128+112]\qquad = \frac{1}{9} \left[ -272 + 224 + 128 + 112 \right]

=19[192]\qquad = \frac{1}{9} \left[ 192 \right]

=643\qquad = \frac{64}{3}

Thus, the numerical approximation using Simpson's 1/3 rule is 643≈21.333\frac{64}{3} \approx 21.333.

Let's compare the results we obtained from each method:

  • Analytical Solution: 643≈21.333\frac{64}{3} \approx 21.333
  • Multiple Application Trapezoidal Rule: 1616
  • Simpson's 1/3 Rule: 643≈21.333\frac{64}{3} \approx 21.333

Discussion

  • Analytical Solution: The analytical method provides the exact value of the double integral. It involves symbolic integration, which can be complex and time-consuming for more complicated functions. However, it gives a precise result, serving as a benchmark for numerical methods.

  • Multiple Application Trapezoidal Rule: The trapezoidal rule provides an approximation of the integral. In our case, it gave a result of 1616, which is significantly different from the exact solution. The trapezoidal rule is a first-order numerical integration technique, and its accuracy improves with an increasing number of subintervals (nn). However, it is generally less accurate than higher-order methods like Simpson's rule.

  • Simpson's 1/3 Rule: Simpson's 1/3 rule, a second-order method, provided a result of 643≈21.333\frac{64}{3} \approx 21.333, which is exactly the same as the analytical solution. This demonstrates the higher accuracy of Simpson's rule compared to the trapezoidal rule. Simpson's rule uses quadratic polynomials to approximate the function, capturing the curvature more effectively.

Comparison of Accuracy and Efficiency

  • Accuracy: Simpson's 1/3 rule is more accurate than the trapezoidal rule for the same number of subintervals. This is because Simpson's rule uses a higher-order polynomial approximation.
  • Efficiency: The trapezoidal rule is computationally simpler than Simpson's rule, but to achieve the same level of accuracy, the trapezoidal rule requires a much larger number of subintervals, making it less efficient in many cases.

Conclusion

In this article, we evaluated a double integral both analytically and numerically using the multiple application trapezoidal rule and Simpson's 1/3 rule. The analytical solution provided the exact value, while the numerical methods gave approximations. Simpson's 1/3 rule demonstrated its superior accuracy by matching the analytical result, whereas the trapezoidal rule had a significant error. This comparison highlights the importance of choosing an appropriate numerical method based on the desired accuracy and computational efficiency. For higher accuracy, methods like Simpson's rule are preferred, while for simpler calculations with lower accuracy requirements, the trapezoidal rule can be used. The choice depends on the specific problem and the trade-off between accuracy and computational cost. Ultimately, understanding the strengths and limitations of each method allows for more effective problem-solving in numerical integration.