# Taylor Series Error Estimation

• Nov 12th 2011, 04:46 PM
joatmon
Taylor Series Error Estimation
If I approximate $\displaystyle e^{-x^2}$ with the first three terms of its Maclaurin series, how do I find the range of x for which the approximation is accurate to within .005?

First, I found the Maclaurin series that represents this function:

$\displaystyle e^{-x^2} = \sum_{n=0}^\infty\frac{(-x^2)^n}{n!} = \sum_{n=0}^\infty\frac{x^{2n}}{n!} = 1 + x^2 + \frac{x^4}{2!} + \frac{x^6}{3!} + ...$

Since we are approximating using three terms, I have to find the 4th derivative of the function, which is $\displaystyle e^{-x^2}(16x^4-48x^2+12)$.

Up to this point, I think that I am in good shape. Even this next step seems fairly straightforward:

$\displaystyle |error| = |R_3(x,z)| = |\frac{f^{(4)}(z)}{4!}x^4| \leq 0.005$

It's in executing this that get confused. I think that the next step is this:

$\displaystyle |\frac{e^{-x^2}(16x^4-48x^2+12)}{24}x^4| \leq 0.005$

$\displaystyle |4x^4e^{-x^2}(4x^4-12x^2+3)| \leq 0.12$

It's at this point where I get stuck. Assuming that I have gotten this far without error (big assumption), the idea would be to solve the inequality for x, which would tell me the range to fall within this error threshold. But the algebra here seems pretty involved, which makes me think that I have made a mistake.

Anybody see anything or have any advice? Thanks.
• Nov 12th 2011, 07:23 PM
Deveno
Re: Taylor Series Error Estimation
you have your original series incorrect, btw, it should be alternating signs.

your 4th derivative is correct, however.

so you should wind up with:

$\displaystyle |\frac{e^{-z^2}(16z^4 - 48z^2+12)}{24}|x^4 \leq 0.005$

there is a reason i brought |x^4| = x^4 out of the remainder term. if we can find some global maximum for the rest, then the remainder will only depend on the value of |x|.

we can simplify a bit:

$\displaystyle |e^{-z^2}(4z^4 - 12x^2+3)|x^4 \leq 0.03$

now, let's look at the expression inside the absolute value sign, we would like to find an upper bound for it. if

$\displaystyle g(z) = e^{-z^2}(4z^4 - 12z^2 + 3)$ then

$\displaystyle g'(z) = -e^{-z^2}(-2z)(4z^4 - 20z^2 + 15)$

note that for g'(z) = 0, either z = 0, or z is a solution to $\displaystyle 4z^4 - 20z^2 + 15$, which is a quadratic in $\displaystyle z^2$.

the solutions to this quadratic are:

$\displaystyle z^2 = \frac{5 \pm \sqrt{10}}{2}$

as z goes to plus or minus infinity, eventually the exponential term dominates, so:

$\displaystyle \lim_{z \to \pm \infty} g(z) = 0$

so the global maximum for |g(z)| is one of the roots of g'(z). g(z) is an even function, so it suffices to check the 3 non-negative roots of g'(z).

g(0) = 3 (well, that was easy).

at $\displaystyle z = \sqrt{\frac{5-\sqrt{10}}{2}}$, we get:

$\displaystyle g(z) \approx (0.39898)(-4.64911) = -1.8549019078$

at $\displaystyle z = \sqrt{\frac{5+\sqrt{10}}{2}}$,

$\displaystyle g(z) \approx (0.01689)(118.596) = 2.00308644$

so |g(z)| has a global maximum of 3 at 0.

so: $\displaystyle |e^{-z^2}(4z^4 - 12x^2+3)|x^4 \leq 3x^4$

so in order to ensure $\displaystyle 3x^4 \leq 0.03$ choose

$\displaystyle x^4 \leq 0.1 \implies |x| \leq \sqrt[4]{0.1} \approx 0.316228$

(there might be an easier way....feel free, people).
• Nov 13th 2011, 04:44 PM
joatmon
Re: Taylor Series Error Estimation
Thanks very much for the thoughtful response. I wouldn't have figured that out on my own. I have two questions for you.

First, on my work, you said that the series alternates. Since x is raised to an even power, doesn't that make the series always positive? Am I missing how to apply that minus sign? Does it stay outside of the exponential?

Second, at the very end of your reply, did you drop a decimal place? You went from $\displaystyle 3x^4 \leq 0.03$ to $\displaystyle x^4 \leq 0.1$. Did you mean $\displaystyle x^4 \leq 0.01$ or am I overlooking something?

Thanks again!