Ask Your Question
0

Feedback and Potential Improvement

asked 2022-05-25 00:28:04 +0100

It would be good if

limit(1/x, x = 0)

and

limit(tan(x), x = pi/2)

showed undefined as the answer, rather than infinity.

Sage simplifies

sinh(arcsinh(x))

to x and cannot do so for

arcsinh(sinh(x))

Sage can't simplify cosh(x) - (e^x + e^(-x))/2 to 0.

It is counterintuitive for mathematician users to understand log(x) as ln(x), rather than the common log of x.

edit retag flag offensive close merge delete

Comments

Regarding your last point, my impression has been that the meaning of "log" changes depending on the person's level of experience. Math faculty tend to think of "log" as the natural log, and math undergraduates tend to think of "log" as being the base 10 logarithm. There is a transition in the middle, probably different for different people.

John Palmieri gravatar imageJohn Palmieri ( 2022-05-26 02:36:19 +0100 )edit

Also, regarding the log function, the "general mathematician" may / would expect an implementation for $$ log_b x\ . $$ Sage implements the above expression as log(x, b), and b is here an optional argument. If given, it is taken. Else it defaults in sage to $e$. In school, there was of course an other convention, $\ln$ was already explicitly $log_e$. And $log$ without and lower index decoration was $log_{10}$. But here, we have some double face of the log-notation, too. After passing some level of mathematical usage, notations are chosen to give a best fit for a purpose. And in my whole university courses there was never the case i was needing the expression $log_{10}x$. I was always using $log_e x$. In papers, $log$ is $\ln$. Note also:

sage: ln
log
dan_fulea gravatar imagedan_fulea ( 2022-05-26 18:40:26 +0100 )edit

The logarithm arise in elementary (high-school) analysis as $\log{x}=\displaystyle{\int_1^x \frac{\mathrm{d}t}{t}}$. This (mathematically) "natural" definition gives the natural (a. k. a. "Neperian") logarithm.

The one-time predominance of the "decimal" logarithm in engineering textbooks came from the (then very important) practical convenience of taking decimal logarithm : one needed only ONE table giving the$\log_{10}{x}$ for $x\in]1\ 10[$, which was completed using the $\log_{10}$ of the magnitude (which is an integer).

The introduction of computers (and hand-held calculators) has deprived this historical convenience of any practical relevance ; $\log_{10}$ is now an historical engineering fetish, as much as men's neckties and ladies' garter belts are fashion's fetishes...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2022-05-26 22:00:15 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-05-26 00:20:53 +0100

dan_fulea gravatar image

Let us take as a comparison the results for some sample limits.

Sage shows for limit(sin(1/x), x=0) an indefinite (but bounded) result.

For limit(1/sin(1/x), x=0) we get indeed und.

For the given limit computation of $1/x$ for $x\to 0$ we may compare:

sage: limit(1/x, x=0)
Infinity
sage: limit(1/x, x=0, dir=None)    # default value for dir
Infinity
sage: limit(1/x, x=0, dir='+')
+Infinity
sage: limit(1/x, x=0, dir='-')
-Infinity
sage: limit(1/x, x=0, dir='-', algorithm='maxima')
-Infinity
sage: limit(1/x, x=0, dir='+', algorithm='maxima')
+Infinity
sage: limit(1/x, x=0, algorithm='maxima')
Infinity
sage: limit(1/x, x=0, algorithm='fricas')
und
sage: limit(1/x, x=0, dir='+', algorithm='fricas')
+Infinity
sage: limit(1/x, x=0, dir='-', algorithm='fricas')
-Infinity
sage: limit(1/x, x=0, algorithm='sympy')
+Infinity
sage: limit(1/x, x=0, dir='+', algorithm='sympy')
+Infinity
sage: limit(1/x, x=0, dir='-', algorithm='sympy')
-Infinity

The differences are minimal, but they are there. First of all, fricas delivers (through sage) the wanted value und. Then sage delivers three "differently printed" results, Infinity, +Infinity, and -Infinity for the direction respectively None (default), from the right (positive side), and from the left (negative side). For a closer look, let us compare:

sage: L  = limit(1/x, x=0)
sage: L1 = limit(1/x, x=0, dir='+')
sage: L2 = limit(1/x, x=0, dir='-')

sage: bool(L == L1)
False
sage: bool(L == L2)
False
sage: bool(L1 == L2)
False

sage: sign(L1)
1
sage: sign(L2)
-1
sage: sign(L)
sgn(Infinity)

sage: L == Infinity
Infinity == +Infinity
sage: bool(L == Infinity)
False

unsigned_infinity
sage: L == unsigned_infinity
Infinity == Infinity
sage: bool(L == unsigned_infinity)
True

sage: L.is_positive()
False
sage: L.is_positive_infinity()
False
sage: L.is_infinity()
True
sage: L1.is_positive()
True
sage: L1.is_positive_infinity()
True
sage: L1.is_infinity()
True
sage: L2.is_negative()
True
sage: L2.is_negative_infinity()
True

So we have three different "limits", L, L1, and L2.

For the second limit we have a similar situation:

sage: limit(tan(x), x = pi/2)
Infinity
sage: limit(tan(x), x = pi/2, dir='-')
+Infinity
sage: limit(tan(x), x = pi/2, dir='+')
-Infinity

For the simplification, we have for instance:

sage: arcsinh(sinh(0))
0
sage: arcsinh(sinh(2*pi*i))
0

So there is some reason for keeping things as they are. (One may assume $x$ to be real, and then the story begins, somebody has to implement this simplification.)

For the final simplification we maybe also need an implementer.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-05-25 00:28:04 +0100

Seen: 593 times

Last updated: May 26 '22