verify/expand - Maple Programming Help

Home : Support : Online Help : Programming : Logic : Boolean : verify : verify/expand

verify/expand

verify the equality of two objects when expanded

verify/normal

verify the equality of two objects when normalized

verify/simplify

verify the equality of two objects when simplified

 Calling Sequence verify(expr1, expr2, expand) verify(expr1, expr2, 'expand'(opt1, opt2, ...)) verify(expr1, expr2, normal) verify(expr1, expr2, 'normal'(expanded)) verify(expr1, expr2, simplify) verify(expr1, expr2, 'simplify'(opt1, opt2, ...))

Parameters

 expr1, expr2 - anything, assumed to be of type algebraic opt1, opt2, ... - optional parameters passed to expand or simplify

Description

 • The verify(expr1, expr2, expand), verify(expr1, expr2, normal), and verify(expr1, expr2, simplify) calling sequences return true if the difference between the arguments expr1 and expr2 is zero after having applied the procedures expand, normal, and simplify, respectively.
 • Any optional parameters are passed on as subsequent arguments to the appropriate procedures.
 • These verifications are symmetric.
 • Because expand, normal, and simplify are Maple procedures, they must be enclosed in single quotes to prevent evaluation.
 • If expr1 and expr2 are of type relation, the verification is applied to each side of the relation.
 • If expr1 and expr2 are lists, the verification is applied elementwise.  If the lists have differing lengths, then false is returned.
 • If either expr1 or expr2 is not of type algebraic, relation, or list, then false is returned.

Examples

 > $a≔\mathrm{Array}\left(1..3,\left[1,2,{\left(x-1\right)}^{2}\right]\right)$
 ${a}{≔}\left[\begin{array}{ccc}{1}& {2}& {\left({x}{-}{1}\right)}^{{2}}\end{array}\right]$ (1)
 > $b≔\mathrm{Array}\left(1..3,\left[1,2,{x}^{2}-2x+1\right]\right)$
 ${b}{≔}\left[\begin{array}{ccc}{1}& {2}& {{x}}^{{2}}{-}{2}{}{x}{+}{1}\end{array}\right]$ (2)
 > $\mathrm{verify}\left(a,b,'\mathrm{Array}'\right)$
 ${\mathrm{false}}$ (3)
 > $\mathrm{verify}\left(a,b,'\mathrm{Array}'\left('\mathrm{expand}'\right)\right)$
 ${\mathrm{true}}$ (4)
 > $\mathrm{verify}\left(\frac{{f\left(x\right)}^{2}-1}{f\left(x\right)-1},f\left(x\right)+1\right)$
 ${\mathrm{false}}$ (5)
 > $\mathrm{verify}\left(\frac{{f\left(x\right)}^{2}-1}{f\left(x\right)-1},f\left(x\right)+1,'\mathrm{normal}'\right)$
 ${\mathrm{true}}$ (6)
 > $\mathrm{verify}\left(\frac{1}{x}+\frac{x}{x+1},\frac{x+1+{x}^{2}}{{x}^{2}+x},'\mathrm{expand}'\right)$
 ${\mathrm{false}}$ (7)
 > $\mathrm{verify}\left(\frac{1}{x}+\frac{x}{x+1},\frac{x+1+{x}^{2}}{{x}^{2}+x},'\mathrm{normal}'\right)$
 ${\mathrm{true}}$ (8)
 > $\mathrm{verify}\left(\left[a,{4}^{\frac{1}{2}}+3\right],\left[a,5\right],'\mathrm{list}'\right)$
 ${\mathrm{false}}$ (9)
 > $\mathrm{verify}\left(\left[a,{4}^{\frac{1}{2}}+3\right],\left[a,5\right],'\mathrm{list}'\left('\mathrm{normal}'\right)\right)$
 ${\mathrm{false}}$ (10)
 > $\mathrm{verify}\left(\left[a,{4}^{\frac{1}{2}}+3\right],\left[a,5\right],'\mathrm{list}'\left('\mathrm{simplify}'\right)\right)$
 ${\mathrm{false}}$ (11)
 > $\mathrm{verify}\left(\left[a,{4}^{\frac{1}{2}}+3\right],\left[a,5\right],'\mathrm{simplify}'\right)$
 ${\mathrm{false}}$ (12)
 > $\mathrm{verify}\left(\left|x\right|,\sqrt{{x}^{2}},'\mathrm{simplify}'\right)$
 ${\mathrm{false}}$ (13)
 > $\mathrm{verify}\left(\left|x\right|,\sqrt{{x}^{2}},'\mathrm{simplify}'\left('\mathrm{assume}'='\mathrm{real}'\right)\right)$
 ${\mathrm{true}}$ (14)
 > $\mathrm{verify}\left(R=1-{\mathrm{cos}\left(x\right)}^{2},R={\mathrm{sin}\left(x\right)}^{2},'\mathrm{simplify}'\right)$
 ${\mathrm{true}}$ (15)