from sympy import (
    limit,
    Symbol,
    oo,
    sqrt,
    Rational,
    log,
    exp,
    cos,
    sin,
    tan,
    pi,
    asin,
    together,
    root,
    S,
)

# Numbers listed with the tests refer to problem numbers in the book
# "Anti-demidovich, problemas resueltos, Ed. URSS"

x = Symbol("x")


def test_leadterm():
    assert (3 + 2 * x ** (log(3) / log(2) - 1)).leadterm(x) == (3, 0)


def root3(x):
    return root(x, 3)


def root4(x):
    return root(x, 4)


def test_Limits_simple_0():
    assert limit((2 ** (x + 1) + 3 ** (x + 1)) / (2 ** x + 3 ** x), x, oo) == 3  # 175


def test_Limits_simple_1():
    assert limit((x + 1) * (x + 2) * (x + 3) / x ** 3, x, oo) == 1  # 172
    assert limit(sqrt(x + 1) - sqrt(x), x, oo) == 0  # 179
    assert (
        limit((2 * x - 3) * (3 * x + 5) * (4 * x - 6) / (3 * x ** 3 + x - 1), x, oo)
        == 8
    )  # Primjer 1
    assert limit(x / root3(x ** 3 + 10), x, oo) == 1  # Primjer 2
    assert limit((x + 1) ** 2 / (x ** 2 + 1), x, oo) == 1  # 181


def test_Limits_simple_2():
    assert limit(1000 * x / (x ** 2 - 1), x, oo) == 0  # 182
    assert limit((x ** 2 - 5 * x + 1) / (3 * x + 7), x, oo) is oo  # 183
    assert limit((2 * x ** 2 - x + 3) / (x ** 3 - 8 * x + 5), x, oo) == 0  # 184
    assert limit((2 * x ** 2 - 3 * x - 4) / sqrt(x ** 4 + 1), x, oo) == 2  # 186
    assert limit((2 * x + 3) / (x + root3(x)), x, oo) == 2  # 187
    assert limit(x ** 2 / (10 + x * sqrt(x)), x, oo) is oo  # 188
    assert limit(root3(x ** 2 + 1) / (x + 1), x, oo) == 0  # 189
    assert limit(sqrt(x) / sqrt(x + sqrt(x + sqrt(x))), x, oo) == 1  # 190


def test_Limits_simple_3a():
    a = Symbol("a")
    # issue 3513
    assert together(limit((x ** 2 - (a + 1) * x + a) / (x ** 3 - a ** 3), x, a)) == (
        a - 1
    ) / (
        3 * a ** 2
    )  # 196


def test_Limits_simple_3b():
    h = Symbol("h")
    assert limit(((x + h) ** 3 - x ** 3) / h, h, 0) == 3 * x ** 2  # 197
    assert limit((1 / (1 - x) - 3 / (1 - x ** 3)), x, 1) == -1  # 198
    assert (
        limit((sqrt(1 + x) - 1) / (root3(1 + x) - 1), x, 0) == Rational(3) / 2
    )  # Primer 4
    assert limit((sqrt(x) - 1) / (x - 1), x, 1) == Rational(1) / 2  # 199
    assert limit((sqrt(x) - 8) / (root3(x) - 4), x, 64) == 3  # 200
    assert limit((root3(x) - 1) / (root4(x) - 1), x, 1) == Rational(4) / 3  # 201
    assert (
        limit((root3(x ** 2) - 2 * root3(x) + 1) / (x - 1) ** 2, x, 1)
        == Rational(1) / 9
    )  # 202


def test_Limits_simple_4a():
    a = Symbol("a")
    assert limit((sqrt(x) - sqrt(a)) / (x - a), x, a) == 1 / (2 * sqrt(a))  # Primer 5
    assert limit((sqrt(x) - 1) / (root3(x) - 1), x, 1) == Rational(3, 2)  # 205
    assert limit((sqrt(1 + x) - sqrt(1 - x)) / x, x, 0) == 1  # 207
    assert limit(sqrt(x ** 2 - 5 * x + 6) - x, x, oo) == Rational(-5, 2)  # 213


def test_limits_simple_4aa():
    assert limit(x * (sqrt(x ** 2 + 1) - x), x, oo) == Rational(1) / 2  # 214


def test_Limits_simple_4b():
    # issue 3511
    assert limit(x - root3(x ** 3 - 1), x, oo) == 0  # 215


def test_Limits_simple_4c():
    assert limit(log(1 + exp(x)) / x, x, -oo) == 0  # 267a
    assert limit(log(1 + exp(x)) / x, x, oo) == 1  # 267b


def test_bounded():
    assert limit(sin(x) / x, x, oo) == 0  # 216b
    assert limit(x * sin(1 / x), x, 0) == 0  # 227a


def test_f1a():
    # issue 3508:
    assert limit((sin(2 * x) / x) ** (1 + x), x, 0) == 2  # Primer 7


def test_f1a2():
    # issue 3509:
    assert limit(((x - 1) / (x + 1)) ** x, x, oo) == exp(-2)  # Primer 9


def test_f1b():
    m = Symbol("m")
    n = Symbol("n")
    h = Symbol("h")
    a = Symbol("a")
    assert limit(sin(x) / x, x, 2) == sin(2) / 2  # 216a
    assert limit(sin(3 * x) / x, x, 0) == 3  # 217
    assert limit(sin(5 * x) / sin(2 * x), x, 0) == Rational(5, 2)  # 218
    assert limit(sin(pi * x) / sin(3 * pi * x), x, 0) == Rational(1, 3)  # 219
    assert limit(x * sin(pi / x), x, oo) == pi  # 220
    assert limit((1 - cos(x)) / x ** 2, x, 0) == S.Half  # 221
    assert limit(x * sin(1 / x), x, oo) == 1  # 227b
    assert limit((cos(m * x) - cos(n * x)) / x ** 2, x, 0) == (
        (n ** 2 - m ** 2) / 2
    )  # 232
    assert limit((tan(x) - sin(x)) / x ** 3, x, 0) == S.Half  # 233
    assert limit((x - sin(2 * x)) / (x + sin(3 * x)), x, 0) == -Rational(1, 4)  # 237
    assert limit((1 - sqrt(cos(x))) / x ** 2, x, 0) == Rational(1, 4)  # 239
    assert limit((sqrt(1 + sin(x)) - sqrt(1 - sin(x))) / x, x, 0) == 1  # 240

    assert limit((1 + h / x) ** x, x, oo) == exp(h)  # Primer 9
    assert limit((sin(x) - sin(a)) / (x - a), x, a) == cos(a)  # 222, *176
    assert limit((cos(x) - cos(a)) / (x - a), x, a) == -sin(a)  # 223
    assert limit((sin(x + h) - sin(x)) / h, h, 0) == cos(x)  # 225


def test_f2a():
    assert limit(((x + 1) / (2 * x + 1)) ** (x ** 2), x, oo) == 0  # Primer 8


def test_f2():
    assert limit((sqrt(cos(x)) - root3(cos(x))) / (sin(x) ** 2), x, 0) == -Rational(
        1, 12
    )  # *184


def test_f3():
    a = Symbol("a")
    # issue 3504
    assert limit(asin(a * x) / x, x, 0) == a

[((297, 308), 'sympy.Symbol', 'Symbol', (['"""x"""'], {}), "('x')\n", (303, 308), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((429, 439), 'sympy.root', 'root', (['x', '(3)'], {}), '(x, 3)\n', (433, 439), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((467, 477), 'sympy.root', 'root', (['x', '(4)'], {}), '(x, 4)\n', (471, 477), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((1656, 1667), 'sympy.Symbol', 'Symbol', (['"""a"""'], {}), "('a')\n", (1662, 1667), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((1866, 1877), 'sympy.Symbol', 'Symbol', (['"""h"""'], {}), "('h')\n", (1872, 1877), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((2518, 2529), 'sympy.Symbol', 'Symbol', (['"""a"""'], {}), "('a')\n", (2524, 2529), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3574, 3585), 'sympy.Symbol', 'Symbol', (['"""m"""'], {}), "('m')\n", (3580, 3585), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3594, 3605), 'sympy.Symbol', 'Symbol', (['"""n"""'], {}), "('n')\n", (3600, 3605), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3614, 3625), 'sympy.Symbol', 'Symbol', (['"""h"""'], {}), "('h')\n", (3620, 3625), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3634, 3645), 'sympy.Symbol', 'Symbol', (['"""a"""'], {}), "('a')\n", (3640, 3645), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((5020, 5031), 'sympy.Symbol', 'Symbol', (['"""a"""'], {}), "('a')\n", (5026, 5031), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((519, 582), 'sympy.limit', 'limit', (['((2 ** (x + 1) + 3 ** (x + 1)) / (2 ** x + 3 ** x))', 'x', 'oo'], {}), '((2 ** (x + 1) + 3 ** (x + 1)) / (2 ** x + 3 ** x), x, oo)\n', (524, 582), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((636, 686), 'sympy.limit', 'limit', (['((x + 1) * (x + 2) * (x + 3) / x ** 3)', 'x', 'oo'], {}), '((x + 1) * (x + 2) * (x + 3) / x ** 3, x, oo)\n', (641, 686), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((779, 855), 'sympy.limit', 'limit', (['((2 * x - 3) * (3 * x + 5) * (4 * x - 6) / (3 * x ** 3 + x - 1))', 'x', 'oo'], {}), '((2 * x - 3) * (3 * x + 5) * (4 * x - 6) / (3 * x ** 3 + x - 1), x, oo)\n', (784, 855), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((965, 1006), 'sympy.limit', 'limit', (['((x + 1) ** 2 / (x ** 2 + 1))', 'x', 'oo'], {}), '((x + 1) ** 2 / (x ** 2 + 1), x, oo)\n', (970, 1006), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((1060, 1097), 'sympy.limit', 'limit', (['(1000 * x / (x ** 2 - 1))', 'x', 'oo'], {}), '(1000 * x / (x ** 2 - 1), x, oo)\n', (1065, 1097), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((1121, 1169), 'sympy.limit', 'limit', (['((x ** 2 - 5 * x + 1) / (3 * x + 7))', 'x', 'oo'], {}), '((x ** 2 - 5 * x + 1) / (3 * x + 7), x, oo)\n', (1126, 1169), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((1194, 1251), 'sympy.limit', 'limit', (['((2 * x ** 2 - x + 3) / (x ** 3 - 8 * x + 5))', 'x', 'oo'], {}), '((2 * x ** 2 - x + 3) / (x ** 3 - 8 * x + 5), x, oo)\n', (1199, 1251), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((1889, 1929), 'sympy.limit', 'limit', (['(((x + h) ** 3 - x ** 3) / h)', 'h', '(0)'], {}), '(((x + h) ** 3 - x ** 3) / h, h, 0)\n', (1894, 1929), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((1962, 2005), 'sympy.limit', 'limit', (['(1 / (1 - x) - 3 / (1 - x ** 3))', 'x', '(1)'], {}), '(1 / (1 - x) - 3 / (1 - x ** 3), x, 1)\n', (1967, 2005), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((2675, 2689), 'sympy.Rational', 'Rational', (['(3)', '(2)'], {}), '(3, 2)\n', (2683, 2689), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((2822, 2837), 'sympy.Rational', 'Rational', (['(-5)', '(2)'], {}), '(-5, 2)\n', (2830, 2837), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3486, 3524), 'sympy.limit', 'limit', (['(((x - 1) / (x + 1)) ** x)', 'x', 'oo'], {}), '(((x - 1) / (x + 1)) ** x, x, oo)\n', (3491, 3524), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3528, 3535), 'sympy.exp', 'exp', (['(-2)'], {}), '(-2)\n', (3531, 3535), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3805, 3819), 'sympy.Rational', 'Rational', (['(5)', '(2)'], {}), '(5, 2)\n', (3813, 3819), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3884, 3898), 'sympy.Rational', 'Rational', (['(1)', '(3)'], {}), '(1, 3)\n', (3892, 3898), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4392, 4406), 'sympy.Rational', 'Rational', (['(1)', '(4)'], {}), '(1, 4)\n', (4400, 4406), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4504, 4534), 'sympy.limit', 'limit', (['((1 + h / x) ** x)', 'x', 'oo'], {}), '((1 + h / x) ** x, x, oo)\n', (4509, 4534), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4538, 4544), 'sympy.exp', 'exp', (['h'], {}), '(h)\n', (4541, 4544), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4612, 4618), 'sympy.cos', 'cos', (['a'], {}), '(a)\n', (4615, 4618), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4755, 4761), 'sympy.cos', 'cos', (['x'], {}), '(x)\n', (4758, 4761), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4798, 4845), 'sympy.limit', 'limit', (['(((x + 1) / (2 * x + 1)) ** x ** 2)', 'x', 'oo'], {}), '(((x + 1) / (2 * x + 1)) ** x ** 2, x, oo)\n', (4803, 4845), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((1705, 1764), 'sympy.limit', 'limit', (['((x ** 2 - (a + 1) * x + a) / (x ** 3 - a ** 3))', 'x', 'a'], {}), '((x ** 2 - (a + 1) * x + a) / (x ** 3 - a ** 3), x, a)\n', (1710, 1764), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((2097, 2108), 'sympy.Rational', 'Rational', (['(3)'], {}), '(3)\n', (2105, 2108), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((2182, 2193), 'sympy.Rational', 'Rational', (['(1)'], {}), '(1)\n', (2190, 2193), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((2332, 2343), 'sympy.Rational', 'Rational', (['(4)'], {}), '(4)\n', (2340, 2343), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((2450, 2461), 'sympy.Rational', 'Rational', (['(1)'], {}), '(1)\n', (2458, 2461), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((2932, 2943), 'sympy.Rational', 'Rational', (['(1)'], {}), '(1)\n', (2940, 2943), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3684, 3690), 'sympy.sin', 'sin', (['(2)'], {}), '(2)\n', (3687, 3690), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4315, 4329), 'sympy.Rational', 'Rational', (['(1)', '(4)'], {}), '(1, 4)\n', (4323, 4329), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4688, 4694), 'sympy.sin', 'sin', (['a'], {}), '(a)\n', (4691, 4694), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4957, 4972), 'sympy.Rational', 'Rational', (['(1)', '(12)'], {}), '(1, 12)\n', (4965, 4972), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((716, 727), 'sympy.sqrt', 'sqrt', (['(x + 1)'], {}), '(x + 1)\n', (720, 727), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((730, 737), 'sympy.sqrt', 'sqrt', (['x'], {}), '(x)\n', (734, 737), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((1308, 1324), 'sympy.sqrt', 'sqrt', (['(x ** 4 + 1)'], {}), '(x ** 4 + 1)\n', (1312, 1324), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((1559, 1566), 'sympy.sqrt', 'sqrt', (['x'], {}), '(x)\n', (1563, 1566), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((2596, 2603), 'sympy.sqrt', 'sqrt', (['a'], {}), '(a)\n', (2600, 2603), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((2782, 2806), 'sympy.sqrt', 'sqrt', (['(x ** 2 - 5 * x + 6)'], {}), '(x ** 2 - 5 * x + 6)\n', (2786, 2806), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3249, 3255), 'sympy.sin', 'sin', (['x'], {}), '(x)\n', (3252, 3255), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3302, 3312), 'sympy.sin', 'sin', (['(1 / x)'], {}), '(1 / x)\n', (3305, 3312), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3663, 3669), 'sympy.sin', 'sin', (['x'], {}), '(x)\n', (3666, 3669), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3720, 3730), 'sympy.sin', 'sin', (['(3 * x)'], {}), '(3 * x)\n', (3723, 3730), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3771, 3781), 'sympy.sin', 'sin', (['(5 * x)'], {}), '(5 * x)\n', (3774, 3781), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3784, 3794), 'sympy.sin', 'sin', (['(2 * x)'], {}), '(2 * x)\n', (3787, 3794), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3844, 3855), 'sympy.sin', 'sin', (['(pi * x)'], {}), '(pi * x)\n', (3847, 3855), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3858, 3873), 'sympy.sin', 'sin', (['(3 * pi * x)'], {}), '(3 * pi * x)\n', (3861, 3873), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3927, 3938), 'sympy.sin', 'sin', (['(pi / x)'], {}), '(pi / x)\n', (3930, 3938), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4044, 4054), 'sympy.sin', 'sin', (['(1 / x)'], {}), '(1 / x)\n', (4047, 4054), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((5066, 5077), 'sympy.asin', 'asin', (['(a * x)'], {}), '(a * x)\n', (5070, 5077), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((2049, 2060), 'sympy.sqrt', 'sqrt', (['(1 + x)'], {}), '(1 + x)\n', (2053, 2060), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((2149, 2156), 'sympy.sqrt', 'sqrt', (['x'], {}), '(x)\n', (2153, 2156), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((2223, 2230), 'sympy.sqrt', 'sqrt', (['x'], {}), '(x)\n', (2227, 2230), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((2548, 2555), 'sympy.sqrt', 'sqrt', (['x'], {}), '(x)\n', (2552, 2555), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((2558, 2565), 'sympy.sqrt', 'sqrt', (['a'], {}), '(a)\n', (2562, 2565), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((2635, 2642), 'sympy.sqrt', 'sqrt', (['x'], {}), '(x)\n', (2639, 2642), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((2715, 2726), 'sympy.sqrt', 'sqrt', (['(1 + x)'], {}), '(1 + x)\n', (2719, 2726), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((2729, 2740), 'sympy.sqrt', 'sqrt', (['(1 - x)'], {}), '(1 - x)\n', (2733, 2740), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((2899, 2915), 'sympy.sqrt', 'sqrt', (['(x ** 2 + 1)'], {}), '(x ** 2 + 1)\n', (2903, 2915), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3387, 3397), 'sympy.sin', 'sin', (['(2 * x)'], {}), '(2 * x)\n', (3390, 3397), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3982, 3988), 'sympy.cos', 'cos', (['x'], {}), '(x)\n', (3985, 3988), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4094, 4104), 'sympy.cos', 'cos', (['(m * x)'], {}), '(m * x)\n', (4097, 4104), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4107, 4117), 'sympy.cos', 'cos', (['(n * x)'], {}), '(n * x)\n', (4110, 4117), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4201, 4207), 'sympy.tan', 'tan', (['x'], {}), '(x)\n', (4204, 4207), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4210, 4216), 'sympy.sin', 'sin', (['x'], {}), '(x)\n', (4213, 4216), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4273, 4283), 'sympy.sin', 'sin', (['(2 * x)'], {}), '(2 * x)\n', (4276, 4283), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4292, 4302), 'sympy.sin', 'sin', (['(3 * x)'], {}), '(3 * x)\n', (4295, 4302), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4575, 4581), 'sympy.sin', 'sin', (['x'], {}), '(x)\n', (4578, 4581), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4584, 4590), 'sympy.sin', 'sin', (['a'], {}), '(a)\n', (4587, 4590), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4650, 4656), 'sympy.cos', 'cos', (['x'], {}), '(x)\n', (4653, 4656), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4659, 4665), 'sympy.cos', 'cos', (['a'], {}), '(a)\n', (4662, 4665), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4720, 4730), 'sympy.sin', 'sin', (['(x + h)'], {}), '(x + h)\n', (4723, 4730), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4733, 4739), 'sympy.sin', 'sin', (['x'], {}), '(x)\n', (4736, 4739), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4933, 4939), 'sympy.sin', 'sin', (['x'], {}), '(x)\n', (4936, 4939), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((1447, 1454), 'sympy.sqrt', 'sqrt', (['x'], {}), '(x)\n', (1451, 1454), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3118, 3124), 'sympy.exp', 'exp', (['x'], {}), '(x)\n', (3121, 3124), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((3177, 3183), 'sympy.exp', 'exp', (['x'], {}), '(x)\n', (3180, 3183), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4364, 4370), 'sympy.cos', 'cos', (['x'], {}), '(x)\n', (4367, 4370), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4905, 4911), 'sympy.cos', 'cos', (['x'], {}), '(x)\n', (4908, 4911), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4921, 4927), 'sympy.cos', 'cos', (['x'], {}), '(x)\n', (4924, 4927), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4441, 4447), 'sympy.sin', 'sin', (['x'], {}), '(x)\n', (4444, 4447), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((4460, 4466), 'sympy.sin', 'sin', (['x'], {}), '(x)\n', (4463, 4466), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((1587, 1594), 'sympy.sqrt', 'sqrt', (['x'], {}), '(x)\n', (1591, 1594), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((358, 364), 'sympy.log', 'log', (['(3)'], {}), '(3)\n', (361, 364), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n'), ((367, 373), 'sympy.log', 'log', (['(2)'], {}), '(2)\n', (370, 373), False, 'from sympy import limit, Symbol, oo, sqrt, Rational, log, exp, cos, sin, tan, pi, asin, together, root, S\n')]