This notebook contains the Mathematica commands from Chapter 15 of Introduction to Scientific Programming by Joseph L. Zachary.

(15.3)  This formula gives the cross section of the corrugated steel sheet discussed in Chapter 15.

f = 10 * Sin[Pi*x/10]^2

(15.4)  This is the first derivative of the formula from (15.3).

fprime = D[f, x]

(15.11)  The "Integrate" function will evaluate indefinite integrals.

Integrate[Sin[x]+2, x]

(15.12)  It will also evaluate definite integrals, if a range is associated with the variable of integration.

Integrate[Sin[x]+2, {x, 0.0, 8.0}]

(15.13)  The "Integrate" function works symbolically, and it will sometimes fail to evaluate an integral, as in this case.

Integrate[Sqrt[1 + fprime^2], {x, 0, 10}]

(15.14)  "NIntegrate" uses a numerical technique to evaluate definite integrals.

NIntegrate[Sqrt[1 + fprime^2], {x, 0, 10}]

(15.15)  We load the "Integ" package.

Needs["ISP`Integ`"]

(15.16)  This is a simple function to integrate.

g[x_] := Sin[x] + 2

(15.17)  We animate the convergence of the rectangular method as it deals with the function sin(x)+2 between 0 and 8.  It generates 5 frames.  In the first frame 2 rectangles are used, and in each subsequent frame the number of rectrangles doubles.

AnimateRectangular[g, 0, 8, 5]

(15.23)  We animate the convergence of the trapezoidal method as it deals with the function sin(x)+2 between 0 and 8.  It generates 5 frames.  In the first frame 2 trapezoids are used, and in each subsequent frame the number of trapezoids doubles.

AnimateTrapezoidal[g, 0, 8, 5]