Author: Matt Thomas
Views : 1
%typeset_mode True

# make a taylor polynomial of the function ln(1+x) with x centered at 2, degree 9
taylor(ln(1+x), x, 2, 9)

$\displaystyle \frac{1}{177147} \, {\left(x - 2\right)}^{9} - \frac{1}{52488} \, {\left(x - 2\right)}^{8} + \frac{1}{15309} \, {\left(x - 2\right)}^{7} - \frac{1}{4374} \, {\left(x - 2\right)}^{6} + \frac{1}{1215} \, {\left(x - 2\right)}^{5} - \frac{1}{324} \, {\left(x - 2\right)}^{4} + \frac{1}{81} \, {\left(x - 2\right)}^{3} - \frac{1}{18} \, {\left(x - 2\right)}^{2} + \frac{1}{3} \, x + \log\left(3\right) - \frac{2}{3}$
# taylor polynomial of e^x about 1, degree 4
taylor(e^x,x,1,4)

$\displaystyle \frac{1}{24} \, {\left(x - 1\right)}^{4} e + \frac{1}{6} \, {\left(x - 1\right)}^{3} e + \frac{1}{2} \, {\left(x - 1\right)}^{2} e + {\left(x - 1\right)} e + e$
# taylor polynomial of cos(x) centered at pi/2, degree 4 (note that it's doing a little simplifying, unfortunately)
taylor(cos(x),x,pi/2,4)

$\displaystyle \frac{1}{2} \, \pi - \frac{1}{48} \, {\left(\pi - 2 \, x\right)}^{3} - x$
# taylor polynial of ln(x^2) cntered at 1, degree 4
taylor(ln(x^2),x,1,4)

$\displaystyle -\frac{1}{2} \, {\left(x - 1\right)}^{4} + \frac{2}{3} \, {\left(x - 1\right)}^{3} - {\left(x - 1\right)}^{2} + 2 \, x - 2$
N(integral(sin(x)/x,x,0,1))

$\displaystyle 0.946083070367$