simplify/constant - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Algebra : Expression Manipulation : Simplifying : simplify/constant

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+2cos2Pi72cos3Pi72cos1Pi7

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

(1)

simplifye1,constant

0

(2)

How it works.

e1

0

(3)

The following example has a more complex step.

e2167117+147+127137+1157

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

(4)

e2

0

(5)

Manipulate the real and imaginary parts.

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.

e41Ψ1,18Picsc1Pi864GAMMA78+1Ψ182Picsc1Pi864GAMMA781PiΨ1,1864sin1Pi8GAMMA781PiΨ18264sin1Pi8GAMMA78+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.

e51200cos3Pi72cos1Pi77+128cos3Pi7674cos3Pi7120cos3Pi7cos1Pi7192cos3Pi7571200cos2Pi72cos3Pi77+128cos2Pi767+4cos2Pi7120cos3Pi7cos2Pi7+192cos2Pi757+1200cos2Pi7cos1Pi727+128cos1Pi7674cos1Pi7120cos1Pi7cos2Pi7192cos1Pi757

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):

e61IⅇIEi1,I21Ei1,Isin12+1IEi1,Icos121Ei1,Isin121IEi1,Icos12+1IⅇIEi1,I2

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

(13)

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

e6

IⅇIEi1IEi1Isin1+IEi1Icos1Ei1−Isin1IEi1−Icos1+Iⅇ−IEi1−I2

(14)

It cannot be evaluated using hardware floats.

evalhfe6

Error, unsupported type `('complex')('float')` 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

e7121241+21212+22212212Pi+2212212Pi212+2Pi122212212+Pi122122212212+2x2212212+x21222122122221221221211+2122

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

(16)

typee7,constant

false

(17)

simplifye7

π+π+x2

(18)

See Also

abs

evalhf

Im

Re

simplify