JHR's MA113 Maple review notes page
You should enter the example commands into a Maple worksheet and note the resulting output.
All Maple command must end in a semi-colon. For example:
2 + 2;
When you see the command Warning, premature end of input, it usually means that a semi-colon is missing.
To get a floating point evaluation of a number, use the command evalf:
evalf(sqrt(2));
evalf(Pi,100);
To substitute for an expression, use the subs command:
subs( x=7, x^2);
To solve a system of equations such as
x + y = 10, 2x - y = 3,
use Maple's solve command:
solve( {x+y=10, 2*x-y=3},{x,y});
To plot a function, use Maple's plot command:
plot( x^2, x=-3..3);
If an equation does not have a nice algebraic solution, the fsolve command can be used to get an approximate solution. If possible, it's helpful to plot the function and get an estimate of the solution:
plot( x-cos(x), x=-Pi..Pi);
fsolve( x=cos(x), x=.8);
To differentiate a function, use the diff command:
diff( sin(x), x);
diff( exp(3*x),x);
To implicitly differentiate using the diff command, you must write the dependent variable explicitly as a function of the independent variable.
For example, to implicitly find dy/dx when
cos(x2) + sin( y2) = 1,
we implicitly differentiate and solve for dy/dx:
eq:=diff( cos(x^2)+sin(y(x)^2)=1,x);
solve( eq, diff(y(x),x));
To integrate using Maple, use the int command.
If the integral is a definite integral, include the limits as shown:
int( sqrt(1-x^2), x=0..1);
When Maple evaluates an indefinite integral, it does not include the constant of integration, giving only one example of an antiderivative rather than the entire set of antiderivatives:
int( cos(x),x);
If the integral cannot be evaluated, or evaluates to a messy expression, a floating point evaluation using the unevaluated integral command Int can be useful:
int( exp(x^4),x);
Int( exp(x^4),x);
evalf( Int(exp(x^4),x);
Go to