next up previous
Next: About this document ... Up: lab_template Previous: lab_template

Subsections


Linear Approximation

Tangent Lines

Often times it is easier to work with an approximating function rather than one that is too complicated to solve analytically or where it is too cumbersome to calculate efficiently thus increasing time in extensive computer loops. One method of approximation is to use a tangent line. The line equation is $\displaystyle y-y_{1}=m(x-x_{1})$. $\displaystyle (x_{1},y_{1})$ is a point on the function with $\displaystyle m $ the slope or derivative at that point. Working with commands from the first three labs the linear approximation can be calculated and plotted for the function $\displaystyle f(x)=\sqrt{1+x} $ at the point $\displaystyle x = 0 $.

>f:=x-sqrt(1+x);
>LA0:=D(f)(0)*(x-0)+f(0);
>plot([f(x),LA0],x=-1..5);
Note: you may also use the subs and diff command to calculate the slope.

Accuracy

At the point chosen for the tangent line there is obviously no error between the original function and the approximation. The further from that point increases the error. To calculate the error you simply subtract. To find how far off the linear approximation is at $ x = 0.5 $ calculate the y-value of each and subtract.
>subs(x=0.5,LA0)-f(0.5);

Exercises

  1. Graph the function \( f(x) = \frac{7x}{(1+x^2)^\frac{1}{3}} \) on the domain and range $-15 \leq x \leq 15 $ and $-18 \leq y \leq 18 $. Then calculate the two linear approximations at $x = 4$ and $x=1$. Graph both of these and the function all on one graph. Finally calculate the error of each linear approximation at the point $ x = 2 $. Which gives the better approximation and what is the error.
  2. Graph the function $h(x)=x^5-7x^4+x^3-17$ on the domain and range $-2 \leq x \leq 7 $ and $-1300 \leq y \leq 300 $. Then calculate the two linear approximations at $x = 5$ and $x = 6$. Graph both of these and the function all on one graph. Finally calculate the error of each linear approximation at the point $x = 5.5$. Which gives the better approximation and what is the error.
  3. Graph the function $\displaystyle g(x)=\frac{\sin(x)}{2+3 \cos(x)^2}$ on the domain and range $-14 \leq x \leq -8 $ and $-0.5 \leq y \leq 0.6 $. Then calculate the two linear approximations at $x = -13.25$ and $x = -11.9$. Graph both of these and the function all on one graph. Finally calculate the error of each linear approximation at the point $x = -12.757$. Which gives the better approximation and what is the error.
  4. Looking at the three answers, is there any that you would not recommend using as an approximation to the function and why?

next up previous
Next: About this document ... Up: lab_template Previous: lab_template
Dina J. Solitro-Rassias
2019-12-03