]>
Axiom has very sophisticated facilities for working with power series series. power series
Infinite series are represented by a list of the coefficients that have already been determined, together with a function for computing the additional coefficients if needed.
The system command that determines how many terms of a series is displayed is )set streams calculate. For the purposes of this book, we have used this system command to display fewer than ten terms. set streams calculate Series can be created from expressions, from functions for the series coefficients, and from applications of operations on existing series. The most general function for creating a series is called series, although you can also use taylor, laurent and puiseux in situations where you know what kind of exponents are involved.
For information about solving differential equations in terms of power series, see ugxProblemDEQSeries .
This is the easiest way to create a power series. This tells Axiom that is to be treated as a power series, series:creating so functions of are again power series.
We didn't say anything about the coefficients of the power series, so the coefficients are general expressions over the integers. This allows us to introduce denominators, symbolic constants, and other variables as needed.
Here the coefficients are integers (note that the coefficients are the Fibonacci Fibonacci numbers numbers).
This series has coefficients that are rational numbers.
When you enter this expression you introduce the symbolic constants and
When you enter the expression the variable appears in the resulting series expansion.
You can also convert an expression into a series expansion. This expression creates the series expansion of about . For details and more examples, see ugxProblemSeriesConversions .
You can create power series with more general coefficients. You normally accomplish this via a type declaration (see ugTypesDeclare ). See ugxProblemSeriesFunctions for some warnings about working with declared series.
We declare that is a one-variable Taylor series series:Taylor (UTS is the abbreviation for UnivariateTaylorSeries) in the variable with FLOAT (that is, floating-point) coefficients, centered about Then, by assignment, we obtain the Taylor expansion of with floating-point coefficients. UnivariateTaylorSeries
You can also create a power series by giving an explicit formula for its -th coefficient. For details and more examples, see ugxProblemSeriesFormula .
To create a series about whose -th Taylor coefficient is , you can evaluate this expression. This is the Taylor expansion of at .
You can extract any coefficient from a power series---even one that hasn't been computed yet. This is possible because in Axiom, infinite series are represented by a list of the coefficients that have already been determined, together with a function for computing the additional coefficients. (This is known as lazy evaluation.) When you ask for a series:lazy evaluation coefficient that hasn't yet been computed, Axiom computes lazy evaluation whatever additional coefficients it needs and then stores them in the representation of the power series.
Here's an example of how to extract the coefficients of a power series. series:extracting coefficients
This coefficient is readily available.
But let's get the fifteenth coefficient of .
If you look at then you see that the coefficients up to order have all been computed.
You can manipulate power series using the usual arithmetic operations series:arithmetic , , , and (from UnivariatePuiseuxSeries)
The results of these operations are also power series.
You can also compute , where and are two power series.
Once you have created a power series, you can apply transcendental functions (for example, exp, log, sin, tan, cosh, etc.) to it.
To demonstrate this, we first create the power series expansion of the rational function
about .
If you want to compute the series expansion of
you simply compute the sine of .
Warning:
the type of the coefficients of a power series may
affect the kind of computations that you can do with that series.
This can only happen when you have made a declaration to
specify a series domain with a certain type of coefficient.
If you evaluate then you have declared that is a one variable Taylor series series:Taylor (UTS is the abbreviation for UnivariateTaylorSeries) in the variable with FRAC INT (that is, fractions of integer) coefficients, centered about .
You can now compute certain power series in , provided that these series have rational coefficients.
You can get examples of such series by applying transcendental functions to series in that have no constant terms.
Similarly, you can compute the logarithm of a power series with rational coefficients if the constant coefficient is
If you wanted to apply, say, the operation exp to a power series with a nonzero constant coefficient , then the constant coefficient of the result would be , which is not a rational number. Therefore, evaluating would generate an error message.
If you want to compute the Taylor expansion of , you must ensure that the coefficient domain has an operation exp defined for it. An example of such a domain is Expression Integer, the type of formal functional expressions over the integers.
When working with coefficients of this type,
this presents no problems.
Another way to create Taylor series whose coefficients are expressions over the integers is to use taylor which works similarly to series:Taylor series.
This is equivalent to the previous computation, except that now we are using the variable instead of .
The ExpressionToUnivariatePowerSeries package provides operations for computing series expansions of functions. ExpressionToUnivariatePowerSeries
Evaluate this to compute the Taylor expansion of about series:Taylor . The first argument, , specifies the function whose series expansion is to be computed and the second argument, , specifies that the series is to be expanded in power of , that is, in power of .
Here is the Taylor expansion of about :
The function to be expanded into a series may have variables other than series:multiple variables the series variable.
For example, we may expand as a Taylor series in
or as a Taylor series in .
A more interesting function is When we expand this function as a Taylor series in the -th order coefficient is the -th Bernoulli Bernoulli:polynomial polynomial polynomial:Bernoulli divided by .
Therefore, this and the next expression produce the same result.
Technically, a series with terms of negative degree is not considered to be a Taylor series, but, rather, a series:Laurent Laurent series. Laurent series If you try to compute a Taylor series expansion of at via you get an error message. The reason is that the function has a pole at , meaning that its series expansion about this point has terms of negative degree. A series with finitely many terms of negative degree is called a Laurent series.
You get the desired series expansion by issuing this.
Similarly, a series with terms of fractional degree is neither a Taylor series nor a Laurent series. Such a series is called a series:Puiseux Puiseux series. Puiseux series The expression results in an error message because the series expansion about this point has terms of fractional degree.
However, this command produces what you want.
Finally, consider the case of functions that do not have Puiseux expansions about certain points. An example of this is about . produces an error message because of the type of singularity of the function at .
The general function series can be used in this case. Notice that the series returned is not, strictly speaking, a power series because of the in the expansion.
The operation series returns the most general type of
infinite series.
The user who is not interested in distinguishing
between various types of infinite series may wish to use this operation
exclusively.
The GenerateUnivariatePowerSeries package enables you to series:giving formula for coefficients create power series from explicit formulas for their -th coefficients. In what follows, we construct series expansions for certain transcendental functions by giving formulas for their coefficients. You can also compute such series expansions directly simply by specifying the function and the point about which the series is to be expanded. GenerateUnivariatePowerSeries See ugxProblemSeriesConversions for more information.
Consider the Taylor expansion of series:Taylor about :
The -th Taylor coefficient is .
This is how you create this series in Axiom.
The first argument specifies a formula for the -th coefficient by giving a function that maps to . The second argument specifies that the series is to be expanded in powers of , that is, in powers of . Since we did not specify an initial degree, the first term in the series was the term of degree 0 (the constant term). Note that the formula was given as an anonymous function. These are discussed in ugUserAnon .
Consider the Taylor expansion of about :
If you were to evaluate the expression you would get an error message because Axiom would try to calculate a term of degree and therefore divide by
Instead, evaluate this. The third argument, , indicates that only terms of degree are to be computed.
Next consider the Taylor expansion of an odd function, say, :
Here every other coefficient is zero and we would like to give an explicit formula only for the odd Taylor coefficients.
This is one way to do it. The third argument, , specifies that the first term to be computed is the term of degree 1. The fourth argument, , specifies that we increment by to find the degrees of subsequent terms, that is, the next term is of degree , the next of degree , etc.
The initial degree and the increment do not have to be integers. For example, this expression produces a series expansion of .
While the increment must be positive, the initial degree may be negative. This yields the Laurent expansion of at . (bernoulli(numer(n+1)) is necessary because bernoulli takes integer arguments.)
Of course, the reciprocal of this power series is the Taylor expansion of .
As a final example,here is the Taylor expansion of about .
When we compute the of this series, we get (in the sense that all higher terms computed so far are zero).
Axiom isn't sufficiently ``symbolic'' in the sense we might wish. It is an open problem to decide that ``x'' is the only surviving term. Two attacks on the problem might be:
(1) Notice that all of the higher terms are identically zero but Axiom can't decide that from the information it knows. Presumably we could attack this problem by looking at the sin function as a taylor series around x=0 and seeing the term cancellation occur. This uses a term-difference mechanism.
(2) Notice that there is no way to decide that the stream for asinx is actually the definition of asin(x). But we could recognize that the stream for asin(x) has a generator term and so will a taylor series expansion of sin(x). From these two generators it may be possible in certain cases to decide that the application of one generator to the other will yield only ``x''. This trick involves finding the correct inverse for the stream functions. If we can find an inverse for the ``remaining tail'' of the stream we could conclude cancellation and thus turn an infinite stream into a finite object.
In general this is the zero-equivalence problem and is undecidable.
As we discussed in ugxProblemSeriesConversions , you can also use the operations taylor, laurent and puiseux instead of series if you know ahead of time what kind of exponents a series has. You can't go wrong using series, though.
Use evalevalUnivariatePowerSeriesCategory approximation to substitute a numerical value for a variable in series:numerical approximation a power series. For example, here's a way to obtain numerical approximations of from the Taylor series expansion of .
First you create the desired Taylor expansion.
Then you evaluate the series at the value . The result is a sequence of the partial sums.
Axiom provides operations for computing definite and summation:definite indefinite sums. summation:indefinite
You can compute the sum of the first ten fourth powers by evaluating this. This creates a list whose entries are as ranges from 1 to 10, and then computes the sum of the entries of that list.
You can also compute a formula for the sum of the first fourth powers, where is an unspecified positive integer.
This formula is valid for any positive integer . For instance, if we replace by 10, summation:definite we obtain the number we computed earlier.
You can compute a formula for the sum of the first -th powers in a similar fashion. Just replace the in the definition of sum4 by any expression not involving . Axiom computes these formulas using Bernoulli polynomials; Bernoulli:polynomial we polynomial:Bernoulli use the rest of this section to describe this method.
First consider this function of and .
Since the expressions involved get quite large, we tell Axiom to show us only terms of degree up to
If we look at the Taylor expansion of about we see that the coefficients of the powers of are polynomials in .
Type: UnivariateTaylorSeries(Expression Integer,t,0)
In fact, the -th coefficient in this series is essentially the -th Bernoulli polynomial: the -th coefficient of the series is , where is the -th Bernoulli polynomial. Thus, to obtain the -th Bernoulli polynomial, we multiply the -th coefficient of the series by .
For example, the sixth Bernoulli polynomial is this.
We derive some properties of the function . First we compute .
If we normalize , we see that it has a particularly simple form.
From this it follows that the -th coefficient in the Taylor expansion of at is .
If you want to check this, evaluate the next expression.
However, since it follows that the -th coefficient is Equating coefficients, we see that and, therefore,
Let's apply this formula repeatedly, letting vary between two integers and , with :
When we add these equations we find that the sum of the left-hand sides is the sum of the powers from to . The sum of the right-hand sides is a ``telescoping series.'' After cancellation, the sum is simply
Replacing by , we have shown that
Let's use this to obtain the formula for the sum of fourth powers.
First we obtain the Bernoulli polynomial .
To find the sum of the first 4th powers, we multiply by .
This is the same formula that we obtained via .
At this point you may want to do the same computation, but with an exponent other than For example, you might try to find a formula for the sum of the first 20th powers.