How to estimate a definite integral using Taylor series

I have a problem that asks Evaluate to five decimal places using the taylor series for the definite integral. $$\int_{1}^{2} \frac{e^x}{x} dx$$ I don't get how to do this, given that the minute you even do the first term, you have more than 4 decimal places. How can I possible know how many terms to use to approximate 4 decimal places. For example

the taylor series representation of: $$\frac{e^x}{x}$$

is $$\frac{1}{x}+1+\frac{x^2}{2!x}+\frac{x^3}{3!x}+....$$

so I know now to integrate that statement which gives me the following series to solve for

$$\left.ln(x)+x+\frac{x^2}{4}+\frac{x^3}{3!*3}+\frac{x^4}{4!*4}+\right|_1^2$$

as you can see that is only the first 6 terms for the series being integrated and then we would solve those for 2 minus those solved at 1 to have an answer. My question is: is there an easy way to know how many terms I need to go to find this answer. I know with alternating series you go until the place value you are looking to do doesnt change its answer anymore with more terms added, but with this kind of series I do not know how far to take this.

Thank you

• Check out Taylor's Theorem (en.wikipedia.org/wiki/Taylor%27s_theorem ) – Nick Peterson Sep 11 '17 at 20:58
• You will need all of the terms for an "exact" answer. However this sequence converges quickly. So you do not need very many for a reasonably precise estimate. – Doug M Sep 11 '17 at 21:00
• my true question would be: yes, I can get to convergence but technically $$ln2-ln1$$ is an approximation of this definite integral. It has a huge error, but still is an approximation. How many terms do you have to go until you know you are truly within 5 decimal places of accuracy? @DougM – Washington state one Sep 11 '17 at 21:04
• you cant integrate termwise and ignore the denominator like that. – mathreadler Sep 11 '17 at 21:05
• @NickPeterson. I checked out that wikipedia page before. I see where they approxmiate the value $$e^x$$, but why did they only use a second order taylor expansion to do it with. Is there something special. Can I do that with mine, or do I have to go to a different degree. They used the remainder of the second order but did not specify why they did that. Why not use 1st level, or 3rd. I am confused about when to use what. – Washington state one Sep 11 '17 at 21:07

$$\int_{1}^{2}\frac{e^{x}}{x}\,dx = \frac{e^2}{2}\int_{0}^{1}\frac{e^{-x}}{1-\frac{x}{2}}\,dx=\frac{e^2}{2}\sum_{n\geq 0}\frac{1}{2^n}\int_{0}^{1}x^n e^{-x}\,dx$$ where the terms of the last series behave like $\frac{1}{n 2^n}$ for large values of $n$. It follows that the approximation $$\frac{e^2}{2}\sum_{n=0}^{15}\frac{1}{2^n}\int_{0}^{1}x^n e^{-x}\,dx = \frac{e (-2054417761371+755778071552 e)}{32768}=\color{green}{3.05911}4093$$ is correct up to the fifth place. An alternative approach is to consider the integral \begin{align*} \int_{1}^{2}\frac{e^x}{x}(x-1)^{8}(2-x)^{8}\,dx = 16e(148414279984 - 54598562389e)+256\int_{1}^{2}\frac{e^x}{x}\,dx \end{align*} where the LHS is positive but bounded by $\frac{e^2}{2^{16}}$. It follows that: $$\int_{1}^{2}\frac{e^x}{x}\,dx \approx \frac{e(54598562389e-148414279984)}{16}=\color{green}{3.059116}4861\ldots$$ is a simpler approximation, correct up to the sixth place.