Given a taylor series of a function f, how do I get the original function f

9 visualizaciones (últimos 30 días)
So I know theres a way to get the taylor series expansion of a function f. But how do i get the original function f given a taylor series.
for example we can find the power series of e^x by
f = e^x
T = taylor(f,'ExpansionPoint',0,'Order',4)
we get
1+x+x^2/2+x^3/6
but how do I get e^x given the power series 1+x+x^2/2+x^3/6 ?
thank you

Respuesta aceptada

John D'Errico
John D'Errico el 17 de Mzo. de 2024
Editada: John D'Errico el 17 de Mzo. de 2024
You CANNOT do so. I'm sorry, but you are asking the impossible. Looking at it another way, the solution is absolutely trivial. Why do I say that?
Given any example truncated Taylor series, such as the one you gave:
Y = 1 + x + x^2/2 + x^3/6
there are infinitely many possible Taylor series that start out exactly like that. All of them would look exactly the same for the first few terms. And given only the first few terms, you cannot decide which of them is the true original function.
However, there is one function that does have EXACTLY that Taylor series, and is trivially arrived at. What is it? It is the cubic polynomial:
y_cubic = 1 + x + x^2/2 + x^3/6
If you compare terms, you will see that indeed, I have found it! We can even test that claim, via use of the function Taylor itself.
syms x
taylor(1 + x + x^2/2 + x^3/6,order = 4)
ans = 
Oh well, Taylor decided to change the sequence of the terms. BLAST! Regardless, perhaps you should recognize this yields an equally trivial way to identify another function that will have the same truncated Taylor series. For example:
taylor(1 + x + x^2/2 + x^3/6 + x^5,order = 4)
ans = 
Here is yet another function, equally trivially chosen....
taylor(exp(x) + x^5,order = 4)
ans = 
Or how about this one?
taylor(sin(x) + cos(x) + x^2 + x^3/3,order = 4)
ans = 
Need I go on? I would claim I can do it forever, choosing infinitely many possible functions. Some would look terribly strange and complicated of course.
In fact, I can even argue that the BEST possible solution, the very best possible function that yields the desired truncated Taylor series is in fact the original cubic polynomial. Why do I make that claim? Because it is the one function that EXACTLY matches that series, with no additional terms required, no terms were needed to be truncated.
Suppose I asked a subtly different question. Given only the first 4 words of a book, can you tell me the title of the book they came from? Of course not. Well, ok, if the first words were "Call me Ishmael" some people might hazard a guess. But that would be a rare example. (Do kids even read the classics anymore?)
Do you now see why what you ask is fundamentally impossible to achieve?
  4 comentarios
Joshua Barboza
Joshua Barboza el 17 de Mzo. de 2024
i mean that does work. But what I wanted to know if it was possible to get the original function of a power series given some terms. Where the user does not need to find the equation for the infinite sum. But thank you for that
John D'Errico
John D'Errico el 17 de Mzo. de 2024
Editada: John D'Errico el 17 de Mzo. de 2024
Again, you cannot do what you are asking, becuase there are infinitely many possible solutions, and there is no possible way to infer the true function that start of a series implies. This is no different from asking a computer to complete writing a book, given only the first 3 or 4 words.
As an example, suppose I asked Chat GPT to finish a story, starting with only those words? You might get this:
"Call me Ismael. I was a humble tailor, weaving threads of fabric into garments that adorned the townsfolk of a quaint village. My little shop, nestled between bustling streets, was a sanctuary of creativity and craftsmanship.
The villagers knew me as a man of few words, always diligently working behind my wooden counter. They sought me out for my meticulous attention to detail and the magic I could create with a needle and thread. Each stitch was a testament to my passion for the craft, and my garments held a touch of enchantment that seemed to elevate the wearer.
One day, a stranger stepped into my shop. He wore a tattered coat, his face weathered by time and hardship. His eyes gleamed with a glimmer of hope as he approached me.
"Call me Ismael," he said, his voice carrying a hint of longing.
I nodded, acknowledging his request. Ismael began to tell me his story. He had traveled far and wide, seeking solace and purpose. He had encountered countless adventures, faced trials and tribulations, and carried with him a deep yearning for belonging.
Moved by his tale, I decided to create something special for Ismael—a garment that would capture his essence and convey his journey. Days turned into nights as I poured my heart into every stitch, infusing the fabric with threads of resilience, perseverance, and the beauty of the unknown.
Finally, the garment was complete—a cloak that shimmered with hues of blue, representing the vast seas he had traversed. Golden threads depicted the stars that guided him through the darkest nights, and intricate patterns symbolized the intertwining paths he had taken.
As I presented the cloak to Ismael, his eyes filled with tears. He embraced me tightly, expressing a gratitude words could not..."
Chat GPT
(Not too bad a piece of prose. I hope it is not stolen from some other source, but my request was directed at Chat GPT.)
Do you see the fundamental problem? I'm sorry, but you cannot infer the original function from only the beginning. In fact, it does not matter how many terms of that power series you provide. No finite number of terms from a truncated series can uniquely define the original function the series was derived to approximate.

Iniciar sesión para comentar.

Más respuestas (1)

Matt J
Matt J el 17 de Mzo. de 2024
Editada: Matt J el 17 de Mzo. de 2024
syms x k
f = symsum(x^k/factorial(k),k,0,Inf)
ans = 

Categorías

Más información sobre Time Series en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by