constant - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


simplify/constant

simplify constant expressions typically containing radicals and functions with exact numeric arguments

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

simplify(expr, constant)

Parameters

expr

-

expression

constant

-

literal name; constant

Description

• 

The simplify(expr, constant) calling sequence is used to simplify expressions that are of type,constant and typically contain radicals or mathematical functions having exact numeric arguments.

  

The approach used consists of applying a set of simplification procedures (SP) in two steps:

  

1) The constant objects, in the form of sums, products, or function calls, are simplified using SP, starting with the inner most one and composing simplifications at each step. The routines can handle with reasonable efficiency products of fractional powers, exponentials, and various functions calls together with their multiplicative inverses.

  

2) When the resulting expression still contains radicals, the simplification procedure applied to each object in the previous step is applied once more, this time to the whole expression.

• 

The simplification procedures SP used in the itemization above consist of analyzing the Real and Imaginary parts of the expression in order to conclude about possible cancellations or simpler representations. In addition, if the expression or subexpression can be evaluated numerically fast, using hardware floats, this information is used as a starting point to determine an exact rational value for the object, if that value exists.

  

The simplify/constant routines do take assumptions into account up to the point Re, Im, and abs take them.

  

The simplification of constant subexpressions entering input for simplify is performed automatically. However, to invoke this set of simplification routines, call simplify with the extra argument constant.

Examples

e11+2cos27π2cos37π2cos17π

e11+2cos2π72cos3π72cosπ7

(1)

simplifye1,constant

0

(2)

How it works.

abse1

0

(3)

The following example has a more complex step.

e2167117+147+127137+1157

e2−167−117+−147+−127−137+1−157

(4)

Here evalc determines that the expression is real but does not perform the full simplification.

evalce2

1+2cos2π72cos3π72cosπ7

(5)

simplify/constant is able to simplify further to obtain 0.

simplifye2,constant

0

(6)

This example shows that these simple manipulations of the real and imaginary parts are not enough, but the expression is (in this case by construction) equal to a rational number.

e3e21753

e3−167−117+−147+−127−137+3653−157

(7)

simplifye3,constant

1753

(8)

The following example has nonelementary functions.

e4164Ψ1,18πcsc18πΓ78+164Ψ182πcsc18πΓ78164πΨ1,18sin18πΓ78164πΨ182sin18πΓ78+1

e4Ψ1,18πcscπ864Γ78+Ψ182πcscπ864Γ78πΨ1,1864sinπ8Γ78πΨ18264sinπ8Γ78+1

(9)

simplifye4,constant

1

(10)

The following example has powers of trigonometric functions.

e512007cos37π2cos17π+1287cos37π647cos37π120cos37πcos17π192cos37π512007cos27π2cos37π+1287cos27π6+47cos27π120cos37πcos27π+192cos27π5+12007cos27πcos17π2+1287cos17π647cos17π120cos17πcos27π192cos17π5

e51200cos3π72cosπ77+128cos3π7674cos3π7120cos3π7cosπ7192cos3π7571200cos2π72cos3π77+128cos2π767+4cos2π7120cos3π7cos2π7+192cos2π757+1200cos2π7cosπ727+128cosπ7674cosπ7120cosπ7cos2π7192cosπ757

(11)

simplifye5,constant

166

(12)

In cases as the following one (extracted from some integration problems):

e612IexpIEi1,I12Ei1,Isin1+12IEi1,Icos112Ei1,Isin112IEi1,Icos1+12IexpIEi1,I

e6IⅇIEi1I2Ei1Isin12+IEi1Icos12Ei1−Isin12IEi1−Icos12+Iⅇ−IEi1−I2

(13)

The whole expression cannot be simplified by means of Re, Im

e6

Ei1Isin1+Ei1−Isin12+ⅇIEi1IEi1Icos1+Ei1−Icos1ⅇ−IEi1−I2

(14)

It cannot be evaluated using hardware floats.

evalhfe6

Error, unsupported type `indexed` in evalhf

Some subexpressions of it can be simplified by properly manipulating these procedures and that suffices to collapse the original problem into something within the scope of these simpler manipulations, here leading to the following.

simplifye6,constant

0

(15)

The simplification routines for constant expressions is also used by simplify to simplify certain type of constant subexpressions found inside non-constant expressions

e71221241+21212+22212212π+2212212π212+2π122212212+π122122212212+2x2212212+x2122212212221221221211+2122

e7241+2+2222π+222π2+2π222+π2222+2x222+x22222222211+22

(16)

typee7,constant

false

(17)

simplifye7

2+π+π+x

(18)

See Also

abs

evalhf

Im

Re

simplify