- Introduction
- Entering an expression
- Entering a function
- Evaluating functions and expressions
- Plotting
- Solving Equations
- Exercises

> j := x^3+3*x^2-x+1;

> f := x-> x^3+3*x^2-x+1;Below is how

> f(x) := x^3+3*x^2-x+1;The difference between expressions and functions are first the obvious, that expressions do not have to satisfy the definition of a function in the sense that for each input , there is a unique value . A function may be defined as an expression, but not all expressions can be defined as functions. The differences in Maple are numerous as you will see below when we evaluate the expression or function for a given value as well as when using the

> subs(x=2,j); > eval(j,x=2); > r:=sin(theta) + 8*theta^2; > subs(theta=1/2*Pi,r);In the

>g:=2*x/3; >subs(x=4,g); >eval(g,x=1/2); >subs(x=4.0,g);In Maple, functions are much easier to evaluate than expressions. In order to evaluate the function at , simply type

> f(2);Here are a few more examples of evaluating functions.

> f(a+h); > f(Pi); > evalf(f(Pi));Note the use of the

> evalf(Pi,10);

> plot(f(x),x=-5..2); > plot(r,theta=-2*Pi..2*Pi);The

> plot(x^2,x=-2..2,y=-5..5,title="My First Plot");This particular command allows you to add arguments, but if you were to leave off one of the essential arguments, you will get an error message. You can also plot more than one function or expression on the same graph by enclosing them in square brackets [ ] and separating them by commas. For example, we can plot and on the same graph.

> f := x-> x^2-2; > g := x-> -x+2; > plot([f(x),g(x)],x=-4..4,color=["DarkOrchid","Gold"]); >?plot,colornames

> a:=solve(f(x)=g(x),x); > f(a[1]); > f(a[2]); > b:=fsolve(f(x)=g(x),x=-5..0); > c:=fsolve(f(x)=g(x),x=0..5); > f(a); > f(b);

- Enter
as an expression.
- A)
- Evaluate this expression at .
- B)
- Evaluate this expression at .
- C)
- Evaluate this expression at .
- D)
- Evaluate this expression at and make sure your output is in decimal form.
- E)
- Plot this expression over the range .

- Repeat all parts of exercise 1 by first defining as a function.
- Define and as functions. Plot them both on the same graph. Find the intersection points by using Maple's
`solve`command and label the output with a variable. Use the variable to find the values. State intersection points in a sentence in text format of Maple. - Define and
as functions. Plot them both on the same graph. Find the intersection points by using Maple's
`fsolve`command and label the output with a variable. Use the variable to find the values. State intersection points in a sentence in text format of Maple.

2017-08-28