|
@@ -1,5 +1,5 @@
|
|
|
-from src.rules.integrals import choose_constant, \
|
|
|
|
|
- match_integrate_variable_power, integrate_variable_root, \
|
|
|
|
|
|
|
+from src.rules.integrals import choose_constant, match_solve_indef, \
|
|
|
|
|
+ solve_indef, match_integrate_variable_power, integrate_variable_root, \
|
|
|
integrate_variable_exponent
|
|
integrate_variable_exponent
|
|
|
from src.rules.logarithmic import ln
|
|
from src.rules.logarithmic import ln
|
|
|
#from .goniometry import sin, cos
|
|
#from .goniometry import sin, cos
|
|
@@ -25,6 +25,14 @@ class TestRulesIntegrals(RulesTestCase):
|
|
|
self.assertEqual(choose_constant(tree('int x ^ c')), a)
|
|
self.assertEqual(choose_constant(tree('int x ^ c')), a)
|
|
|
self.assertEqual(choose_constant(tree('int a ^ c da')), b)
|
|
self.assertEqual(choose_constant(tree('int a ^ c da')), b)
|
|
|
|
|
|
|
|
|
|
+ def test_match_solve_indef(self):
|
|
|
|
|
+ root = tree('[x ^ 2]_a^b')
|
|
|
|
|
+ self.assertEqualPos(match_solve_indef(root), [P(root, solve_indef)])
|
|
|
|
|
+
|
|
|
|
|
+ def test_solve_indef(self):
|
|
|
|
|
+ root, expect = tree('[x ^ 2]_a^b, b2 - a2')
|
|
|
|
|
+ self.assertEqual(solve_indef(root, ()), expect)
|
|
|
|
|
+
|
|
|
def test_match_integrate_variable_power(self):
|
|
def test_match_integrate_variable_power(self):
|
|
|
for root in tree('int x ^ n, int x ^ n'):
|
|
for root in tree('int x ^ n, int x ^ n'):
|
|
|
self.assertEqualPos(match_integrate_variable_power(root),
|
|
self.assertEqualPos(match_integrate_variable_power(root),
|