def test_series1(): e = sin(x) assert e.nseries(x, 0) != 0 assert e.nseries(x, 0) == O(x) assert e.nseries(x, 1) == O(x) assert e.nseries(x, 2) == x + O(x**3) assert e.nseries(x, 3) == x + O(x**3) assert e.nseries(x, 4) == x - x**3 / 6 + O(x**5) e = (exp(x) - 1) / x assert e.nseries(x, 4) == 1 + x / 2 + x**2 / 6 + O(x**3) assert x.nseries(x, 2) == x
def test_series1(): e = sin(x) assert e.nseries(x, 0) != 0 assert e.nseries(x, 0) == O(x) assert e.nseries(x, 1) == O(x) assert e.nseries(x, 2) == x + O(x**3) assert e.nseries(x, 3) == x + O(x**3) assert e.nseries(x, 4) == x - x**3/6 + O(x**5) e = (exp(x) - 1)/x assert e.nseries(x, 4) == 1 + x/2 + x**2/6 + O(x**3) assert x.nseries(x, 2) == x
def test_series1_failing(): assert x.nseries(x, 0) == O(1, x) assert x.nseries(x, 1) == O(x)
def test_simple_1(): assert x.nseries(x, n=5) == x assert y.nseries(x, n=5) == y assert (1 / (x * y)).nseries(y, n=5) == 1 / (x * y) assert Rational(3, 4).nseries(x, n=5) == Rational(3, 4) assert x.nseries(x) == x
def test_simple_1(): assert x.nseries(x, n=5) == x assert y.nseries(x, n=5) == y assert (1/(x*y)).nseries(y, n=5) == 1/(x*y) assert Rational(3, 4).nseries(x, n=5) == Rational(3, 4) assert x.nseries(x) == x