Mathematica exercise on linearization:					K.M.Shannon  11/1/2015
Open a new notebook and complete the following:
A.  Find linearizations for the following functions at the indicated points.  Then determine the interval for which the linear approximation will be within .1 of the function.
1.  (x^(1/3))at x = 1
2.  (e^x) at x = 0
3.  ln(x) at x = 1
B.  Use the linearizations you found above to approximate the following.  Then have Mathemaitca compute them and calculate the “error”.
1.  (0.9^(1/3))
2.   (e^(1/5))  (that is, (e^0.2))
3.  ln(1.1)

A 1.  (note:  I do not need to use SURD beacause x is positive.)

f[x_]:=(x^(1/3))

L[x_]:=f[x]+f'[x] (x-1)
Plot[{f[x],L[x],f[x]+.1,f[x]-.1},{x,0,2}]

It looks like the approximation should be good approximately .75 to 1.35.  Let’s take another look:

Plot[{f[x],L[x],f[x]+.1,f[x]-.1},{x,0.75,1.37}]

Playing with the graph, it looks more like [.75, 1.37] Let’s see if we can find it:

NSolve[L[x]==f[x]+.1,x]

NSolve[L[x]==f[x]-.1,x]

Make that [.751931,1.37007] but the eyeball estimate was pretty good!  Now let’s try B1:

L[.9]

f[.9]

f[.9]-L[.9]

(0.9^(1/3))=.965489 to six places.  L[.9] is .929731 and the error in the approximation is .0357589.  Now for A2:

f2[x_]:=(E^x)

L2[x_]:=f2[0]+f2'[0] x

Plot[{f2[x],L2[x],f2[x]+.1,f2[x]-.1},{x,-1,1}]

Looks like maybe -.47 to.47

Plot[{f2[x],L2[x],f2[x]+.1,f2[x]-.1},{x,-.475,.41}]

or looking closer, maybe -.475 to .41.  Lets try to find the solution:

NSolve[L2[x]==f2[x]-.1,x]

Well, I didn’t think that was going to work.  Let’s try FindRoot....

FindRoot[L2[x]==f2[x]-.1,{x,.4}]

FindRoot[L2[x]==f2[x]-.1,{x,-.4}]

So the correct interval is [-.483183, .416221] to 6 places.  Now lets do B2:

f2[.2]

L2[.2]

f2[.2]-L2[.2]

(e^(1/5)) is1.2214 to 6 places, the linearization approximation is 1.2 and the error is .0214028.  On to A3:

f3[x_]:=Log[x]

L3[x_]:=f3[1]+f3'[1] (x-1)

Plot[{f3[x],L3[x],f3[x]+.1,f3[x]-.1},{x,.5,2}]

Plot[{f3[x],L3[x],f3[x]+.1,f3[x]-.1},{x,.53,1.53}]

FindRoot[L3[x]==f3[x]+.1,{x,1.5}]

FindRoot[L3[x]==f3[x]+.1,{x,.5}]

Well the eyeball estimate wasn’t as good this time.  The interval we want is [.616817,1.51622].  Now for part B:

f3[1.1]

L3[1.1]

L3[1.1]-f3[1.1]

ln(1.1) = .0953102; the linear approximation is .1and the error is .00468982.
In all three examples, the linear approximation was pretty good, although the best in the natural log example.