Commit 8600bb1f authored by Taddeus Kroes's avatar Taddeus Kroes

More source code cleanup.

parent f846f9e7
......@@ -72,8 +72,8 @@ def solve_integral(integral, F):
def match_integrate_variable_power(node):
"""
int(x ^ n, x) -> x ^ (n + 1) / (n + 1) + c
int(g ^ x, x) -> g ^ x / ln(g)
int x ^ n dx -> x ^ (n + 1) / (n + 1) + c
int g ^ x dx -> g ^ x / ln(g)
"""
assert node.is_op(OP_INT)
......@@ -93,7 +93,7 @@ def match_integrate_variable_power(node):
def integrate_variable_root(root, args):
"""
int(x ^ n, x) -> x ^ (n + 1) / (n + 1) + c
int x ^ n dx -> x ^ (n + 1) / (n + 1) + c
"""
x, n = root[0]
......@@ -106,7 +106,7 @@ MESSAGES[integrate_variable_root] = \
def integrate_variable_exponent(root, args):
"""
int(g ^ x, x) -> g ^ x / ln(g)
int g ^ x dx -> g ^ x / ln(g)
"""
g, x = root[0]
......
......@@ -35,11 +35,9 @@ class TestRulesIntegrals(RulesTestCase):
[P(root, integrate_variable_exponent)])
def test_integrate_variable_root(self):
((x, n), x), c = root, c = tree('int x ^ n, c')
self.assertEqual(integrate_variable_root(root, ()),
x ** (n + 1) / (n + 1) + c)
root, expect = tree('int x ^ n, x ^ (n + 1) / (n + 1) + c')
self.assertEqual(integrate_variable_root(root, ()), expect)
def test_integrate_variable_exponent(self):
((g, x), x), c = root, c = tree('int g ^ x, c')
self.assertEqual(integrate_variable_exponent(root, ()),
g ** x / ln(g) + c)
root, expect = tree('int g ^ x, g ^ x / ln(g) + c')
self.assertEqual(integrate_variable_exponent(root, ()), expect)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment