applyop - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


applyop

apply a function to specified operand(s) of an expression

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

applyop( f, i, e )

applyop( f, i, e, ..., xk, ...)

Parameters

f

-

function

i

-

specifies the operand(s) in e

e

-

expression

..., xk, ...

-

optional arguments to f

Description

• 

The applyop command manipulates the selected parts of an expression. The first argument, f, is applied to the operands of e specified by i.

• 

If i is an integer, applyop( f, i, e) applies f to the ith operand of e. This is equivalent to subsop( i = f(op( i, e)), e). For example, if the value of e is the sum x+y+z, applyop( f, 2, e) computes x+f⁡y+z.

• 

If i is a list of integers, the call applyop( f, i, e) is equivalent to subsop( i = f(op( i, e)), e). This allows you to manipulate any suboperand of an expression.

• 

If i is a set, f is applied simultaneously to all operands of e specified in the set. Note: applyop( f, {}, e) returns e.

• 

Any additional arguments xk are passed as additional arguments to f in the order given.

Examples

> 

p≔y2−2⁢y−3

p≔y2−2⁢y−3

(1)
> 

applyop⁡f,2,p

y2+f⁡−2⁢y−3

(2)
> 

applyop⁡f,2,p,x1,x2

y2+f⁡−2⁢y,x1,x2−3

(3)
> 

applyop⁡f,2,2,p

y2−2⁢f⁡y−3

(4)
> 

applyop⁡f,2,3,p

y2+f⁡−2⁢y+f⁡−3

(5)
> 

applyop⁡abs,3,2,1,p

y2+2⁢y+3

(6)
> 

e≔z+1⁢ln⁡z⁢z2−2

e≔z+1⁢ln⁡z⁢z2−2

(7)
> 

expand⁡e

ln⁡z⁢z2−2⁢z+ln⁡z⁢z2−2

(8)

To expand the argument to the logarithm in e:

> 

applyop⁡expand,2,1,e

z+1⁢ln⁡z3−2⁢z

(9)

To factor the argument to the logarithm in e over R:

> 

applyop⁡factor,2,1,e,real

z+1⁢ln⁡z⁢z+1.414213562⁢z−1.414213562

(10)

See Also

map

op

subsop