Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
trs
Commits
15ad7e94
Commit
15ad7e94
authored
Apr 18, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed an integral rule slightly to fit the new fraction rules better.
parent
65cc88c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
src/rules/integrals.py
src/rules/integrals.py
+3
-3
tests/test_rules_integrals.py
tests/test_rules_integrals.py
+1
-1
No files found.
src/rules/integrals.py
View file @
15ad7e94
...
...
@@ -66,7 +66,7 @@ def solve_indef(root, args):
def
match_integrate_variable_power
(
node
):
"""
int x ^ n dx ->
x ^ (n + 1) /
(n + 1)
int x ^ n dx ->
1 / (n + 1) * x ^
(n + 1)
int g ^ x dx -> g ^ x / ln(g)
"""
assert
node
.
is_op
(
OP_INT
)
...
...
@@ -87,11 +87,11 @@ def match_integrate_variable_power(node):
def
integrate_variable_root
(
root
,
args
):
"""
int x ^ n dx ->
x ^ (n + 1) /
(n + 1)
int x ^ n dx ->
1 / (n + 1) * x ^
(n + 1)
"""
x
,
n
=
root
[
0
]
return
solve_integral
(
root
,
x
**
(
n
+
1
)
/
(
n
+
1
))
return
solve_integral
(
root
,
L
(
1
)
/
(
n
+
1
)
*
x
**
(
n
+
1
))
MESSAGES
[
integrate_variable_root
]
=
\
...
...
tests/test_rules_integrals.py
View file @
15ad7e94
...
...
@@ -57,7 +57,7 @@ class TestRulesIntegrals(RulesTestCase):
[
P
(
root
,
integrate_variable_exponent
)])
def
test_integrate_variable_root
(
self
):
root
,
expect
=
tree
(
'int x ^ n,
x ^ (n + 1) /
(n + 1) + c'
)
root
,
expect
=
tree
(
'int x ^ n,
1 / (n + 1) * x ^
(n + 1) + c'
)
self
.
assertEqual
(
integrate_variable_root
(
root
,
()),
expect
)
def
test_integrate_variable_exponent
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment