def test_xx_3x_2_diff(self): x = X() f = Add(Add(Mul(x, x), Mul(Number(3), x)), Number(2)) # f(x) = x**2 + 3x + 2 self.assertEqual(f.diff().eval(10), 23)
def test_2x_3_diff(self): f = Add(Mul(Number(2), X()), Number(3)) # f(x) = 2x + 3 self.assertEqual(f.diff().eval(100), 2)