︠cf7e38d2-799a-40aa-8472-d7bdb4332c24s︠ ((2^(2*x+1)+(2^x*x^100)^(3/2))/(4^x-100*2^x)).limit(x=infinity) ︡7a0c1d7a-e03f-45b6-a7b5-e3fd595bfe9e︡{"stdout":"-Infinity"}︡{"stdout":"\n"}︡{"done":true}︡ ︠c5c5f5ec-73fa-4b6d-9c5c-50e4ad51fd53s︠ ((2^(2*x+1)+(2^x*x^100)^(3/2))/(4^x-100*2^x)).limit(x=infinity, algorithm="sympy") ︡99ff1d8f-a5ab-45e9-8a98-c3bbba9d6829︡{"stdout":"2\n"}︡{"done":true}︡ ︠ac62a0eb-4158-4aea-a017-c4f6f34a50c3s︠ ((2^(2*x+1)+(2^x*x^100)^(3/2))/(4^x-100*2^x)).limit(x=infinity, algorithm="maxima_taylor") ︡73bdbc90-eca3-4221-9706-68f070a65c21︡{"stdout":"-Infinity\n"}︡{"done":true}︡ ︠9a441de7-929c-4e73-b480-23f00da1dbb1s︠ ((2^(2*x+1)+(2^x*x^100)^(3/2))/(4^x-100*2^x)).limit(x=infinity, algorithm="maxima") ︡4b29250c-0b03-4b89-8d90-943bd352f066︡{"stdout":"-Infinity"}︡{"stdout":"\n"}︡{"done":true}︡ ︠c0fd2877-d022-4a7e-8c0f-6a15068c3d97s︠ f(x) = ((2^(2*x+1)+(2^x*x^100)^(3/2))/(4^x-100*2^x)) ︡ff647d70-7830-4549-bade-b40c901af848︡{"done":true}︡ ︠80e5094b-8bd9-4bd0-bc44-c281e3c1da78ss︠ f.limit(x=+infinity) ︡571e2a92-1e52-4af1-be85-1c739e8864b1︡{"stdout":"x |--> -Infinity"}︡{"stdout":"\n"}︡{"done":true}︡ ︠3ff23328-23ad-4aa9-8433-e6696d0a239as︠ plot(f, 0, 100) ︡990833f9-98d0-48c2-a4cc-142a921a133b︡ ︠a5e72097-d8d8-4466-8c69-9eeccd307c0as︠ N(f(100000)) ︡ac52c47c-6d4f-428f-87ce-d00a3abc7c22︡{"stdout":"2.00000000000000\n"}︡{"done":true}︡ ︠fd34b6b6-740a-40b8-be70-386d353a6ef0︠ f._sympy_().limit(x._sympy_(), oo._sympy_()) ︡008ab392-b748-45c2-ac35-75521490d64d︡{"stdout":"2"}︡{"stdout":"\n"}︡{"done":true}︡ ︠25971d74-9465-441e-95fc-6e3f54135085s︠ f.limit?? ︡7319e611-1705-4b65-9bcc-0fa8f992aa3a︡{"code":{"filename":null,"lineno":-1,"mode":"python","source":" File: /projects/sage/sage-7.3/src/sage/symbolic/expression.pyx\n Source:\n def limit(self, *args, **kwds):\n \"\"\"\n Return a symbolic limit. See\n :obj:`sage.calculus.calculus.limit`\n\n EXAMPLES::\n\n sage: (sin(x)/x).limit(x=0)\n 1\n \"\"\"\n from sage.calculus.calculus import limit\n return limit(self, *args, **kwds)\n"}}︡{"done":true}︡ ︠d39ccc45-cbea-46d7-a8c7-43f19fdbe3a0s︠ sage.calculus.calculus.limit?? ︡c0420dae-1155-402f-b7a3-57d620bf1cc3︡{"code":{"filename":null,"lineno":-1,"mode":"python","source":" File: /projects/sage/sage-7.3/local/lib/python2.7/site-packages/sage/calculus/calculus.py\n Source:\n def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):\n r\"\"\"\n Return the limit as the variable `v` approaches `a`\n from the given direction.\n\n ::\n\n expr.limit(x = a)\n expr.limit(x = a, dir='+')\n\n INPUT:\n\n - ``dir`` - (default: None); dir may have the value\n 'plus' (or '+' or 'right') for a limit from above,\n 'minus' (or '-' or 'left') for a limit from below, or may be omitted\n (implying a two-sided limit is to be computed).\n\n - ``taylor`` - (default: False); if True, use Taylor\n series, which allows more limits to be computed (but may also\n crash in some obscure cases due to bugs in Maxima).\n\n - ``**argv`` - 1 named parameter\n\n .. note::\n\n The output may also use 'und' (undefined), 'ind'\n (indefinite but bounded), and 'infinity' (complex\n infinity).\n\n EXAMPLES::\n\n sage: x = var('x')\n sage: f = (1+1/x)^x\n sage: f.limit(x = oo)\n e\n sage: f.limit(x = 5)\n 7776/3125\n sage: f.limit(x = 1.2)\n 2.06961575467...\n sage: f.limit(x = I, taylor=True)\n (-I + 1)^I\n sage: f(x=1.2)\n 2.0696157546720...\n sage: f(x=I)\n (-I + 1)^I\n sage: CDF(f(x=I))\n 2.0628722350809046 + 0.7450070621797239*I\n sage: CDF(f.limit(x = I))\n 2.0628722350809046 + 0.7450070621797239*I\n\n Notice that Maxima may ask for more information::\n\n sage: var('a')\n a\n sage: limit(x^a,x=0)\n Traceback (most recent call last):\n ...\n ValueError: Computation failed since Maxima requested additional\n constraints; using the 'assume' command before evaluation\n *may* help (example of legal syntax is 'assume(a>0)', see\n `assume?` for more details)\n Is a positive, negative or zero?\n\n With this example, Maxima is looking for a LOT of information::\n\n sage: assume(a>0)\n sage: limit(x^a,x=0)\n Traceback (most recent call last):\n ...\n ValueError: Computation failed since Maxima requested additional\n constraints; using the 'assume' command before evaluation *may* help\n (example of legal syntax is 'assume(a>0)', see `assume?` for\n more details)\n Is a an integer?\n sage: assume(a,'integer')\n sage: limit(x^a,x=0)\n Traceback (most recent call last):\n ...\n ValueError: Computation failed since Maxima requested additional\n constraints; using the 'assume' command before evaluation *may* help\n (example of legal syntax is 'assume(a>0)', see `assume?` for\n more details)\n Is a an even number?\n sage: assume(a,'even')\n sage: limit(x^a,x=0)\n 0\n sage: forget()\n\n More examples::\n\n sage: limit(x*log(x), x = 0, dir='+')\n 0\n sage: lim((x+1)^(1/x), x = 0)\n e\n sage: lim(e^x/x, x = oo)\n +Infinity\n sage: lim(e^x/x, x = -oo)\n 0\n sage: lim(-e^x/x, x = oo)\n -Infinity\n sage: lim((cos(x))/(x^2), x = 0)\n +Infinity\n sage: lim(sqrt(x^2+1) - x, x = oo)\n 0\n sage: lim(x^2/(sec(x)-1), x=0)\n 2\n sage: lim(cos(x)/(cos(x)-1), x=0)\n -Infinity\n sage: lim(x*sin(1/x), x=0)\n 0\n sage: limit(e^(-1/x), x=0, dir='right')\n 0\n sage: limit(e^(-1/x), x=0, dir='left')\n +Infinity\n\n ::\n\n sage: f = log(log(x))/log(x)\n sage: forget(); assume(x<-2); lim(f, x=0, taylor=True)\n 0\n sage: forget()\n\n Here ind means \"indefinite but bounded\"::\n\n sage: lim(sin(1/x), x = 0)\n ind\n\n TESTS::\n\n sage: lim(x^2, x=2, dir='nugget')\n Traceback (most recent call last):\n ...\n ValueError: dir must be one of None, 'plus', '+', 'right',\n 'minus', '-', 'left'\n\n We check that :trac:`3718` is fixed, so that\n Maxima gives correct limits for the floor function::\n\n sage: limit(floor(x), x=0, dir='-')\n -1\n sage: limit(floor(x), x=0, dir='+')\n 0\n sage: limit(floor(x), x=0)\n und\n\n Maxima gives the right answer here, too, showing\n that :trac:`4142` is fixed::\n\n sage: f = sqrt(1-x^2)\n sage: g = diff(f, x); g\n -x/sqrt(-x^2 + 1)\n sage: limit(g, x=1, dir='-')\n -Infinity\n\n ::\n\n sage: limit(1/x, x=0)\n Infinity\n sage: limit(1/x, x=0, dir='+')\n +Infinity\n sage: limit(1/x, x=0, dir='-')\n -Infinity\n\n Check that :trac:`8942` is fixed::\n\n sage: f(x) = (cos(pi/4-x) - tan(x)) / (1 - sin(pi/4+x))\n sage: limit(f(x), x = pi/4, dir='minus')\n +Infinity\n sage: limit(f(x), x = pi/4, dir='plus')\n -Infinity\n sage: limit(f(x), x = pi/4)\n Infinity\n\n Check that we give deprecation warnings for 'above' and 'below',\n :trac:`9200`::\n\n sage: limit(1/x, x=0, dir='above')\n doctest:...: DeprecationWarning: the keyword\n 'above' is deprecated. Please use 'right' or '+' instead.\n See http://trac.sagemath.org/9200 for details.\n +Infinity\n sage: limit(1/x, x=0, dir='below')\n doctest:...: DeprecationWarning: the keyword\n 'below' is deprecated. Please use 'left' or '-' instead.\n See http://trac.sagemath.org/9200 for details.\n -Infinity\n\n Check that :trac:`12708` is fixed::\n\n sage: limit(tanh(x),x=0)\n 0\n\n Check that :trac:`15386` is fixed::\n\n sage: n = var('n')\n sage: assume(n>0)\n sage: sequence = -(3*n^2 + 1)*(-1)^n/sqrt(n^5 + 8*n^3 + 8)\n sage: limit(sequence, n=infinity)\n 0\n \"\"\"\n if not isinstance(ex, Expression):\n ex = SR(ex)\n\n if len(argv) != 1:\n raise ValueError(\"call the limit function like this, e.g. limit(expr, x=2).\")\n else:\n k = argv.keys()[0]\n v = var(k)\n a = argv[k]\n\n if taylor and algorithm == 'maxima':\n algorithm = 'maxima_taylor'\n\n if dir not in [None, 'plus', '+', 'right', 'minus', '-', 'left',\n 'above', 'below']:\n raise ValueError(\"dir must be one of None, 'plus', '+', 'right', 'minus', '-', 'left'\")\n\n if algorithm == 'maxima':\n if dir is None:\n l = maxima.sr_limit(ex, v, a)\n elif dir in ['plus', '+', 'right', 'above']:\n if dir == 'above':\n from sage.misc.superseded import deprecation\n deprecation(9200, \"the keyword 'above' is deprecated. Please use 'right' or '+' instead.\")\n l = maxima.sr_limit(ex, v, a, 'plus')\n elif dir in ['minus', '-', 'left', 'below']:\n if dir == 'below':\n from sage.misc.superseded import deprecation\n deprecation(9200, \"the keyword 'below' is deprecated. Please use 'left' or '-' instead.\")\n l = maxima.sr_limit(ex, v, a, 'minus')\n elif algorithm == 'maxima_taylor':\n if dir is None:\n l = maxima.sr_tlimit(ex, v, a)\n elif dir == 'plus' or dir == 'above' or dir == 'from_right':\n l = maxima.sr_tlimit(ex, v, a, 'plus')\n elif dir == 'minus' or dir == 'below' or dir == 'from_left':\n l = maxima.sr_tlimit(ex, v, a, 'minus')\n elif algorithm == 'sympy':\n if dir is None:\n import sympy\n l = sympy.limit(ex._sympy_(), v._sympy_(), a._sympy_())\n else:\n raise NotImplementedError(\"sympy does not support one-sided limits\")\n\n #return l.sage()\n return ex.parent()(l)\n"}}︡{"done":true}︡ ︠f9cb0c4d-48fb-47c6-90d1-c8860016374d︠