Skip to main content
Contents Index
Dark Mode Prev Up Next
\(\usepackage{siunitx}
\newcommand{\lrp}[1]{\left(#1\right)}
\newcommand{\lrb}[1]{\left[#1\right]}
\newcommand{\lrbrace}[1]{\left\lbrace#1\right\rbrace}
\newcommand{\abs}[1]{\left|#1\right|}
\newcommand{\dint}{\displaystyle\int}
\newcommand{\defint}[2]{\dint^{#2}_{#1}}
\newcommand{\dlim}[2]{\displaystyle\lim_{#1\rightarrow #2}\,}
\newcommand{\dydx}{\dfrac{dy}{dx}}
\newcommand{\ddx}{\tfrac{d}{dx}}
\newcommand{\dddx}{\dfrac{d}{dx}}
\newcommand{\ifsol}[1]{\ifprintanswers{#1}\fi}
\newcommand{\Nat}{\mathbb{N}}
\newcommand{\Whole}{\mathbb{W}}
\newcommand{\Int}{\mathbb{Z}}
\newcommand{\Rat}{\mathbb{Q}}
\newcommand{\Real}{\mathbb{R}}
\newcommand{\Complex}{\mathbb{C}}
\DeclareMathOperator\arcsinh{arcsinh}
\DeclareMathOperator\arccosh{arccosh}
\DeclareMathOperator\arctanh{arctanh}
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\newcommand{\sfrac}[2]{{#1}/{#2}}
\)
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 Protected names include common functions such as
exp. For example,
> poly := 3*x^4 - 2*x + 1;
\begin{equation*}
\displaystyle poly\, := \,3\,{x}^{4}-2\,x+1
\end{equation*}
\begin{equation*}
\displaystyle 3\,{x}^{4}-2\,x+1
\end{equation*}
Aside Never assign anything to single-letter names such as
\(x\) or
\(y\text{.}\) It is best to keep single letters as arbitrary variables.
\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 It is important to assign expressions to names that make sense to you and are easy to remember. It is also recommended not to reuse a name in the same document. If you assign a new expression to an old name, the new expression will overwrite what was previously assigned.
\begin{equation*}
\displaystyle {\frac {{4}^{x}-{x}^{4}}{{{ e}^{x+1}}}}
\end{equation*}
\begin{equation*}
\displaystyle \sqrt{{\frac {{4}^{x}-{x}^{4}}{{{ e}^{x+1}}}}}
\end{equation*}