Lab 2: Limits And Derivatives: Part 1
(Click here for the Sage version)
(Click here for part 2)

By Christopher J. Tralie

Problem 1: Root Finding Using The Intermediate Value Theorem (5 pts)

Consider the equation \[ sin(x) + \sqrt{x} = x \] This equation would be difficult to solve using conventional algebraic means, so we will be instead using a numerical technique that relies on continuity. To do this, let's hone in on the interval [2, 3] for x. Since each individual component of this equation is continuous on this interval, each side of the equation is continuous, and the intermediate value theorem holds.

Step 1: Showing Existence of A Solution on [2, 3]

First, re-arrange the above equation into the form f(x) = 0. Then, define a function in Maple that represents f(x), evaluate f(x) at the endpoints of the interval, and use the intermediate value theorem to conclude that there must be a solution.

Question:Explain in your writeup how you are applying the intermediate value theorem to conclude that there is a solution in the interval [2, 3].
Hint: You may need to numerically evaluate f(2) and f(3) to help you with this. Look back at the previous lab to refresh yourself on how to do this.

Step 2: Root Finding by Logarithmic Search

You will now hone in on the root of f(x) (a solution f(x) = 0), which is also a solution of the above equation, by successively halving the interval under consideration. Start with a variable a = 2 and a variable b = 3. Then, perform the following steps several times

  1. Define a variable c that's halfway in between a and b
  2. Replace either a or b with the value of c, so that the new f(a) and f(b) continue to have opposite signs.
  3. Repeat steps 1 and 2 six more times and indicate in your writeup what your intervals are at each step.

Question: What is the seventh c you get when you do this? Plug in that c to \[ \sin(x) + \sqrt{x} = x \] How close is it to satisfying that equation compared to the x = 2 and x = 3 that you started with?

Extra Credit Question (+2) : How long would it take to get within 0.01 of a true solution of the equation? (Hint: There's a reason this is called logarithmic search). Are you within that tolerance?

Problem 2: Derivatives in Maple (5 pts)

You will now familiarize yourself with the diff command in Maple, which is used to take derivatives of functions. To take a derivative of an algebraic expression with respect to a variable in that expression, type diff(expression(variable), variable). For instance,

f(x) := x^2/3 + 3*x
diff(f(x), x)

should give you 2*x + 3.

Question: What is the derivative of \[ e^{\sqrt{4x^2 + 2}} \] with respect to x? Do this problem by hand and attach your work, then use Maple to show that you got the correct answer.

Problem 3: Gaussian Derivatives and Hermite Polynomials: An Application To Neuroscience (5 pts)

Consider the function \[ f(x) = \frac{1}{2}e^{-x^2/2} \] Compute the first two derivatives by hand and attach your work (taking a picture of writing on paper is fine). Then check your answers using the derivative function in Maple. Note that to take the nth derivative of a function f with respect to x in Maple, the command is

    fn = diff(f(x), x$n)

Question: Use Maple to compute and plot the 10th derivative, the 50th derivative, and the 100th derivative over the interval from -4 to 4. What pattern do you notice happening as you compute more and more derivatives?

For your general edification, you should know that the polynomials in front of the exponential term at each derivative are known as Hermite polynomials. Also, the derivatives are related to Morlet wavelets, which is a model for how the visual cortex in our brains picks up on edges and stripe patterns.