Error: division by zero

In mathematics, division by zero is not allowed. In Maple, an attempt to divide by zero produces this error.

> sin(0)/0;

Error, division by zero

In some cases when a division by zero results from evaluating some expression at a certain value of a variable [Maple Math] , what is really wanted instead is the limit of the expression as [Maple Math] approaches this value. This may be obtained by using limit .

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

[Maple Math]

Sometimes a division by zero can result when Maple fails to recognize early enough that some quantity is 0.

> series(p/((1-sin(x-p)^2 - cos(x+p)^2)), p = 0,3);

[Maple Math]
[Maple Math]

> simplify(%);

Error, (in simplify/trig) division by zero

When this occurs in series and related commands, you may be able to fix the problem by changing the environment variable Testzero, whose value is the procedure used in series to determine when the leading coefficient is 0. By default this just uses normal .

> eval(Testzero);

[Maple Math]

> eval(normal);

[Maple Math]

You can replace normal by simplify to get a stronger test.

> Testzero:= proc(O) evalb(simplify(O)=0) end:

Since series has the remember option, if you try the same series command again it will just remember the value it computed before. To get it to try again, you can make it forget the past values.

> readlib(forget)(series);

> series(p/((1-sin(x-p)^2 - cos(x+p)^2)), p = 0,3);

[Maple Math]

See also: limit , series , Testzero , normal , simplify , forget

Maple Advisor Database R. Israel, 1997