t> CALCULUS EXAMPLES
b>
t> This section gives a brief overview of Maple's facilities for calculus
t> computations. Calculus is a wide field, and Maple has commands that
t> cover many of the possibilities.
b>
c1>
t> Differentiation
b>
t> The diff command provides differentiation of an expression with respect
t> to a certain variable. The first parameter is an expression (or
t> function) and the second parameter is the variable of differentiation.
t> At least one variable of differentiation must be supplied - subsequent
t> parameters are understood as further variables for higher-order
t> differentiation. If the expression being differentiated contains more
t> than one unknown, partial differentiation is performed by simply
t> supplying the appropriate variable(s) of differentiation.
b>
c1>
x> diff(x^2, x);
x> diff(x^3, x, x);
x> diff(x^3*y^2, y);
c1>
t> Because higher-order differentiation is possible, the $ operator can
t> be used to advantage within the diff command. The following are some
t> examples.
b>
c1>
x> diff(x^6/6!, x$6);
x> diff((s^3+2*s-5)/(t^2-3*t), s$2, t);
c1>
t> Limits
b>
t> Maple finds limits of expressions (or functions). The limit command takes
t> an expression as its first parameter, a variable name equated to a
t> limit point as its second parameter, and a direction as its optional
t> third parameter. If no direction is specified, then Maple calculates
t> the standard bi-directional limit. If no limit exists at the specified
t> point, Maple returns "undefined" as its answer. If Maple is unable to 
t> compute the limit (but it may yet exist), it returns an unevaluated form
t> of the limit call.
b>
c1>
x> limit(cos(x)/x, x=Pi/2);
x> limit((-x^2+x+1)/(x+4), x=infinity);
x> limit(tan(x), x=Pi/2);
c1>
t> In many cases, an expression that does not have a bi-directional limit
t> at a certain point may have a directional limit at that point. By
t> supplying the limit command with a third parameter of either "left" or
t> "right", these directional limits can be computed.
b>
c1>
x> limit(tan(x), x=Pi/2, left);
x> limit(tan(x), x=Pi/2, right);
t> As well, limit accepts either "complex" or "real" as a third parameter,
t> allowing limits to be computed in either the complex or real planes.
t> For more information on these options, consult your Maple manuals.
b>
c1>
t> Integration
b>
t> Maple performs both definite and indefinite integration with the int
t> command. First, let's take a look at indefinite integration, where the
t> int command takes two parameters, an expression and a variable of
t> integration.  The answer (if found) is returned without the standard
t> "constant of integration" to make it easier to reuse the result in
t> further computations.  Like the limit command, if int cannot perform
t> the integration it returns with an unevaluated int call.
b>
t> The following are some examples of indefinite integration with Maple.
b>
c1>
x> int(2*x*exp(x^2), x);
x> int(sin(y)*cos(y), y);
x> int(1/(exp(x^2)+x), x);
c1>
t> To specify definite integration, simply add a range of integration to
t> the second parameter of the int command.
b>
c1>
x> int(1/x, x=2..4);
x> int((1-x^2)^(1/2), x=0..1);
x> int(1/(1+x^2), x=0..infinity);
c1>
t> As well, with definite integration, a "continuous" option can be added
t> as a third parameter, forcing Maple to ignore any possible
t> discontinuities on the range of integration.
b>
t> Unlike the diff command, you do not specify multiple integration by
t> simply adding extra variables of integration at the end of the int
t> command. To perform multiple integration, enclose int commands within
t> other int commands. This method is not always guaranteed to work, though.
b>
c1>
x> int(int(x^2*y^3, x), y);
x> int(int(int(x^2*y^2*z^2, x=1..2), y=1..2), z=1..2);
c1>
t> Summation
b>
t> Finite and infinite sums are found with Maple's sum command. The
t> parameters, as with other calculus commands, are an expression and a
t> variable and range of summation. With finite sums, the range of
t> summation may contain either numerical or symbolic values. A few
t> examples follow.
b>
c1>
x> sum('i^2', 'i'=1..100);
x> sum('i^2', 'i'=1..n);
x> sum('2^i/2*i', 'i'=a..b);
t> Remember that the forward quotes ensure that the indices of summation
t> get evaluated in the correct order.
b>
c1>
t> Infinite sums are found by simply specifying an infinite range for the
t> variable of summation.
b>
x> sum('1/i^2', 'i'=1..infinity);
c1>
t> Numerical Evaluation
b>
t> If Maple is unable to find a closed form for any integration, limit, or
t> summation, you can always try to find a numerical approximation to the
t> result with the evalf command. Again, an example is worth a thousand
t> words.
b>
c1>
x> int(1/(exp(x^2)+x), x=0..1);
x> evalf(int(1/(exp(x^2)+x), x=0..1));
t> Questions
b>
c2>
q> Use the sum command to find the infinite sum of 1/i^4 from 1 to infinity.
a> sum('1/i^4','i'=1..infinity);
h> i := `i`;
c2>
q> Using the evalb, int, and diff commands, show that 5! times the integral of
q> x^3 with respect to x, is equal to 3! times the derivative of x^5 with 
q> respect to x.
a> evalb(5!*int(x^3, x) = 3!*diff(x^5, x));
eoq>
eof>
