combine/range
combine ranges
Calling Sequence
Parameters
Description
Examples
combine(e, 'range')
e
-
any expression
Expressions involving calls to an operator F of two arguments, the second of which is of the form name = range, in which the range is either a discrete or continuous range, are combined by applying the transformations:
F⁡f⁡x,x=a..b+F⁡g⁡x,x=c..d→F⁡f⁡x,x=a..d
whenever the operator F, first arguments f⁡x and g⁡x, and ranges a..b and c..d satisfy one of the following conditions.
F=Int or F=int,c=b, and f⁡x=g⁡x
F=Int or F=int,c=a, and f⁡x=−g⁡x
F=Int or F=int,b=d, and f⁡x=−g⁡x
F=Sum or F=sum,c=1+b, and f⁡x=g⁡x
F=Sum or F=sum,c=a and b<d and f⁡x=−g⁡x
For the results of `combine/range` to be valid, the operator F must be a function of two arguments, the second of which has the form name = range and is additive over ranges.
Knowledge of the summation and integral operators is supported in the library. You can add to the knowledge of which operators can be manipulated by `combine/range` by assigning to one of the environment variables _EnvRangeCombinableContinuous or _EnvRangeCombinableDiscrete. Each should be a set of names of operators F. Operators in the set _EnvRangeCombinableDiscrete are combined in the same way as Sum, while those in _EnvRangeCombinableContinuous are combined like integrals. The environment variable _EnvRangeCombinable is used internally and should not be modified directly by users.
By calling the procedure combine/range directly, you can set the values of combinable operators for a single call by passing an extra (second) argument in the form of a list of two sets. The first member of the list is the set of operators that can be combined using continuous ranges (Int-like), and the second member of the list should be a set of the names of Sum-like operators whose ranges are to be treated as discrete.
The power of `combine/range` is controlled by the values of the environment variables Testzero and Normalizer. These are used to detect matching range endpoints and matching first arguments. Resetting Testzero gives you local control over the combining power of this procedure.
Int⁡f⁡x,x=a..b+Int⁡−f⁡x,x=a..c
∫abf⁡xⅆx+∫ac−f⁡xⅆx
=combine⁡,range
∫abf⁡xⅆx+∫ac−f⁡xⅆx=∫cbf⁡xⅆx
Sum⁡f⁡j,j=a..b+Sum⁡f⁡j,j=b+1..d
∑j=ab⁡f⁡j+∑j=1+bd⁡f⁡j
∑j=ab⁡f⁡j+∑j=1+bd⁡f⁡j=∑j=ad⁡f⁡j
`combine/range` is sensitive to assumptions:
Sum⁡f⁡j,j=a..b+Sum⁡−f⁡j,j=a..d
∑j=ab⁡f⁡j+∑j=ad⁡−f⁡j
=combine⁡,rangeassumingb<d
∑j=ab⁡f⁡j+∑j=ad⁡−f⁡j=−∑j=1+bd⁡f⁡j
G⁡f⁡x,x=a..b+G⁡f⁡x,x=b..c
=combine⁡,range,G,∅
G⁡f⁡x,x=a..b+G⁡f⁡x,x=b..c=G⁡f⁡x,x=a..c
See Also
combine
Environment Variables
Testzero
Normalizer
Expressions of Type range
int or Int
sum or Sum
Download Help Document