Message Boards Message Boards

0
|
3275 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

Taylor series with indefinite lengths - error

Posted 10 years ago

Hi!

I am trying to conduct a very simple taylor series problem using mathematica and am getting a very interesting error.

My goal is to make a taylor series expansion of log(x) around 1 to k^th series.

It's fairly straightforward, and is very doable in wolfram alpha.

Here's my code:

   b[x_] := log (x)
    SetAttributes[k, Constant]
    Series[b[x], {x, 1, k}]

And here's my error:

Series::serlim: Series order specification k is not a machine-sized integer. >>

Any help with this would be useful !

Thanks!

POSTED BY: Warren Durrett

A couple of comments. In Mathematica

log (x) 

means the symbol log multiplied by x. Also log is not the logarithm function, Log is. So if the latter is what you meant, then the proper way to express Log of the argument x is

Log[x]

Second comment" in making use of a parameter like k there is no need to specify that it has the Constant Attribute since it has no value and therefor has no dependence on anything.

Final comment: The function Series is meant to be evaluated with an explicit integer in the place where you have k entered. That is the meaning of the error message that you received.

So you can certainly ask to perform an evaluation like

Series[Log[x], {x, 1, 5}]
POSTED BY: David Reiss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract