def test_get_derivative_of_x_on_power_one(self): term = Term('3x') self.assertTrue(term.get_derivative() == 3)
def test_get_derivative_with_power_bigger_than_one(self): term = Term('3x^2') # also works 3x^2 == 6x^1 self.assertTrue(term.get_derivative() == Term('6x'))
def test_get_derivative_of_constant(self): term = Term('3') self.assertTrue(term.get_derivative() == 0)