# This worksheet contains the Maple commands from Chapter 15 of # Introduction to Scientific Programming by Joseph L. Zachary. # # (15.2) This formula gives the cross section of the corrugated steel # sheet discussed in Chapter 15. # > f := 10 * sin(Pi*x/10)^2; # # (15.3) This is the first derivative of the formula from (15.2). # > fprime := diff(f, x); # # (15.10) The int function will evaluate indefinite integrals. # > int(sin(x)+2, x); # # (15.11) It will also evaluate definite integrals, if a range is # associated with the variable of integration. # > int(sin(x)+2, x=0.0..8.0); # # (15.12) The int function works symbolically, and it will sometimes # fail to evaluate an integral, as in this case. # > int(sqrt(1 + fprime^2), x=0..10); # # (15.13) This combination of evalf and Int causes Maple to evaluate # definite integrals using a numerical technique. # > evalf(Int(sqrt(1 + fprime^2), x=0..10)); # # (15.14) We use the integration package to animate the convergence of # the rectangular method as it deals with the function sin(x) between 0 # and 8. It generates 5 frames. In the first frame 2 rectangles are # used, and in each subsequent frame the number of rectangles doubles. # > with(integration): > animateRectangular((x) -> sin(x)+2, 0, 8, 5); # # (15.20) We use the integration package to animate the convergence of # the trapezoidal method as it deals with the function sin(x) 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. # > with(integration): > animateTrapezoidal((x) -> sin(x)+2, 0, 8, 5); >