convert convert an expression to a different form. Calling Sequence Parameters Description Examples Calling Sequence convert(expr, form, arg3) Parameters expr - any expression form - name arg3 - (optional) other arguments Description • The convert function is used to convert an expression from one form to another. Some of the conversions are data-type conversions, for example. Others are form or function conversions, for example convert(sinh(x),exp) yields exp(x)/2-exp(-x)/2 and convert(a*x!, gamma) yields a*gamma(x+1). • For function conversions, a set of optional arguments to perform the conversion in different manners are described in convert/to_special_function. • The types of known conversions are (the second argument form must be one of these): abs arctrig arctrigh base Bessel binary binomial boolean_function boolean_operator bytes D decimal degrees diff Ei elementary equality erf erfc exp expln expsincos factorial float fullparfrac function_rules gamma int Int ln local parfrac piecewise polar polynom power radians radical rational sign sqrfree string sum Sum tan temperature to_special_function trig trigh truefalse units vector • Further information is available under help pages convert/form where form is one of the forms from the above list. • A user can make custom conversions known to the convert function by defining a Maple procedure in the following way. If the procedure `convert/f` is defined, then the function call convert(a, f, x, y, ...) will invoke `convert/f`(a, x, y, ...); Note that the procedure may be indexed. Examples Convert can be used to convert numbers between bases. See the help pages convert/decimal, convert/base, convert/binary, convert/octal, and convert/hex for more information and examples. > convert(9,binary) 1001 (1) Convert between degrees and radians. See the help pages convert/degrees and convert/radians for more information. > convert(p,degrees) 180degrees (2) Convert to rational expressions or floating-point numbers. See the help pages convert/float and convert/rational for more information. > convert(1.23456,rational) 38583125 (3) > convert(18,float) 0.125 (4) Convert between units. See the help page convert/units for more information. Also, see the Units package. > convert(22,units,inches,m) 13972500 (5) Convert a rational expression to partial fraction form. See the help page convert/parfrac for more information. > f:=(x^3+x)/(x^2-1) f:=(x^3+x)/(x^2-1) (11) > convert(f,parfrac) x+1/(x-1)+1/(x+1) (12) Convert a series to a polynomial by dropping the order term. See the help page convert/polynom for more information. > s:=series(f,x,4) s:=-x-2x^3+O(x^5) (13) > convert(s,polynom) -2x^3-x (14) Convert a complex expression to polar coordinates. See the help page convert/polar for more information. > convert(12+2i,polar) polar(1/2*sqrt(2),1/4 pi) (15) Convert an expression to trigonometric or exponential form, if possible. See the help pages convert/exp and convert/trig for more information. > g:=sinh(x)+sin(x) g:=sinh(x)+sin(x) (16) > convert(g,exp) 1/2e^x-1/2e^(-x)-1/2I(e^(I*x)-e^(-I*x)) (17) Check the list above for all known types of conversions for more possibilities. Conversions to more advanced mathematical functions are shown below.