2015.11.6 Notes

2217 days ago by krsteph

Kylie Stephens

MATH 3600

C10726950

What is the series for $tan(x)$ for small $x$?

The MacLaurin expansion for $f(x)$ about $x = 0$ is

\[f(0) + (x-0)f'(0) + (x-0)^2\frac{f''(0)}{2!} + ...\]

\[f(0) + xf'(0) + \frac{x^2}{2!}f''(0) + ...\]

appr = taylor(tan(x),x,0,6) print appr 
       
2/15*x^5 + 1/3*x^3 + x
2/15*x^5 + 1/3*x^3 + x
A = plot(appr,x,0,2) 
       
B = plot(tan(x),x,0,1.56,color='red') 
       
show(A + B) 
       

Note $tan(x)$ is bigger than our appr.

Note that it is really small until about 0.4.

plot(tan(x)-appr,x,0,1) 
       

How about trying

\[tan(x) = \frac{p(x)}{x - \frac{\pi}{2}} ?\]

Then $p(x) = (x - \frac{\pi}{2})tan(x)$

We should acutally make this $p(x) = (x - \frac{\pi}{2})(x + \frac{\pi}{2})tan(x)$

What is the MacLaurin seires for this?

appr2 = taylor((x^2-pi^2/4)*tan(x),x,0,20)/(x^2-pi^2/4) show(appr2) 
       

$appr2 = \frac{series for tan(x)(x^2 - \frac{\pi^2}{4})}{(x^2 - \frac{\pi^2}{4})}$

plot(appr2-tan(x),x,-0,1.56) 
       

How does $\frac{tan(x)}{(x^2 - \frac{\pi^2}{4})}$ behave near $x = \pi/2$?

plot(tan(x)*(x^2-pi^2/4),x,-pi,pi) 
       

$tan(x) = \frac{sin(x)}{cos(x)}$

$cos(x) = sin(x + \frac{\pi}{2})$

How does $\frac{sin(t)}{t}$ behave as t approaches 0?

plot(sin(x)/x,x,-1,1) 
       

$\frac{sin(t)}{t} \simeq 1$ as t approaches 0.

$(x - \frac{\pi}{2})*(\frac{sin(x)}{cos(x)})*(x + \frac{\pi}{2})$ near $x = \frac{\pi}{2}$

Note: $x + \frac{\pi}{2} = 1$ at $x = \frac{\pi}{2}$

$\frac{x - \frac{\pi}{2}}{cos(x)} = \frac{x - \frac{\pi}{2}}{-sin(x - \frac{\pi}{2})} = \frac{t}{sin(t)}$     where $t = x - \frac{\pi}{2}$

- approaches -1 as $t$ approaches 0 OR $x$ approaches $\frac{\pi}{2}$

f(x) = taylor((x^2-pi^2/4)*tan(x),x,0,20) 
       
f(pi/2).n() 
       
-3.14159265449082
-3.14159265449082

Attempting a rational function with rational coefficients to approximate $tan(x)$.

Try series for $sin(x)$, $cos(x)$ to some number of terms?

$tan(x) = \frac{sin(x)}{cos(x)}$

$cos(x) = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} +$ ...

As we use better approximations to $cos(x)$, we'll get bettter approximations to the root at $\frac{\pi}{2}$.

A = plot(cos(x),0,2*pi) B = plot(1-x^2/2+x^4/factorial(4),x,0,pi,color='red') show(A + B) 
       
find_root(1-x^2/2.+x^4/24.-x^6/factorial(6)+x^8/factorial(8),1,2) 
       
1.5708210679533907
1.5708210679533907
(pi/2).n() 
       
1.57079632679490
1.57079632679490