Repository: sympy/sympy

Issue:
Error on limits regarding terms like (1+u)^v.
I was trying to use SymPy to calculate $\lim_{x\to\infty}\frac{e^x}{(1+1/x)^{x^2}}$, which should equal $e^{-1/2}$. However SymPy code `limit(exp(x)/((1+1/x)**(x**2)),x,+oo)` shows the result $1$.

Now after some close look, I discovered that it's probably due to gruntz algorithm in SymPy incorrectly simplifies terms that look like $(1+u(x))^v(x)$, where $u(x)\to 0$. The doubted code is in `sympy/series/gruntz.py` and is pasted as follows:
```
    elif e.is_Pow and e.base != S.Exp1:
        e1 = S.One
        while e.is_Pow:
            b1 = e.base
            e1 *= e.exp
            e = b1
        if b1 == 1:
            return SubsSet(), b1
        if e1.has(x):
            base_lim = limitinf(b1, x)
            if base_lim is S.One:
                return mrv(exp(e1 * (b1 - 1)), x)
            return mrv(exp(e1 * log(b1)), x)
        else:
            s, expr = mrv(b1, x)
            return s, expr**e1
```
It may be a fix to remove the `return mrv(exp(e1 * (b1 - 1)), x)` part because such assumption is not necessarily correct, but it requires more investigations about whether this will trigger efficiency or other (about not being stuck in an infinite loop) problems.

Discussion:

Patch:
diff --git a/.mailmap b/.mailmap
index 1d7fa296b7..facfbd7520 100644
--- a/.mailmap
+++ b/.mailmap
@@ -342,6 +342,7 @@ Arie Bovenberg <a.c.bovenberg@gmail.com>
 Arif Ahmed <arif.ahmed.5.10.1995@gmail.com>
 Arighna Chakrabarty <arighna.chakrabarty100@gmail.com>
 Arihant Parsoya <parsoyaarihant@gmail.com>
+Arnab Nandi <arnabnandi2002@gmail.com>
 Arpan Chattopadhyay <f20180319@pilani.bits-pilani.ac.in> Arpan612 <f20180319@pilani.bits-pilani.ac.in>
 Arpit Goyal <agmps18@gmail.com>
 Arshdeep Singh <singh.arshdeep1999@gmail.com>
@@ -370,7 +371,8 @@ Ayush Malik <ayushmalik779@gmail.com> Ayush-Malik <ayushmalik779@gmail.com>
 Ayush Shridhar <ayush.shridhar1999@gmail.com>
 Ayushman Koul <ayushmankoul4570@gmail.com>
 B McG <bmcg0890@gmail.com>
-Baiyuan Qiu <1061688677@qq.com> Baiyuan Qiu <51898470+bugmaker2@users.noreply.github.com>
+Baiyuan Qiu <1061688677@qq.com> <qby1061688677@gmail.com>
+Baiyuan Qiu <51898470+bugmaker2@users.noreply.github.com>
 Bao Chau <chauquocbao0907@gmail.com>
 Barry Wardell <barry.wardell@gmail.com>
 Barun Parruck <barun.parruck@gmail.com>
@@ -1389,7 +1391,8 @@ Thomas Sidoti <TSidoti@gmail.com>
 Thomas Wiecki <thomas.wiecki@gmail.com> <thomas.wieki@gmail.com>
 Thomas Wiecki <thomas.wiecki@gmail.com> <whyking@Lateralus.(none)>
 Tiffany Zhu <bubble.wubble.303@gmail.com>
-Tilo Reneau-Cardoso <tiloreneau@gmail.com> Tilo Reneau-Cardoso <67246777+TiloRC@users.noreply.github.com>
+Tilo Reneau-Cardoso <67246777+TiloRC@users.noreply.github.com>
+Tilo Reneau-Cardoso <tiloreneau@gmail.com>
 Tim Gates <tim.gates@iress.com>
 Tim Lahey <tim.lahey@gmail.com>
 Tim Swast <tswast@gmail.com>
@@ -1602,7 +1605,8 @@ wuyudi <wuyudi119@163.com>
 ylemkimon <ylemkimon@naver.com> <mail@ylem.kim>
 znxftw <vishnu2101@gmail.com>
 zsc347 <zsc347@gmail.com>
-zzc <1378113190@qq.com> zzc <58017008+zzc0430@users.noreply.github.com>
+zzc <1378113190@qq.com>
+zzc <58017008+zzc0430@users.noreply.github.com>
 zzj <29055749+zjzh@users.noreply.github.com>
 Óscar Nájera <najera.oscar@gmail.com>
 Øyvind Jensen <jensen.oyvind@gmail.com>
diff --git a/AUTHORS b/AUTHORS
index e97a85cb0f..a7a043971e 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -4,7 +4,7 @@ those who explicitly didn't want to be mentioned. People with a * next
 to their names are not found in the metadata of the git history. This
 file is generated automatically by running `./bin/authors_update.py`.
 
-There are a total of 1261 authors.
+There are a total of 1202 authors.
 
 Ondřej Čertík <ondrej@certik.cz>
 Fabian Pedregosa <fabian@fseoane.net>
@@ -1207,63 +1207,4 @@ Zoufiné Lauer-Baré <raszoufine@gmail.com>
 Charles Harris <erdos4d@gmail.com>
 Tejaswini Sanapathi <sastejaswini2002@gmail.com>
 Devansh <be19b002@smail.iitm.ac.in>
-Aaron Gokaslan <aaronGokaslan@gmail.com>
-Daan Koning (he/him) <daanolivierkoning@gmail.com>
-Steven Burns <royalstream@hotmail.com>
-Jay Patankar <patankarjays@gmail.com>
-Vivek Soni <sonisheela1977@gmail.com>
-Le Cong Minh Hieu <hieu.lecongminh@gmail.com>
-Sam Ritchie <sam@mentat.org>
-Maciej Skórski <maciej.skorski@gmail.com>
-Tilo Reneau-Cardoso <tiloreneau@gmail.com>
-Laurence Warne <laurencewarne@gmail.com>
-Lukas Molleman <Lukas.Molleman@gmail.com>
-Konstantinos Riganas <kostasriganas24@gmail.com>
-Grace Su <grace.duansu@gmail.com>
-Pedro Rosa <pedro_sxbr@usp.br>
-Abhinav Cillanki <abhinavcillanki@kgpian.iitkgp.ac.in>
-Baiyuan Qiu <1061688677@qq.com>
-Liwei Cai <cai.lw123@gmail.com>
-Daniel Weindl <daniel.weindl@helmholtz-muenchen.de>
-Isidora Araya <iarayaday@gmail.com>
-Seb Tiburzio <sebtiburzio@gmail.com>
-Victory Omole <vtomole2@gmail.com>
-Abhishek Chaudhary <ac5003@columbia.edu>
-Alexander Zhura <nice.zhura@list.ru>
-Shuai Zhou <shuaivzhou@berkeley.edu>
-Martin Manns <mmanns@gmx.net>
-John Möller <john.moller@outlook.com>
-zzc <1378113190@qq.com>
-Pablo Galindo Salgado <pablogsal@gmail.com>
-Johannes Kasimir <johannes.kasimir@math.lu.se>
-Theodore Dias <theodore.dias@hotmail.co.uk>
-Kaustubh <90597818+kaustubh-765@users.noreply.github.com>
-Idan Pazi <idan.kp@gmail.com>
-Bobby Palmer <bobbyp@umich.edu>
-Saikat Das <saikatdchhe@gmail.com>
-Suman mondal <smondal.qwerty@gmail.com>
-Taylan Sahin <info@taylansahin.net>
-Fabio Luporini <fabio@devitocodes.com>
-Oriel Malihi <orielmalihi1@gmail.com>
-Geetika Vadali <geetika.vadali4@gmail.com>
-Matthias Rettl <matthias.rettl@stud.unileoben.ac.at>
-Mikhail Remnev <maremnev@gmail.com>
-philwillnyc <56197213+philwillnyc@users.noreply.github.com>
-Raphael Lehner <raphael.lehner@gmail.com>
-Harry Mountain <harrymountain1@icloud.com>
-Bhavik Sachdev <b.sachdev1904@gmail.com>
-袁野 (Yuan Ye) <yuanyelele@tutanota.com>
-fazledyn-or <ataf@openrefactory.com>
-mohammedouahman <simofun85@gmail.com>
-K. Kraus <laqueray@googlemail.com>
-Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>
-platypus <platypus.computerchip@gmail.com>
-codecruisader <nnisarg55@gmail.com>
-James Whitehead <whiteheadj@gmail.com>
-atharvParlikar <atharvparlikar@gmail.com>
-Ivan Petukhov <satels@gmail.com>
-Augusto Borges <borges.augustoar@gmail.com>
-Han Wei Ang <ang.h.w@u.nus.edu>
-Pablo <48098178+PabloRuizCuevas@users.noreply.github.com>
-Congxu Yang <u7189828@anu.edu.au>
-Saicharan <62512681+saicharan2804@users.noreply.github.com>
+Aaron Gokaslan <aaronGokaslan@gmail.com>
\ No newline at end of file
diff --git a/sympy/algebras/quaternion.py b/sympy/algebras/quaternion.py
index e5a8ee2d90..b4d1c9b45f 100644
--- a/sympy/algebras/quaternion.py
+++ b/sympy/algebras/quaternion.py
@@ -383,9 +383,9 @@ def from_euler(cls, angles, seq):
             The Euler angles (in radians).
         seq : string of length 3
             Represents the sequence of rotations.
-            For extrinsic rotations, seq must be all lowercase and its elements
+            For intrinsic rotations, seq must be all lowercase and its elements
             must be from the set ``{'x', 'y', 'z'}``
-            For intrinsic rotations, seq must be all uppercase and its elements
+            For extrinsic rotations, seq must be all uppercase and its elements
             must be from the set ``{'X', 'Y', 'Z'}``
 
         Returns
@@ -448,9 +448,9 @@ def to_euler(self, seq, angle_addition=True, avoid_square_root=False):
 
         seq : string of length 3
             Represents the sequence of rotations.
-            For extrinsic rotations, seq must be all lowercase and its elements
+            For intrinsic rotations, seq must be all lowercase and its elements
             must be from the set ``{'x', 'y', 'z'}``
-            For intrinsic rotations, seq must be all uppercase and its elements
+            For extrinsic rotations, seq must be all uppercase and its elements
             must be from the set ``{'X', 'Y', 'Z'}``
 
         angle_addition : bool
diff --git a/sympy/series/gruntz.py b/sympy/series/gruntz.py
index 7f86f44363..3743f1e7e6 100644
--- a/sympy/series/gruntz.py
+++ b/sympy/series/gruntz.py
@@ -276,7 +276,8 @@ def mrv(e, x):
             return SubsSet(), b1
         if e1.has(x):
             base_lim = limitinf(b1, x)
-            if base_lim is S.One:
+            exp_lim = limitinf(e1, x)
+            if base_lim is S.One and exp_lim is S.Infinity:
                 return mrv(exp(e1 * (b1 - 1)), x)
             return mrv(exp(e1 * log(b1)), x)
         else:
diff --git a/sympy/utilities/mathml/data/simple_mmlctop.xsl b/sympy/utilities/mathml/data/simple_mmlctop.xsl
index 0cd73bccc2..3b0faf2e6e 100644
--- a/sympy/utilities/mathml/data/simple_mmlctop.xsl
+++ b/sympy/utilities/mathml/data/simple_mmlctop.xsl
@@ -261,7 +261,7 @@ CONSTANT and SYMBOL ELEMENTS
     </xsl:when>
     <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
       <xsl:choose>
-        <xsl:when test="self::semantics">
+        <xsl:when test="self::sematics">
           <xsl:copy>
             <xsl:copy-of select="@*"/>
             <xsl:attribute name="xref">


Test patch:
diff --git a/sympy/series/tests/test_gruntz.py b/sympy/series/tests/test_gruntz.py
index afb63b5977..b6d2910f0d 100644
--- a/sympy/series/tests/test_gruntz.py
+++ b/sympy/series/tests/test_gruntz.py
@@ -474,3 +474,6 @@ def test_issue_6682():
 def test_issue_7096():
     from sympy.functions import sign
     assert gruntz(x**-pi, x, 0, dir='-') == oo*sign((-1)**(-pi))
+
+def test_issue_24210():
+    assert gruntz(exp(x)/((1+1/x)**(x**2)),x,+oo) == sqrt(E)