[Math] How to estimate a definite integral using Taylor series

approximationcalculusdefinite integralstaylor expansion

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

Best Answer

$$\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.

Related Question