Taylor Series of piecewise functions

Ratch

Joined Mar 20, 2007
1,070
Mark44,

It gives excellent results for all x <= 0, and gives reasonable results for x > 0, as long as x isn't too large.
If you discover that there is such a condition (that piecewise-defined functions cannot have Taylor series (and hence, Maclaurin series), I trust that you'll let me know.
You own example shows that it does not. For x=1, or x=2, or x=3, etc., your "Maclaurin series" strays way off course. No matter how many terms are used. If it was truly a Maclaurin series it would converge with exp(-1/x), even if x was not zero.

Ratch
 

Mark44

Joined Nov 26, 2007
628
You own example shows that it does not. For x=1, or x=2, or x=3, etc., your "Maclaurin series" strays way off course.
I'm sure you recall that I said "if x isn't too large." Obviously, the values you chose don't give good results because they are too large. If you choose values that are closer to zero, such as 0.01, you'll get results that are not so far off.

No matter how many terms are used. If it was truly a Maclaurin series it would converge with exp(-1/x), even if x was not zero.
First, y = 0 + 0*x + 0*x^2 + ... + 0*x^n + ...
is truly a Maclaurin series.
Second, using an x-value of 0.01, which is relatively large, as real numbers go, the Maclaurin series gives 0.0, and exp(-1/x) gives ~3.72 X 10^-44 -- these two values aren't identical, but they do agree in the first 43 decimal places. If I use x-values that are smaller, the results are even closer. What is it about convergence that you don't understand, Ratch?

As I said before, and you were thoughtful enough to quote, this series gives excellent (i.e., exact) results for x <= 0, using the piecewise definition of the function. I also said that the series gives "reasonable" results if x isn't too large. In case you didn't catch it, I said this with tongue firmly in cheek.

If you really want to be able to approximate exp(-1/x) for arbitrarily large values of x, then I agree that the Maclaurin series isn't up to the task, and what you need is a Taylor series.

Mark
 

Ratch

Joined Mar 20, 2007
1,070
Mark44,

I'm sure you recall that I said "if x isn't too large." Obviously, the values you chose don't give good results because they are too large. If you choose values that are closer to zero, such as 0.01, you'll get results that are not so far off.
Yes, I remember you writing that. But 0.01 is pitifully small to the range of positive x values that can go to infinity. It is really a constant representing a curve that that is close to zero for a very, very short distance.

First, y = 0 + 0*x + 0*x^2 + ... + 0*x^n + ...
is truly a Maclaurin series.
Not for the whole equation the OP posted. Otherwise it would track the equation. In any case, it is a trivial expression that reduces to a constant no matter how many terms are evaluated.

Second, using an x-value of 0.01, which is relatively large, as real numbers go, the Maclaurin series gives 0.0, and exp(-1/x) gives ~3.72 X 10^-44 -- these two values aren't identical, but they do agree in the first 43 decimal places.
Well, I consider 0.01 to be very small as far as the range of x which can extend out to infinity. The two expressions are concurrent only at a very, very small range.

What is it about convergence that you don't understand, Ratch?
I understand that they do not converge throughout the range of x like a series should do, if evaluated for enough terms. That never happens for a constant representing a exponential function.

As I said before, and you were thoughtful enough to quote, this series gives excellent (i.e., exact) results for x <= 0, using the piecewise definition of the function. I also said that the series gives "reasonable" results if x isn't too large. In case you didn't catch it, I said this with tongue firmly in cheek.
No, I did not catch that. I am too hopelessly pendantic to pick up on that.

If you really want to be able to approximate exp(-1/x) for arbitrarily large values of x, then I agree that the Maclaurin series isn't up to the task, and what you need is a Taylor series.
Or a series with x in the denominator and excluding x=0.

Ratch
 
Top