HP Forums
Questions on Taylor series and CAS integrate - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Questions on Taylor series and CAS integrate (/thread-4553.html)



Questions on Taylor series and CAS integrate - factor - 08-22-2015 02:11 AM

While trying to repeat a Taylor series calculation for approximation (link) on the Prime, the following results are obtained:

[attachment=2456]

i.e.
taylor(e^(-x²/2),x,6)

returned result:
1-(1/2)*x²+(1/8)*x^4-(1/48)*x^6+(1/384)*x^8-(1/3840)*x^10+(1/46080)*x^12+x^14*order_size(x)

and then integrate the result (the last term "order_size(x)" removed):
int(1-(1/2)*x²+(1/8)*x^4-(1/48)*x^6+(1/384)*x^8-(1/3840)*x^10+(1/46080)*x^12)


The answer is:
(231*x^13-3276*x^11+40040*x^9-411840*x^7+3459456*x^5-23063040*x^3+138378240*x)/138378240


Got two questions from the results and would be grateful for any advice..

1) what is the last term order_size(x) from the returned Taylor polynomial? Are there anyway to prevent it from returning?

2) in the last integration, the resulting equation is quite dissimilar to the one as in the link above (which is from the other brand calculator). Prime returned one with 7 multiplications with very large numbers, plus one division, while the other result looks more compact with only 6 divisions with relatively smaller numbers. Looks like Prime's CAS choose to have one common denominator and hence a very large one. Are there way to somehow simplify the Prime's result?

Thanks in advance!


RE: Questions on Taylor series and CAS integrate - Arno K - 08-22-2015 06:58 AM

(08-22-2015 02:11 AM)factor Wrote:  While trying to repeat a Taylor series calculation for approximation (link) on the Prime, the following results are obtained:



Got two questions from the results and would be grateful for any advice..

1) what is the last term order_size(x) from the returned Taylor polynomial? Are there anyway to prevent it from returning?

2) in the last integration, the resulting equation is quite dissimilar to the one as in the link above (which is from the other brand calculator). Prime returned one with 7 multiplications with very large numbers, plus one division, while the other result looks more compact with only 6 divisions with relatively smaller numbers. Looks like Prime's CAS choose to have one common denominator and hence a very large one. Are there way to somehow simplify the Prime's result?

Thanks in advance!
Your first question can easily be answered. To prevent the prime from providing such order_size stuff you use taylor(e^(-x^2/2),x,6,polynom). Order_size shall provide information about the error made when the taylor polynomial is used as an approximation to the real function.
I can not answer your second question, but one of the algebra commands (simplify, collect, expand...), which I have not really used, should do the task.
Arno


RE: Questions on Taylor series and CAS integrate - parisse - 08-22-2015 08:19 AM

It depends of the autosimplification command: if maximum, simplify is called and it rewrites the expression as a single fraction with a common denominator. Otherwise it should remain as a sum of fractions.


RE: Questions on Taylor series and CAS integrate - factor - 08-22-2015 10:20 AM

Thanks both of you, Parisse and Arno for the explanation and suggestions. Will try that extra option in the Taylor() function to see if I can have the error term removed.

(08-22-2015 08:19 AM)parisse Wrote:  It depends of the autosimplification command: if maximum, simplify is called and it rewrites the expression as a single fraction with a common denominator. Otherwise it should remain as a sum of fractions.

Thanks parisse you are right and that do the trick. Prime gave results remained as sum of fractions like what you said when the simplify setting is changed to minimum:

[attachment=2458]


RE: Questions on Taylor series and CAS integrate - Tim Wessman - 08-22-2015 02:48 PM

Quote:Thanks parisse you are right and that do the trick. Prime gave results remained as sum of fractions like what you said when the simplify setting is changed to minimum:

Note that "maximum" will either be changed to something else, or removed completely in the future. The current behavior basically just presses the "simplify" key and is far from ideal as you've pointed out.