# Why do we need Taylor polynomials?

This question doubles as "Is my understanding of what a Taylor polynomial is for, correct?" but In order to write out a Taylor polynomial for a function, which we will use to approximate said function at a given value, we must first have the function itself. BUT, if we already have the function, why not just use it and get an exact value instead of using it's Taylor polynomial and only getting an approximation? Also, how does this benefit computer programmers?

-

## 2 Answers

Often times we know the function at very specific values and we want to approximate around that value. An easy example is to consider the exponential around zero. We know that the exponential function at zero is one. We also know that every derivative at zero is one, but it'd be much more difficult to calculate say $e^{0.1}$. However, using just an order three Taylor polynomial $$T_3(x) = 1 + x + \frac{x^2}{2} + \frac{x^3}{6}$$ I can calculate $e^{0.1}$ to be approximately $1.10517$ which is accurate to $6$ significant digits. Higher order approximations give greater accuracy.

The Taylor series gives us methods to approximate around regions of interest. And how exactly does this benefit computer science? The ability to estimate well is already essential to programming. If only a certain amount of precision is needed, it is often faster to take an approximation than to make some sort of full calculation and Taylor polynomials give a standard way of making such approximations. Taylor polynomials also give an order of magnitude estimate which is quite useful for asymptotics.

-

How do your calculator/computer calculate $\pi$, $e$ and $\sin$ and $\cos$ values? I would bet, mostly using Taylor polynomial approximation.

For example, integrating $\arctan'(x)=\displaystyle\frac1{1+x^2} = 1-x^2+x^4-x^6\pm\dots$, we get that $\arctan(x) = x-\displaystyle\frac{x^3}3+\frac{x^5}5-\frac{x^7}7\pm\dots$. One still needs to think over that it is legal, but if we put $x=1$ in it, we get $$\frac\pi4=1-\frac 13+\frac 15-\frac 17\pm\dots$$

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 11, "mathjax_display_tex": 2, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9502652287483215, "perplexity_flag": "head"}