# Project 6: Techniques of Integration

## Instructions

Use Maxima to work this project. Each group should email an annotated Maxima file to the instructor.

## Numeric Methods

### 1. Approximate Integration

This problem is about finding the number of intervals needed to get the desired accuracy in an estimation. See section 6.5 for more information. There are some helper functions for the numeric approximations that you can use after you have determined the appropriate number of intervals.

Consider the integral $$F= \displaystyle \int_0^3 f(x)\, dx$$, where $$f(x) = \exp\left(\dfrac 1 3 x - \dfrac 1 7 x^3\right)$$.

1. Graph $$f$$, $$| f''(x) |$$, and $$| f^{(4)}(x) |$$ on the same graph.
2. Obtain estimates for $$K_2 = \max (| f''(x) |)$$ and $$K_4\ = \max(|f^{(4)}(x)|)$$ on the interval $$[0,3]$$. Hint: how do you use calculus to find a maximum? Use the graph from part 1 to come up with an estimate, and then use the find_root() command to find the actual value.
3. Determine the number of subintervals needed to approximate F to 4 decimal place accuracy using the trapezoid method and then obtain the approximation.
4. Determine the number of subintervals needed to approximate F to 4 decimal place accuracy using the midpoint method and then obtain the approximation.
5. Determine the number of subintervals needed to approximate F to 4 decimal place accuracy using Simpson's method and then obtain the approximation.
6. Use the built-in numeric integration routines of Maxima to obtain an approximation to F and then determine the absolute error in each approximation using the trapezoid, midpoint, and Simpson's methods.
7. Verify that your approximation is accurate to 4 decimal places.

## Computer Algebra Systems

A Computer Algebra System (CAS) is extremely beneficial for computing integrals. Maxima is the free CAS we use in class, but there are other commercial products available. There are even online interfaces to some computer algebra systems; WolframAlpha is one of the most popular of these, providing an interface to the Mathematica CAS.

Sometimes, computer algebra systems will return the same answer and other times they will return different answers. In this portion, we'll look at a couple of problems and show that, although the results appear different, they are either the same or differ only by a constant.

### 2. Checking with Random Points

One reasonable way of showing answers are the same is to pick 5 random values and show that both expressions give the same value. Pick 5 different values for $$x$$ that are in the domain of expression and substitute them into both expressions. Show that you get the same value (or that the difference between them is the same). Be sure to mix up the values for $$x$$ since it is possible that certain conditions may hold if you only pick integers or only pick positives.

Consider the integral $$\displaystyle \int \frac{\sqrt{4x^2+9}}{x}\, dx$$.

1. Use Maxima to find this integral.
2. Use WolframAlpha to find this integral. You will need to either manually type the answer into the Maxima document or copy/paste and then insert * signs since Maxima does not understand implicit multiplication
3. Pick 5 random points as described above and verify the difference is constant.

Here's one way you can accomplish this with Maxima.

P:[comma separated list of x values goes here];
makelist(M-W,x,P);

The makelist() function will find the difference between M and W for every x value in the list P.

### 3. Checking with Taylor Series

Another way to check for equality is to convert each expression into a series. We'll talk about this in chapter 8, but for now, we'll just let the computer do it for us. A convenient way to do this is to find a Taylor series and then compare terms. They should be identical except for possibly the constant term.

A commonly used series is the Maclaurin series, which is just a Taylor series centered at $$x = 0$$. Unfortunately, if $$x = 0$$ is not in the domain of the problem, you'll need to pick another value that is. It doesn't really matter what the value is, as long as it is in the open interval (not an endpoint) of the domain.

Consider the integral $$\displaystyle \int (x+3) \sqrt{x^2-9}\, dx$$.

1. Use Maxima to find this integral.
2. Use WolframAlpha to find this integral. You will need to either manually type the answer into the Maxima document or copy/paste and then insert * signs since Maxima does not understand implicit multiplication
3. Pick a value in the domain and find a 6th degree Taylor series for both the Maxima and WolframAlpha results. Show that two series are equal except for possibly the constant.

Here's what the Maxima pseudo-code would look like:

p:point in domain;
taylor(W,x,p,6);