 Eval - Maple Programming Help

Eval

evaluate an expression

Calling Sequence

 Eval(a, x=n) $\genfrac{}{}{0}{}{a}{\phantom{x=n}}{|}\genfrac{}{}{0}{}{\phantom{a}}{x=n}$ Eval(a, {x1=n1, x2=n2, ...})

Parameters

 a - expression x, x1, x2, ... - names n, n1, n2, ... - evaluation points

Description

 • The Eval function is a placeholder for evaluation at a point. The expression a is evaluated at x=n (x1=n1, x2=n2, ... for the multivariate case).
 • To perform an evaluation of an expression or a polynomial over the rational numbers, use the eval command.
 • You can enter the command Eval using either the 1-D or 2-D calling sequence. For example, Eval(x^7 + x + 1, x=1) is equivalent to $\genfrac{}{}{0}{}{\left({x}^{7}+x+1\right)}{\phantom{x=1}}{|}\genfrac{}{}{0}{}{\phantom{\left({x}^{7}+x+1\right)}}{x=1}$.
 • The call Eval(a, x=n) mod p evaluates the polynomial a at x=n modulo p. The polynomial a must be a multivariate polynomial over a finite field. For this calling sequence, a can also be a Matrix or Vector of polynomials.
 • The call modp1(Eval(a, n), p) evaluates the polynomial a at x=n modulo p where a must be a univariate polynomial in the modp1 representation, with n an integer and p an integer > 1.

Examples

 > $\mathrm{Eval}\left({x}^{7}+x+1,x=1\right)$
 $\genfrac{}{}{0}{}{\left({{x}}^{{7}}{+}{x}{+}{1}\right)}{\phantom{{x}{=}{1}}}{|}\genfrac{}{}{0}{}{\phantom{\left({{x}}^{{7}}{+}{x}{+}{1}\right)}}{{x}{=}{1}}$ (1)
 > $\mathrm{value}\left(\right)$
 ${3}$ (2)
 > $\mathrm{Eval}\left({x}^{2}+y,\left\{x=3,y=2\right\}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}5$
 ${1}$ (3)
 > $\mathrm{alias}\left(\mathrm{\alpha }=\mathrm{RootOf}\left({x}^{4}+x+1\right)\right):$
 > $a≔{x}^{4}+\mathrm{\alpha }{x}^{2}+1$
 ${a}{≔}{{x}}^{{4}}{+}{\mathrm{\alpha }}{}{{x}}^{{2}}{+}{1}$ (4)
 > $\mathrm{Eval}\left(a,x=\mathrm{\alpha }\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}5$
 ${{\mathrm{\alpha }}}^{{3}}{+}{4}{}{\mathrm{\alpha }}$ (5)
 > $\mathrm{Eval}\left(\mathrm{int}\left(f\left(x\right),x\right),x=y\right)$
 $\genfrac{}{}{0}{}{{\int }{f}{}\left({x}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}}{\phantom{{x}{=}{y}}}{|}\genfrac{}{}{0}{}{\phantom{{\int }{f}{}\left({x}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}}}{{x}{=}{y}}$ (6)
 > $\mathrm{Eval}\left(\mathrm{Matrix}\left(\left[\left[{x}^{2}+y\right]\right]\right),\left\{x=3,y=2\right\}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}5$
 $\left[\begin{array}{c}{1}\end{array}\right]$ (7)