TransWikia.com

Mathematica and its default assumptions

Mathematica Asked on February 6, 2021

I am a bit surprised that evsluating

Integrate[Exp[I n x],{x, 0, Pi}]

gives

$qquad frac{-i(e^{inpi}-1)}{n}$.

What if $n = 0$? I didn’t assume anything about $n$ and yet Mathematica assumes $nneq 0$.

It is the same with the Maxima command :

integrate(exp(%i*n*x),x,0,%pi);

and the Maple command

int(exp(n*x*I), x = 0 .. PI)

How do I handle this kind of behavior which I consider undesirable?

What is the name of this feature in symbolic computation, so that I can find a solution for Maxima as well.

One Answer

$n = 0$ is a removable singularity. If you take the limit of the result of the integral, you will get the same as if you put $n = 0$ before taking the integral:

result = Integrate[Exp[I n x], {x, 0, Pi}]

Limit[result, n -> 0]
(* Pi *)

Integrate[Exp[I 0 x], {x, 0, Pi}]
(* Pi *)

Addendum

Re @cvgmt on Integrate[x^a, x] for a = -1: that also is a removable singularity (provided the constant of integration is chosen correctly). We have $$ int_1^x u^a ,mathrm{d}u = frac{x^{a+1} - 1}{a+1}, $$ and $$ lim_{a to -1} frac{x^{a+1} - 1}{a+1} = log x. $$

In general Mathematica does not bother with treating removable singularities separately. For example, x/x will simplify to 1 without any assumptions on x.

Answered by yawnoc on February 6, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP