def test_exp_re(): d = -f(x) + Derivative(f(x), x) assert exp_re(d, r, k) == -r(k) + r(k + 1) d = f(x) + Derivative(f(x), x, x) assert exp_re(d, r, k) == r(k) + r(k + 2) d = f(x) + Derivative(f(x), x) + Derivative(f(x), x, x) assert exp_re(d, r, k) == r(k) + r(k + 1) + r(k + 2) d = Derivative(f(x), x) + Derivative(f(x), x, x) assert exp_re(d, r, k) == r(k) + r(k + 1) d = Derivative(f(x), x, 3) + Derivative(f(x), x, 4) + Derivative(f(x)) assert exp_re(d, r, k) == r(k) + r(k + 2) + r(k + 3)
def test_exp_re(): d = -f(x) + Derivative(f(x), x) assert exp_re(d, r, k) == -r(k) + r(k + 1) d = f(x) + Derivative(f(x), x, x) assert exp_re(d, r, k) == r(k) + r(k + 2) d = f(x) + Derivative(f(x), x) + Derivative(f(x), x, x) assert exp_re(d, r, k) == r(k) + r(k + 1) + r(k + 2) d = Derivative(f(x), x) + Derivative(f(x), x, x) assert exp_re(d, r, k) == r(k) + r(k + 1) d = Derivative(f(x), x, 3) + Derivative(f(x), x, 4) + Derivative(f(x)) assert exp_re(d, r, k) == r(k) + r(k + 2) + r(k + 3)