Skip to main content

Exploring Calculus with Maple Introductory Calculus

Section 9.4 Operations on Functions

Once one or more functions are assigned, we can use commands on those functions for various options, such as plotting them.
> f(x) := 2*x^3;
\begin{equation*} \displaystyle f\, := \,x\mapsto 2\,{x}^{3} \end{equation*}
> plot(f(x), x=-5..5);
Multiple functions can be combined through composition to create new expressions.
> g(t) := t+1;
\begin{equation*} \displaystyle g\, := \,t\mapsto t+1 \end{equation*}
> f(g(t)); expand(%);
\begin{equation*} \displaystyle 2\, \left( t+1 \right) ^{3} \end{equation*}
\begin{equation*} \displaystyle 2\,{t}^{3}+6\,{t}^{2}+6\,t+2 \end{equation*}

Example 9.1. Average Rate of Change of a Function over an Interval.

In this example, we will find the average rate of change of the function \(f(x) = -2x^3 + 25x^2 + 15\) over the interval \([2,7]\text{.}\) We begin by defining the function:
> f(x) := -2*x^3 + 25*x^2 + 15;
\begin{equation*} \displaystyle f\, := \,x\mapsto -2\,{x}^{3}+25\,{x}^{2}+15 \end{equation*}
Once the function is defined, we can calculate the average rate of change over an interval \([a,b]\) by using the formula
\begin{equation*} \frac{f(b)-f(a)}{b-a}\text{.} \end{equation*}
In this case, we let \(a=2\) and \(b=7\text{:}\)
> (f(7) - f(2))/(7 - 2);
\begin{equation*} \displaystyle 91 \end{equation*}
The average rate of change over the interval \([2,7]\) is \(91\text{.}\) The units of this rate would be given in (units of \(y\))/(units of \(x\)).

Example 9.2. Plotting Transformations of Functions.

Suppose that we start with a sinusoidal function \(g(x)\) with amplitude \(2\) and period \(2\text{.}\)
> g(x) := 2*sin(Pi*x); plot( g(x), x=0..4, y=-4..4 );
\begin{equation*} \displaystyle g\, := \,x\mapsto 2 \sin \left(\pi x \right) \end{equation*}
We can then plot the original function \(g(x)\) and and the transformation \(\frac{1}{2}g(x)\) on the same axes to see that the amplitude has been halved.
> plot( [g(x), 0.5*g(x)], x=0..4, y=-4..4);
We can also see how an absolute value transformation of \(g(x)\) compares to the original function. The result here is known as a fully rectified sine wave.
> plot( [ g(x), abs(g(x)) ], x=0..4, y=-4..4);