MATLAB Answers

0

taylor series expansion for acos(1-x)

Robert Tzou 님이 질문을 제출함. 30 Oct 2019
최근 활동 John D'Errico 님이 편집함. 4 Nov 2019
MatLab gave error messages for taylor(acos(1-x),x) (after syms x) while the expansion does exist?

  댓글 수: 0

로그인 to comment.

태그

제품


릴리스

R2017a

답변 수: 2

John D'Errico 님의 답변 30 Oct 2019
John D'Errico 님이 편집함. 30 Oct 2019
 채택된 답변

Actually, the expansion you ask for does NOT exist. Why not? Because. I hope that is a good enough answer.. ;-)
Seriously, the expansion fails, because at x==0, there is a singularity, so you cannot write a Taylor series. Think about it. What is the first derivative of acos(1-x), evaluated at x==0?
fprime = diff(acos(1-x),x)
fprime =
1/(1 - (x - 1)^2)^(1/2)
>> subs(fprime,x,0)
Error using symengine
Division by zero.
Error in sym/subs>mupadsubs (line 160)
G = mupadmex('symobj::fullsubs',F.s,X2,Y2);
Error in sym/subs (line 145)
G = mupadsubs(F,X,Y);
So can you write a Taylor series, expanded around x==0? NO! NO! NO!
But does that mean no expansion exists? A Tsaylor series expansion DOES exist, as long as you use an expansion point where the function is not singular. The default expansion point for the function Taylor is at x==0. So, in one line, we can get a series expansion as you seem to want, as long as you override the default for the expansion point.
taylor(acos(1-x),x,'expansionpoint',0.5)
ans =
pi/3 + (2*3^(1/2)*(x - 1/2))/3 - (2*3^(1/2)*(x - 1/2)^2)/9 + (8*3^(1/2)*(x - 1/2)^3)/27 - (28*3^(1/2)*(x - 1/2)^4)/81 + (608*3^(1/2)*(x - 1/2)^5)/1215
Will the Taylor series give anything meaningful, if you then tried to use it at x==0? NO! It won't work well, not in trying to predict the value at x==0. But that just reflects the idea that trying to predict the value of a function with an infinite slope at the prediction point using a polynomial approximation is likely to be a really bad idea.
Not all functions are well approximated by Taylor series. (You might want to re-read your class notes about convergence of a series.)

  댓글 수: 0

로그인 to comment.


Robert Tzou 님의 답변 30 Oct 2019

Singularity of derivatives of acos(x-1) at x = 0 is well taken. What I was looking for, more appropriately to put, is a power series approximation of acos(x-1) as x approches zero, which can also include Laurent series or Puiseux series approximation. Matlab does have this option, series(acos(x-1),x) instead of taylor(acos(x-1),x), which describes the asymptotic behavior that I am looking for. Thank you again for your time and effort that goes into the resolutions to my question!

  댓글 수: 1

Please don't use answers to make a comment. Use comments to make comment.
Of course, If you knew what you wnted - that A Taylor series will fail when expanded around zero, then why are you complaining that a Taylor series won't work?

로그인 to comment.



Translated by