piecewise - Maple Help

simplify/piecewise

simplify piecewise expressions

 Calling Sequence simplify(expr) simplify(expr, piecewise) simplify/piecewise(expr, var)

Parameters

 expr - any expression piecewise - (optional) literal name; piecewise var - variable

Description

 • The simplify/piecewise command can simplify expressions with piecewise functions of one variable. If the expression contains more than one variable use the convert(expr, piecewise, var) calling sequence or the long form simplify/piecewise(expr, var).

Examples

 > $A≔\mathrm{convert}\left(\mathrm{abs}\left(x\right),\mathrm{piecewise}\right)$
 ${A}{≔}\left\{\begin{array}{cc}{-}{x}& {x}{<}{0}\\ {x}& {0}{\le }{x}\end{array}\right\$ (1)
 > $\mathrm{simplify}\left(AA\right)$
 ${{x}}^{{2}}$ (2)
 > $B≔\mathrm{piecewise}\left({x}^{2}-4<0,-x,xx\right)$
 ${B}{≔}\left\{\begin{array}{cc}{-}{x}& {{x}}^{{2}}{<}{4}\\ {{x}}^{{2}}& {\mathrm{otherwise}}\end{array}\right\$ (3)
 > $\mathrm{simplify}\left(B-\left(\mathrm{piecewise}\left(3
 $\left\{\begin{array}{cc}{{x}}^{{2}}{-}{1}& {x}{\le }{-2}\\ {-}{x}{-}{1}& {x}{<}{2}\\ {{x}}^{{2}}{-}{1}& {x}{\le }{3}\\ {{x}}^{{2}}& {3}{<}{x}\end{array}\right\$ (4)
 > $\mathrm{simplify/piecewise}\left({\left(\mathrm{piecewise}\left(0
 ${\left(\left\{\begin{array}{cc}{b}& {x}{\le }{0}\\ {a}& {0}{<}{x}\end{array}\right\\right)}^{{2}}$ (5)