Assignment 4, Computer part, due Friday, Sept. 17, 1999.

Write your name here!!!

Exercise 1.

Exercise 2.

The derivative of the natural log function ln(x)  (Mathematica notation: Log[x])  has been calculated to be (1/x).  Let's check this by comparing the graph of (1/x) to the graph of  (ln(x+h) -ln(x))/h for a small values of h.

In the following cell, I define a   Mathematica operation  PlotTogether[], which allows one to plot the graphs of two or three functions together with different colors. (You can reuse the PlotTogether[]  operation in the future; just copy the definition from here to your new notebook, evaluate it, and use it!!)

Evaluate the following cell just to make sure that Mathematica knows the definition of the PlotTogether operation.

Needs["Graphics`Colors`"]\(PlotTogether[{{f1_, \ color1_, \ opts1___}, 

          		{f2_, \ color2_, \ opts2___}}, \ {x_, \ a_, \ b_}]\  := \ 
      Module[{}, 
		
		
        plot1\  := \ 
		
          Plot[f1, \ \ {x, \ a, \ b}, \ 
					
            PlotStyle\  -> {AbsoluteThickness[2], color1}, 
				opts1, \ 
            
		DisplayFunction\  -> Identity]; 
		
			
        plot2\  := \ 
		
          Plot[f2, \ \ {x, \ a, \ b}, \ 
					
            PlotStyle\  -> {AbsoluteThickness[2], color2}, 
				opts2, \ 
            
		DisplayFunction\  -> Identity]; 
		
		
        showtogether\ \  = \ 
		
          Show[{plot1, \ plot2}, \ 
		
            DisplayFunction\  -> \ $DisplayFunction]
		]
\)\(PlotTogether[{{f1_, \ color1_, \ opts1___}, 

          		{f2_, \ color2_, \ opts2___}, 

          		{f3_, \ color3_, \ opts3___}}, \ {x_, \ a_, \ b_}]\  := \ 
      Module[{}, 
		
		
        plot1\  := \ 
		
          Plot[f1, \ \ {x, \ a, \ b}, \ 
					
            PlotStyle\  -> {AbsoluteThickness[2], color1}, 
				opts1, \ 
            
		DisplayFunction\  -> Identity]; 
		
			
        plot2\  := \ 
		
          Plot[f2, \ \ {x, \ a, \ b}, \ 
					
            PlotStyle\  -> {AbsoluteThickness[2], color2}, 
				opts2, \ 
            
		DisplayFunction\  -> Identity]; 
		
			
        plot3\  := \ 
		
          Plot[f3, \ \ {x, \ a, \ b}, \ 
					
            PlotStyle\  -> {AbsoluteThickness[2], color3}, 
				opts3, \ 
            
		DisplayFunction\  -> Identity]; 
		
		
        showtogether\ \  = \ 
		
          Show[{plot1, \ plot2, plot3}, \ 
		
            DisplayFunction\  -> \ $DisplayFunction]
		]

\)

Here is an example of the use of PlotTogether. (Evaluate the cell.)

f[x_]  :=  x^2g[x_]  :=  x^3\(PlotTogether[{{f[x], \ Green}, \ {g[x], \ Blue}}, \ {x, \ \(-2\), \ 2}]
      
\)

Now we proceed to our investigation of the Log function. Evaluate the following cells, and then explain what you have seen.

f[x_]  =  1/x\(g[x_, \ h_]\  := \ \(Log[x + h]\  - \ Log[x]\)\/h
\)

h  =  1/2PlotTogether[{{f[x],  Green},  {g[x,  h],  Blue}}, 
       {x,  1/10,  2}]

h  =  1/10PlotTogether[{{f[x],  Green},  {g[x,  h],  Blue}}, 
       {x,  1/10,  2}]

h  =  1/100PlotTogether[{{f[x],  Green},  {g[x,  h],  Blue}}, 
       {x,  1/10,  2}]