def test_different_functions_3(self): expr = Expression('sin(2/exp(x)+7*arcsin(x))') x = Symbol('x') self._check__values( Differentiation.diff(expr, x), 'cos(2/exp(x)+7*arcsin(x))*((0*(exp(x))-(2)*' '(exp(x)))/(exp(x))^2+7*1/(1-(x)^2)^2)')
def test_hyperbolic_functions_2(self): expr = Expression('ch(x)') x = Symbol('x') self._check__values(Differentiation.diff(expr, x), 'sh(x)')
def test_inverse_trigonometrical_functions_4(self): expr = Expression('arcctg(x)') x = Symbol('x') self._check__values(Differentiation.diff(expr, x), '-1/(1+(x)^2)')
def test_trigonometrical_functions_6(self): expr = Expression('csc(x)') x = Symbol('x') self._check__values(Differentiation.diff(expr, x), '-ctg(x)*csc(x)')
def test_trigonometrical_functions_3(self): expr = Expression('tg(x)') x = Symbol('x') self._check__values(Differentiation.diff(expr, x), '1/cos(x)^2')
def test_exponential_functions_2(self): expr = Expression('ln(x)') x = Symbol('x') self._check__values(Differentiation.diff(expr, x), '1/(x)')
def test_symbol(self): expr = Expression('x') x = Symbol('x') self._check__values(Differentiation.diff(expr, x), '1')
def test_error_1(self): try: x = Symbol('xx') self.assertEqual(True, False) except ValueValidationError: self.assertEqual(True, True)
def test_calculations_3(self): expr = Expression('sin(x)+cos(x)') x = Symbol('x') self._check__values(Differentiation.diff(expr, x, value=1), '-0.30116867893975674')
def test_calculations_2(self): expr = Expression('cos(x)') x = Symbol('x') self._check__values(Differentiation.diff(expr, x, value=1), '-0.8414709848078965')
def test_calculations_1(self): expr = Expression('sin(x)') x = Symbol('x') self._check__values(Differentiation.diff(expr, x, value=1), '0.5403023058681398')
def test_different_functions_2(self): expr = Expression('sin(2/exp(x))') x = Symbol('x') self._check__values( Differentiation.diff(expr, x), 'cos(2/exp(x))*((0*(exp(x))-' '(2)*(exp(x)))/(exp(x))^2)')
def test_different_functions_1(self): expr = Expression('sin(x)^2') x = Symbol('x') self._check__values(Differentiation.diff(expr, x), 'exp(2*ln(sin(x)))*(2*1/(sin(x))*(cos(x)))')