Skip to main content

Exploring Calculus with Maple Introductory Calculus

Section 1.3 The Assignment Operator and Creating Functions

Subsection 1.3.1 Recommended Tutorials

Before starting on these exercises, you should familiarize yourself with the material covered in the following tutorials:

Subsection 1.3.2 Introduction

In this activity, you will be using the assignment operator :=, which allows you assign Maple output to a name of your choice. This is especially useful for assigning expressions and functions on one Maple input, before manipulating those expressions later on in your worksheet.

Exercises 1.3.3 Exercises

1.

In this exercise, you’ll learn how to evaluate an expression at a given value of \(x\) two ways: using the subs() command, and using function notation.
Aside
(a)
Assign the expression \(\dfrac{\sin(x)+3}{\cos(x)+1}\) to expr as follows:
> expr := ( sin(x) + 3)/( cos(x) + 1);
Then use the subs() command to substitute \(x=3\) into expr. Evaluate the result as a decimal with \(15\) digits.
(b)
Assign the function \(g(x) = \dfrac{\sin(x)+3}{\cos(x)+1}\) as follows:
> g(x) := ( sin(x) + 3)/( cos(x) + 1);
Now, evaluate \(g(3)\) to \(15\) digits to get the same result.

2.

Assign the expression \(x^2+2^x\) to expr2. Then, substitute \(y =\)Β expr2 into \(y^2+3y\) and expand the result.

3.

Assign the expression \(2x^2-4x+7\) to poly and then substitute \(x=5+h\) into poly and simplify.

4.

The function \(f(x) = (1-x^2) { e}^{-\sfrac{x^2}{2}}\) is known as the Mexican Hat Function.
(a)
Assign the function to \(f(x)\) using the := operator.
Hint.
The exponential function, \({ e}^x\text{,}\) in Maple may be typed as exp(x). You may also use the palette toolbar to use the proper \(e\text{.}\) You may not simply type the letter `e` for the natural exponential function.
(b)
Plot the graph of \(f(x)\text{.}\) Adjust the bounds and scaling of the graph as necessary to see why this is known as the Mexican Hat Function.

5.

Maple, by default, does not know the function
\begin{equation*} sinc(x) = \dfrac{\sin(\pi x)}{\pi x}\text{,} \end{equation*}
which is important in engineering.
Aside
(a)
Assign the \(sinc(x)\) function using the assignment operator.
Hint 1.
Be sure to include a multiplication symbol or space between \(\pi\) and \(x\text{.}\)
Hint 2.
The mathematical constant \(\pi = 3.14...\) must be typed into Maple as Pi.
(b)
Evaluate \(sinc(3)\text{,}\) \(sinc\left(\frac{1}{2}\right)\text{,}\) and \(sinc(0.25)\text{.}\)