Skip to main content

Exploring Calculus with Maple Introductory Calculus

Section 9.1 Assigning Expressions

Having to retype the same expression multiple times is tedious, but using copy and paste in Maple can sometimes produce unwanted effects. A better way to reuse an expression multiple times is to assign a name to it. You can assign any expression to a name of your choice (with some exceptions that Maple has protected) by using the := operator.

Aside

> poly := 3*x^4 - 2*x + 1;
\begin{equation*} \displaystyle poly\, := \,3\,{x}^{4}-2\,x+1 \end{equation*}
> poly;
\begin{equation*} \displaystyle 3\,{x}^{4}-2\,x+1 \end{equation*}

Aside

> poly^2;
\begin{equation*} \displaystyle \left( 3\,{x}^{4}-2\,x+1 \right) ^{2} \end{equation*}
> expr := (4^x - x^4) / exp(x + 1);
\begin{equation*} \displaystyle expr\, := \,{\frac {{4}^{x}-{x}^{4}}{{{ e}^{x+1}}}} \end{equation*}

Aside

> expr;
\begin{equation*} \displaystyle {\frac {{4}^{x}-{x}^{4}}{{{ e}^{x+1}}}} \end{equation*}
> sqrt(expr);
\begin{equation*} \displaystyle \sqrt{{\frac {{4}^{x}-{x}^{4}}{{{ e}^{x+1}}}}} \end{equation*}