What to code in order to find the taylor series expansion of an ODE

10 views (last 30 days)
So we are given the ODE: dx/dt-t*x=exp(t) and it ask to write a code in order to solve for the first four non zero terms of the Taylor series for x... How in the world do i do this??
Thanks so much

Answers (1)

Walter Roberson
Walter Roberson on 14 Oct 2015
That cannot be done.
Differential equations have boundary conditions, which has not been provided here.
Taylor series requires a point of expansion, which has not been provided here.
If you allow the boundary condition to be symbolic and you allow the point of expansion to be symbolic, then you can come up with a Taylor series, certainly. But because that taylor series will have two unknowns in it (the boundary condition and the point of expansion), for each boundary condition there exists at least one point of expansion for which the first term would be 0, and for each point of expansion there exists at least one boundary condition for which the first term would be 0. Likewise for any of the first 5 terms (with the conditions becoming more and more complicated.) You therefore cannot calculate the first 5 non-zero terms because you have enough freedoms that one of them can always be zeroed.
It is possible, though, to calculate the first 6 terms, as you could show that at most one of them would be 0 for any combination of boundary condition and initial expansion point. But that is not what you ask us to do.
  3 Comments
Walter Roberson
Walter Roberson on 16 Oct 2015
Then you still have multiple expansion points at which the any given one of the first 5 terms would be 0, including at least one case where the expansion point is real valued.
The case where x(0)==0 expanded around 0 gives you a taylor formula that is necessarily 0 at t = 0 (because you said it had to be by setting that boundary condition!). That taylor formula does not achieve that effect by having terms cancel: the taylor formula achieves that by having every term be 0 there. You cannot extract 5 non-zero terms for that case because every term will be 0.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!