<< Graphics`; << Miscellaneous`RealOnly`

The Rule of Three and other oddities

WARNING:  THIS LAB IS SERIOUSLY INCOMPLETE AT THE MOMENT.  I GOT SIDETRACKED INTO WORKING ON SOME OTHER COOL LABS WHEN I REALLY SHOULD HAVE BEEN WORKING ON THIS.  I WILL, HOWEVER, ADD TO THIS OVER TIME...

Finding where two functions intersect

We want to find out where two functions intersect:

f[x_] := (x^3) + 3  (x^2) - 2  x + 1

g[x_] := (10/((x^2) + 1))

Let's start with the graph this time:

Graphically

Plot[{f[x], g[x]}, {x, -5, 5}, PlotPoints -> 100]

Use the built-in trace function in Mathematica (select the graph, then hold down the Control key and click on the graph; the coordinates are displayed in the lower left border of this window) to estimate the intersection points.

Numerically

Table[{x, f[x], g[x]}, {x, -4, 1, 0.1}] // TableForm

Use this data to approximate the intersections.  How could you get better approximations without having to list thousands of points?

Symbolically

To find where two functions intersect, you can set them equal to each other and solve the resulting equation:

Solve[(x^3) + 3  (x^2) - 2  x + 1 == (10/((x^2) + 1))]

Or, if you prefer to see decimal approximations:

Solve[(x^3) + 3  (x^2) - 2  x + 1 == (10/((x^2) + 1))] // N

Actually, a much cooler way to solve this problem in Mathematica would be to simply call the functions by name:

Solve[f[x] == g[x]] // N

Taking a limit

We want to take the following limit:  (lim_(x -> 1))((1 -  x)/(1 - (x^(1/3))))

Using the "Rule of three", we want to investigate this numerically, graphically, and symbolically.  Let's start with the numbers:

Numerically

Here is a table of (x, f(x)) values near x = 0:

Table[{x, ((1 -  x)/(1 - (x^(1/3))))}, {x, 0.9, 1.1, 0.01}] // N // 
      TableForm

This one might be more useful.  We use the /.x -> 1 + (1/(10^k))to plug in decimals closer and closer to 1:

Table[{x, ((1 -  x)/(1 - (x^(1/3))))} /. x -> 1 + (1/(10^k)), {k, 
            1, 10, 1}] // N // TableForm

Of course, we have to approach from the negative side as well:

Table[{x, ((1 -  x)/(1 - (x^(1/3))))} /. x -> 1 - (1/(10^k)), {k, 
            1, 10, 1}] // N // TableForm

What does it look like the limit is here?

Graphically

If we graph the function near the point, we get:

Plot[((1 -  x)/(1 - (x^(1/3)))), {x, 0, 2}, 
      PlotRange -> {0, 5}]

Does this graph cause you to change your mind?  Does it give you a better idea of what is going on?

Symbolically

It may not be immediately obvious, but this fraction can be reduced:

Simplify[((1 -  x)/(1 - (x^(1/3))))]

This is because 1 - 
          x = (1^3) - ((((x^(1/3))))^3) = (1 - (x^(1/3))) ((x^(2/3)) + 
                (x^(1/3)) + 1).

Why?

This means we can find the limit by just "plugging in" the x = 1:

Simplify[((1 -  x)/(1 - (x^(1/3))))] /. x -> 1

Also, notice that Mathematica has a built in Limit function:

Limit[((1 -  x)/(1 - (x^(1/3)))), x -> 1]