Contact Us!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

| Download
Views: 55
Image: ubuntu2204
Kernel: SageMath 10.0

Linear and Quadratic Approximation Assignment

Question 1

[2 points] We are going to use linear approximation to estimate values of the 4/3 power function.

[Hint: Don't forget parentheses in x^(4/3)]

Part a

Use linear approximation to estimate 674/367^{4/3} and give the percent error (Hint: follow Example 2).

[Note: 644/3=(643)4=44=25664^{4/3}=\left(\sqrt[3]{64}\right)^4=4^4=256, so use x=64x=64 for your point of tangency.]

f(x)=x^(4/3) x_tangent=64 x_approx=67 df(x)=derivative(f,x) TL(x)=f(x_tangent)+df(x_tangent)*(x-x_tangent) print('Our approximation is:',N(TL(x_approx))) print() print('sage gives:',N(f(x_approx))) print() print('The percent error is:', N(abs((TL(x_approx)-f(x_approx))/f(x_approx))))
Our approximation is: 272.000000000000 sage gives: 272.123722729861 The percent error is: 0.000454656171168598

Part b

Use linear approximation to estimate 664/366^{4/3} and give the percent error.

[Use the same tangent line as part a.]

f(x)=x^(4/3) x_tangent=64 x_approx=66 df(x)=derivative(f,x) TL(x)=f(x_tangent)+df(x_tangent)*(x-x_tangent) print( 'our approximation is:', N(TL(x_approx))) print() print('Sage gives:', N(f(x_approx))) print () print ('The percent error is:', N(abs((TL(x_approx)-f(x_approx))/f(x_approx))*100), '%')
our approximation is: 266.666666666667 Sage gives: 266.721841361065 The percent error is: 0.0206862303125716 %

Part c

Since our approximation is based on x=64x=64, we expect the error to be larger at x=67x=67 than it is at x=66x=66. Check that your error is larger for part a (Type Yes or No).

Yes

Question 2

[2 points] Use linear approximation to estimate cos(π7)\displaystyle\cos\left(\frac{\pi}{7}\right) and give the percent error.

[Note: π6\frac{\pi}{6} is close to π7\frac{\pi}{7}, and cos(π6)=32\cos\left(\frac{\pi}{6}\right)=\frac{\sqrt{3}}{2}, so use x=π6x=\frac{\pi}{6} for your point of tangency.]

f(x)=cos(x) x_tangent=(pi/6) x_approx=(pi/7) df(x)=derivative(f,x) TL(x)=f(x_tangent)+df(x_tangent)*(x-x_tangent) print('our approximation is:', N(TL(x_approx))) print() print('sage gives:', N(f(x_approx))) print() print ('The percent error is:', N(abs((TL(x_approx)-f(x_approx))/f(x_approx))*100), '%')
our approximation is: 0.903425316327174 sage gives: 0.900968867902419 The percent error is: 0.272645205874225 %

Question 3

[2 points] Consider a function ff such that f(5)=10f(5)=10 and f(5)=3f'(5)=-3. Estimate f(6)f(6) using a tangent line.

Hint: Since you do not know f(x)f(x), you can't copy and paste from Example 2. However, you have enough numbers to define one tangent line.

In general, a tangent line looks like TL(x)=f(x0)+f(x0)(xx0)TL(x)=f(x_0)+f'(x_0)\cdot(x-x_0). Put the given numbers in the appropriate spots to define a line at x0=5x_0=5.

Then see what happens at x=6x=6 by computing TL(6)TL(6).

TL(x)=10+-3*(x-5) show(TL(x)) TL(6)

3x+25\displaystyle -3 \, x + 25

7

Question 4

[2 points] Use quadratic approximation to estimate 674/367^{4/3} and find the percent error (Hint: follow Example 4).

[Use the same point of tangency as Question 1.]

The percent error should be much smaller than the percent error from Question 1, Part a.

f(x)=x^(4/3) x_tangent=64 x_approx=67 df(x)=derivative(f,x) d2f(x)=derivative(f,x,2) P(x)=d2f(x_tangent)/2*(x-x_tangent)^2+df(x_tangent)*(x-x_tangent)+f(x_tangent) print('our approximation is:', N(P(x_approx))) print('sage gives:', N(f(x_approx))) print() print ('The percent error is:', N(abs((TL(x_approx)-f(x_approx))/f(x_approx))*100), '%')
our approximation is: 272.125000000000 sage gives: 272.123722729861 The percent error is: 164.676463424218 %

Question 5

[2 points] Use quadratic approximation to estimate cos(π7)\displaystyle\cos\left(\frac{\pi}{7}\right) and find the percent error.

[Use the same point of tangency as Question 2.]

The percent error should be much smaller than the percent error from Question 2.

f(x)=cos(x) x_tangent=pi/6 x_approx=pi/7 df(x)=derivative(f,x) d2f(x)=derivative(f,x,2) P(x)=d2f(x_tangent)/2*(x-x_tangent)^2+df(x_tangent)*(x-x_tangent)+f(x_tangent) print('our approximation is:', N(P(x_approx))) print('sage gives:', N(f(x_approx))) print() print ('The percent error is:', N(abs((TL(x_approx)-f(x_approx))/f(x_approx))*100), '%')
our approximation is: 0.901002604270302 sage gives: 0.900968867902419 The percent error is: 2525.35188408123 %