### The Maxima on-line user's manual

Algebra Calculator

#### Apply2

Function: apply2 (<expr>, <rule_1>, ..., <rule_n>) If <rule_1> fails on a given subexpression, then <rule_2> is repeatedly applied, etc. Only if all rules fail on a given subexpression is the whole set of rules repeatedly applied to the next subexpression. If one of the rules succeeds, then the same subexpression is reprocessed, starting with the first rule.

`maxapplydepth` is the depth of the deepest subexpressions processed by `apply1` and `apply2`.

See also `apply1` and `let`.

```(%o1)                                true
(%i2) ```

### Related Examples

? apply2;

Calculate

##### apply2-cos-defrule-sin-true

mathdeclare([x,y], tr...

defrule(extrig1,sin(x...

apply2(E,extrig1);

Calculate

##### apply2-cos-defrule-sin-true

mathdeclare([x,y], tr...

defrule(extrig1,sin(x...

apply2(E,extrig1);

Calculate

? apply2;

Calculate

##### apply2-cos-defrule-sin-true

mathdeclare([x,y], tr...

defrule(extrig1,sin(x...

apply2(E,extrig1);

Calculate

##### apply2-cos-defrule-sin-true

mathdeclare([x,y], tr...

defrule(extrig1,sin(x...

apply2(E,extrig1);

Calculate