There is a MUCH easier way to do this than differentiating so many times - unless that's what your teacher requires of you.
e^x = 1 + x + x^2/2 + x^3 / 6
This is a standard maclaurin series, and it's much easier to differentiate and derive that your full function.
So e^-x = 1 - x + x^2/2 - x^3 / 6
x^2*e^-x = x^2 - x^3 + x^4 / 2 - x^5 / 6
Testing with x = 1/10
LHS = 9.04837 * 10^-3
RHS = 9.04833 * 10^-3
error = 4.5 * 10^-4 %
2007-06-16 17:01:47
·
answer #1
·
answered by Dr D 7
·
1⤊
0⤋
********************************
EDIT - I see you have now supplied the function details! You can skip this section if you like and look for the bit at the bottom where I work through the actual problem.
********************************
If the 5th derivative is -(1/6)x^5, then the function must be
f(x) = -x^10 / 181440 + rx^4 + sx^3 + tx^2 + ux + v
where r, s, t, u, v are arbitrary constants. In this case the Maclaurin series of degree 4 would be rx^4 + sx^3 + tx^2 + ux + v so the function would have to be -x^10 / 181440 + x^4 / 2 - x^3 + x^2. I doubt this is the actual function you're supposed to be using; since you haven't specified f(x), I can't give you a detailed working of the problem. I'll address specific issues that I can see, but you'll have to correct them yourself.
If f(1/10) = 0.0091, your approximation to it is T(1/10) = (1/10^)^2 - (1/10)^3 + (1/2)(1/10)^4 = 0.00905, so the actual error is 0.00005 = 5×10^-5.
To calculate the upper bound for the error, you do need to compute the fifth derivative. But what do you think you;'re doing evaluating that at 0.0091? This is a value of the function, not of x!
The error is given by -f""'(z) x^5 / 5! where z is some value between 0 and x, and x is the point at which you're evaluating (here x = 1/10). If the fifth derivative really is -(1/6) x^5, this will have maximum amplitude at z = x = 1/10, so an upper bound for the error is
|-(1/6)(1/10)^5| × (1/10)^5 / 5! = 1.39×10^-13.
Since the upper bound for the error is more than 7 orders of magnitude smaller than the actual error, it's obvious that some of the information you have given above is wrong. But without knowing what f is it's impossible for me to say what is wrong.
Here's a worked example for a similar problem that may help you to identify where you have gone wrong. Same question, but with f(x) = 1 / (1+x) = (1+x)^(-1).
First step: compute derivatives
f'(x) = -(1+x)^(-2)
f"(x) = 2 (1+x)^(-3)
f"'(x) = -6 (1+x)^(-4)
f""(x) = 24 (1+x)^(-5)
f""'(x) = -120 (1+x)^6
So the Maclaurin polynomial of degree 4 is
T(x) = f(0) + f'(0) x + f"(0) x^2 / 2 + f"'(0) x^3 / 3! + f""(0) x^4 / 4!
= 1 + (-1) x + 2 x^2 / 2 + (-6) x^3 / 6 + 24 x^4 / 24
= 1 - x + x^2 - x^3 + x^4
So our approximation of f(1/10) = 1 - 0.1 + 0.01 - 0.001 + 0.0001
= 0.9091
and the actual value of f(1/10) = 1 / (11/10) = 10/11 = 0.90909090... so the error is 9.09×10^-6 to 3 s.f.
The error is given by -f""'(z) (1/10)^5 / 5! for some z in (0, 1/10). Now f""'(z) = -120 (1+x)^6, which will have greatest amplitude when z = 1/10. So the error bound is
|-120 (1 + 1/10)^6| (1/10)^5 / 5! = 1.78×10^-5 to 3 s.f.
So the upper bound is a little less than twice the actual error in this case.
********************************
EDIT - I see you have now supplied the function details!
********************************
f(x)=x^2e^-x
So f'(x) = e^-x (-x^2 + 2x)
f"(x) = e^-x (x^2 - 4x + 2)
f"'(x) = e^-x (-x^2 + 6x - 6)
f""(x) = e^-x (x^2 - 8x + 12)
f""'(x) = e^-x (-x^2 + 10x - 20)
and f(0) = 0, f'(0) = 0, f"(0) = 2, f"'(0) = -6, f""(0) = 12
So the Maclaurin polynomial is indeed
T(x) = x^2 - x^3 + x^4 / 2
and our approximation to f(1/10) is 0.00905 as before, but f(1/10) = 0.009048374 (7 s.f.) giving an actual error of 1.626×10^-6.
Now the error bound is |- f""'(z)| (1/10)^5 / 5! for some z in (0, 1/10)
= e^-z |-z^2 + 10z - 20| (1/10)^5 / 5!
An upper bound for this is 1 (1/10^2 + 10(1/10) + 20) (1/10)^5 / 5! (taking the maximum possible absolute value of each component)
= 1.7508×10^-6
which is slightly higher than the actual error (as it should be). In fact it's under 8% higher than the actual error, so it's a good error bound.
We could tighten this slightly by noting that in (0, 1/10) the polynomial -z^2 + 10z - 20 will always be negative and the 10x term will be positive, so this term actually reduces the magnitude. So we can omit it and use an upper bound of 1 (1/10^2 + 20) (1/10)^5 / 5! = 1.6675×10^-6, which is only 2.6% above the actual error.
Places where you went wrong:
- calculation of the fifth derivative is incorrect
- value of f(1/10) is slightly incorrect and needs to be specified to much greater precision
- clearly didn't understand how to compute the error bound - I hope the examples above help.
2007-06-14 17:17:19
·
answer #2
·
answered by Scarlet Manuka 7
·
0⤊
0⤋
The Maclaurin polynomial is the Taylor sequence universal at x = 0. The maclaurin of cos(x) is one million - x^2/2! + x^4/4! - x^6/6! + ... we'd like it to the fourth order, so we'd want to approximate cos x to: cos x ? one million - x^2/2! + x^4/4! So for x = - 0.01, we've cos(-0.01) ? one million - (-0.01)^2/2! + (-0.01)^4/4! ? 0.99995 Now we'd want to appreciate how sturdy of an approximation our answer is. there's a formulation to locate the blunders in the Maclaurin polynomial: whilst we approximate a function to the nth order of the Taylor sequence, all of us understand that the blunders in the approximation is decrease than M*(x-a)^(n+one million) / (n+one million)! the place M is a certain for the n+one million by-product of the function; this is the (n+one million)th by-product of the function
2016-12-13 03:18:12
·
answer #3
·
answered by ? 4
·
0⤊
0⤋