[an error occurred while processing this directive] [an error occurred while processing this directive] newuser,topic06

(6) Calculus

Before examining this topic, please make sure that you have read: (1) Working Through the New User's Tour.

Maple provides many powerful tools for solving problems in single-variable and multi-variable calculus. You can use Maple to solve problems in the areas of differentiation, integration, limits, series expansions, summations, products, integral transforms (such as Laplace, Z, Mellin, or Fourier), and piecewise-defined functions. Maple's architecture allows you to solve problems numerically and symbolically.

Use the restart command to clear Maple's internal memory and get started with this page of the tour.

> restart;

Differentiation and Integration

Maple can symbolically display and compute derivatives and integrals.

For example, define the function proc (x) options operator, arrow; x*sin(a*x)+b*x^2 ... .

> f := x -> x*sin(a*x) + b*x^2;

f := proc (x) options operator, arrow; x*sin(a*x)+b...

Construct an expression for the derivative, diff(x*sin(a*x)+b*x^2,x) , and call the computed value f_prime .

> f_prime := diff( f(x), x);

f_prime := sin(a*x)+x*cos(a*x)*a+2*b*x

If you compute f_prime 's antiderivative , you get the original function. Verify this assumption by using the following commands:

> int(f_prime, x);

-cos(a*x)/a+(cos(a*x)+a*x*sin(a*x))/a+b*x^2

> simplify(%);

x*(sin(a*x)+b*x)

Definite Integration

You can use Maple to perform definite integration.

For example, compute the previous integral within the interval x =1 to x =2. This problem is represented symbolically as int({sin(a*x)+x*cos(a*x)*a+2*b*x},x = 1 .. 2) .

> int( f_prime, x=1..2 );

2*sin(2*a)+3*b-sin(a)

Elliptic Integrals

Maple can also compute elliptic integrals.

For example, int(1/sqrt(1+x^4),x = 0 .. 1) is evaluated in a normal form expression.

> int( 1/sqrt( 1 + x^4 ) , x=0..1 );

1/2*EllipticK(1/2*sqrt(2))

Use the evalf command to evaluate a floating-point approximation of the previous value.

> evalf(%);

.9270373385

Special Functions

In the previous integration examples, some of the results were displayed in terms of special mathematical functions and numbers. Maple supports hundreds of special functions and numbers encountered in many areas of mathematics, science, and engineering. Here are some of these:

Area and Volume

You can also calculate area and volume. Consider the curve y = 1/x .

If you rotate the curve around the x -axis, you obtain a surface. The area of this surface is infinite, which we find by multiplying the circumference by the arclength:

> area := int( 2*Pi/x*sqrt(1^2 + diff(1/x,x)^2), x=1..infinity );

area := infinity

The volume of the corresponding solid is int(Pi*(1/x)^2,x = 1 .. infinity) .

A famous irony in mathematics is that if you compute this integral, the volume turns out to be finite, even though the area is infinite.

> volume := int( Pi*(1/x)^2, x=1..infinity );

volume := Pi

Limits

Maple can compute the limits of functions approaching finite and infinite values. It can take the limits in both positive and negative directions, and compute limits involving absolute values. Maple also recognizes undefined limits.

Finite and Infinite Values

Maple can compute limits of functions approaching finite and infinite values, as shown in the following example.

> expr := (2*x+3)/(7*x+5);

expr := (2*x+3)/(7*x+5)

> limit( expr, x=infinity );

2/7

Positive and Negative Directions

You can also take the limit of an expression from both the positive and negative directions. Consider limit(tan(x+Pi/2),x = 0) .

> limit( tan(x+Pi/2), x=0, left );

infinity

> limit( tan(x+Pi/2), x=0, right );

-infinity

Since the left-hand limit and the right-hand limit are not equal, Limit(tan(x+Pi/2),x = 0) does not exist.

Absolute Values

Maple can compute limits involving absolute values. Consider limit(abs(x-4)/(x-4),x = 4,right) .

> limit( abs(x-4)/(x-4) , x=4, right );

1

Undefined Limits

Maple can easily recognize undefined limits, such as limit(sqrt(1-cos(x))/x*sqrt(2),x = 0) .

> limit( sqrt(1-cos(x)) / x*sqrt(2), x=0 );

undefined

Piecewise Functions

The Maple command piecewise allows you to express piecewise-continuous functions.

Example 1

You can define piecewise functions as follows.

> p := x -> piecewise( x<0, -1, x>1, 2*x, x^2 );

p := proc (x) options operator, arrow; piecewise(x ...

> p(x);

PIECEWISE([-1, x < 0],[2*x, 1 < x],[x^2, otherwise]...

The following expression calculates the derivative of p(x) .

> p_prime := diff( p(x), x );

p_prime := PIECEWISE([0, x < 0],[undefined, x = 0],...

Example 2

Consider another expression.

> expr := piecewise( x<=-1, -x, x<=1, x*x, x>1, sin(x-1)/(x-1) );

expr := PIECEWISE([-x, x <= -1],[x^2, x <= 1],[sin(...

Integrating the expression yields the following expression.

> anti := int( expr, x );

anti := PIECEWISE([-1/2*x^2, x <= -1],[1/3*x^3-1/6,...

Note : Si(x) is the Sine Integral function.

Series Expansions

Maple provides you with many ways to manipulate series approximations.

Consider the series approximation of the expression sin(4*x)*cos(x) .

> expr := sin(4*x)*cos(x):

> approx1 := series( expr, x=0 );

approx1 := series(4*x-38/3*x^3+421/30*x^5+O(x^6),x,...

You must convert the series approximation to a polynomial before you can plot it.

> poly1 := convert( approx1, polynom );

poly1 := 4*x-38/3*x^3+421/30*x^5

Now compare the original expression and the approximation on a graph.

> plot( {expr, poly1}, x=-1..1, y=-2..2, title =
cat( convert(expr, string)," vs. Series Approximation" ) );

[Maple Plot]

The environment variable Order represents the order of series calculations performed by Maple. Its default value is 6. You can increase this value by using the following command .

> Order := 12;

Order := 12

Now recompute the series approximation.

> approx2 := series( expr, x=0 );

approx2 := series(4*x-38/3*x^3+421/30*x^5-10039/126...

> poly2 := convert( approx2, polynom );

poly2 := 4*x-38/3*x^3+421/30*x^5-10039/1260*x^7+246...

> plot( {expr, poly2}, x=-1..1, y=-2..2, title =
cat( convert(expr, string)," vs. Series Approximation" ) );

[Maple Plot]

Click here to return to the Main Menu.

[an error occurred while processing this directive]