Taylor Polynomial Lab Project

Andy Long
Spring, 2018

#1

Clear["Global`*"] 
p[x_]:=a+b x+c x^2
f[x_]:=Cos[x]
l[x_]:=1
soln=Solve[p[0]==f[0] && p'[0]==f'[0] && p''[0]==f''[0],{a,b,c}] 
a=First[a/.soln]
b=First[b/.soln]
c=First[c/.soln]
Plot[{l[x],f[x],p[x]},{x,-1,1}]

#2

soln=NSolve[Abs[p[x]-f[x]]==.1,x] 
Plot[{f[x]-.1,f[x]+.1,p[x]},{x,-1.5,1.5}]
Plot[{f[x]-.1,f[x]+.1,p[x]},{x,1.2,1.3}]

#3

Clear["Global`*"] 
x0
p[x_]:=a+b( x-x0)+c( x-x0)^2
soln=Solve[p[x0]==f[x0] && p'[x0]==f'[x0] && p''[x0]==f''[x0],{a,b,c}] 
a=First[a/.soln]
b=First[b/.soln]
c=First[c/.soln]

#4

f[x_]:=Sqrt[x+3]
x0=1
p[x]
l[x_]:=7/4+x/4
Plot[{l[x],f[x],p[x]},{x,-4,10}]