**Welcome to the Rutgers Maple Help Pages!**

arithmetic | algebra | calculus | graphing
In this Section: |

5

1

6

2

9

9

> %+7;

16

The percent sign (%) tells maple to use the previous answer in the current computation.

13

> 2*(3+7);

20

You can combine many operations at once, using parentheses as necessary.

4

> expand(%);

> evalf(sqrt(2));

1.414213562

Maple prefers to leave answer in "exact" form unless you tell it to do something different. expand(); is one way of telling Maple to change its output. evalf(); tells maple to give a decimal answer instead of an "exact" one.

[back to the top | arithmetic | algebra | calculus | graphing]

> expand(%);

x=2

> x

x

> x:=2;

x:=2

> x;

2

> x^3;

8

To assign a value to a variable, make sure to use colon-equals instead of just an equals sign. To Maple, "x=2" is an equation, while "x:=2" actually assigns the value 2 to the variable

The unassign command unassigns just one variable at a time. Make sure to use the single quotation mark that's on the same key as the double quotation mark.

> restart;

The restart; command unassigns all variables at once. It makes Maple behave as if you have just opened a new Maple session.

> expand(sumsqrts^3);

Maple can do symbolic manipulation quite well. You can give names to expressions (like sumsqrts above) using colon-equals.

Maple can factor algebraic expressions with the factor command. If you want to factor an integer, use ifactor(); instead.

> factor(y^4-16,I);

> factor(x^7-42*x+19,complex);

If you want to factor an expression that has imaginary or complex roots, use factor(expression, I); or factor(expression, complex); respectively.

> subs(a=t, 5*a^3+3*t+a+2*sqrt(a));

substitutes t for a in the above expression.

> subs({a=t,b=t^2,c=t^3}, a*b^2*c^3);

substitutes t for a, t^2 for b, and t^3 for c in the above expression.

> solve(x^3=7*x+1,x);

solves x^3=7*x+1 for x.

> solve({a*b+3=2,a+b=0});

solves the two equation system given above.

> solve({a*b+3=2, a+b=1});

solves the two equation system above. What's different this time?

> solve(x^7-x^2+1);

since the input was an expression instead of an equation, this command solves x^7-x^2+1=0.

> fsolve(x^7-x^2+1);

-0.8398331470

when you want a decimal answer, use fsolve.

[back to the top | arithmetic | algebra | calculus | graphing]

> limit(x^2,x=2);

4

computes the limit of x^2 as x goes to 2.

Maple even knows when limits are undefined.

> limit(abs(x)/x,x=0);

Maple can compute limits from the left and from the right as follows:

> limit(abs(x)/x,x=0,left);

-1

> limit(abs(x)/x,x=0,right);

1

> diff(3*x^7-22.1*x^2,x);

Sometimes it is useful to save the function to a variable, and then work from there:

> Q:=sin(x^2*sqrt(x+1));

> diff(Q,x);

Taking multiple derivatives is similar. To compute the 2nd derivative of Q try:

> diff(Q,x,x);

To save space, you can also compute higher derivatives by using the $ operator. For example,

> diff(Q,x$10);

computes the 10th derivative of Q.

> int(x*sqrt(x+2),x);

Again, it may be useful to give your function a name, and work with it from there:

> V:=exp(sin(x));

> int(V,w);

> int(V,x);

Do you understand why we got two different answers here? What's going on in each of these two commands?

> int(x^3,x=1/7..b);

You can evaluate definite integrals by including bounds as above. Make sure there are exactly 2 periods between the bounds.

To define a function, use colon-equals, followed by x->function as below.

> N:=x->arctan(x^3);

Now, N is a function that can take input and give output. Try the following:

> N(2);

> N(5*z);

You can also manipulate this function.

> diff(N(x),x);

> M:=D(N);

> int(N(x),x);

> int(N,x);

What is the difference between the previous two lines? When N is a function, note the difference between using N and N(x).

When you have a function, an alternate way of computing derivatives is:

> D(N);

[back to the top | arithmetic | algebra | calculus | graphing]

> plot(x^3-6*x+1,x);

plots a graph of y=x^3-6*x+1.

You can choose the domain of your graph in the following way:

> plot(sin(100/x),x=.1..1);

You can also plot more than one graph at a time:

> plot({x^2,x^3}, x=4..5);

As before, it could be useful to give your function a name, and work with it from there:

> P:=w->exp(w)/(1+w^2);

> plot({P(t),D(P)(t)},t=-2..5);

The plots package contains many other useful graphing tools. For example, implicitplot will graph an equation that is not solved for y:

> with(plots):

> implicitplot(x^3-5*x*y^2=7,x=-5..5,y=-5..5);

[back to the top | arithmetic | algebra | calculus | graphing]

**
Maintained by Last modified 9/5/2006. Address questions to the
Undergraduate Office of the Department of Mathematics.
**