Skip to content

Loading…

Issue #2850 solved. Integration doesn't halt now. #2976

Merged
merged 5 commits into from

4 participants

@rajat974

In issue #2850 it was mentioned that integrate(asin(x)*log(x), x) does not give any answer. It just give Integral(log(x)*asin(x), x) which is probably wrong. The reason was asin and acos was not implemented in manualintegrate.py. It is now done.

@skirpichev skirpichev commented on an outdated diff
sympy/integrals/tests/test_manual.py
@@ -149,3 +149,11 @@ def test_issue_3647():
with assuming(Q.negative(a)):
assert manualintegrate(1 / (a + b*x**2), x) == \
Integral(1/(a + b*x**2), x)
+
+def test_issue_2850():

Please change to something like test_gh_issue_2850. We have issues on the google code too.

Done !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@rajat974

Its weird that earlier it passed the Travis build but now its giving error due to slow tests.
@skirpichev should it be spilt ?

@asmeurer
SymPy member
@rajat974

@asmeurer how to solve travis issue?

@lidavidm
SymPy member

This looks fine. I'm not sure why Travis is timing out though.

@lidavidm lidavidm commented on an outdated diff
sympy/integrals/manualintegrate.py
((6 lines not shown))
pull_out_polys, pull_out_u(sympy.sin, sympy.cos),
pull_out_u(sympy.exp)]
dummy = sympy.Dummy("temporary")
# we can integrate log(x) and atan(x) by setting dv = 1
- if isinstance(integrand, sympy.log) or isinstance(integrand, sympy.atan):
+ if isinstance(integrand, sympy.log) or isinstance(integrand, sympy.atan) or isinstance(integrand, sympy.asin) or isinstance(integrand, sympy.acos):
@lidavidm SymPy member

Perhaps for clarity isinstance(integrand, (sympy.log, sympy.asin, sympy.acos, sympy.atan)) would be best.

ya sure !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@rajat974

@lidavidm Can it be merge now ?

@rajat974

@asmeurer Is there any change i have to do to get it merge??

@rajat974

@asmeurer please review this and guide me , so that i can get it merged.

@asmeurer asmeurer merged commit e0034ed into sympy:master

1 check passed

Details default The Travis CI build passed
@asmeurer
SymPy member

How should I spell your name for the AUTHORS file?

@skirpichev skirpichev added a commit that referenced this pull request
@skirpichev skirpichev Shift numbers after merging pr #2976
Merge branch 'master' into shift-issue-numbering
74fb56b
@asmeurer
SymPy member

Thanks, I fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 28, 2014
  1. @rajat974

    Added support for asin, acos

    rajat974 committed
  2. @rajat974

    Tests added

    rajat974 committed
  3. @rajat974

    test name changed

    rajat974 committed
Commits on Mar 1, 2014
  1. @rajat974

    Ecpression changed

    rajat974 committed
  2. @rajat974
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 5 deletions.
  1. +4 −4 sympy/integrals/manualintegrate.py
  2. +9 −1 sympy/integrals/tests/test_manual.py
View
8 sympy/integrals/manualintegrate.py
@@ -336,14 +336,14 @@ def pull_out_u_rl(integrand):
return pull_out_u_rl
- liate_rules = [pull_out_u(sympy.log), pull_out_u(sympy.atan),
+ liate_rules = [pull_out_u(sympy.log), pull_out_u(sympy.atan, sympy.asin, sympy.acos),
pull_out_polys, pull_out_u(sympy.sin, sympy.cos),
pull_out_u(sympy.exp)]
dummy = sympy.Dummy("temporary")
# we can integrate log(x) and atan(x) by setting dv = 1
- if isinstance(integrand, sympy.log) or isinstance(integrand, sympy.atan):
+ if isinstance(integrand, (sympy.log, sympy.atan, sympy.asin, sympy.acos)):
integrand = dummy * integrand
for index, rule in enumerate(liate_rules):
@@ -766,7 +766,7 @@ def key(integral):
return sympy.Number
else:
for cls in (sympy.Pow, sympy.Symbol, sympy.exp, sympy.log,
- sympy.Add, sympy.Mul, sympy.atan):
+ sympy.Add, sympy.Mul, sympy.atan, sympy.asin, sympy.acos):
if isinstance(integrand, cls):
return cls
@@ -791,7 +791,7 @@ def _integral_is_subclass(integral):
alternatives(
substitution_rule,
condition(
- integral_is_subclass(sympy.Mul, sympy.log, sympy.atan),
+ integral_is_subclass(sympy.Mul, sympy.log, sympy.atan, sympy.asin, sympy.acos),
parts_rule),
condition(
integral_is_subclass(sympy.Mul, sympy.Pow),
View
10 sympy/integrals/tests/test_manual.py
@@ -1,4 +1,4 @@
-from sympy import (sin, cos, tan, sec, csc, cot, log, exp, atan,
+from sympy import (sin, cos, tan, sec, csc, cot, log, exp, atan, asin, acos,
Symbol, Mul, Integral, integrate, pi, Dummy,
Derivative, diff, I, sqrt, erf, Piecewise,
Eq, Ne, Q, assuming, symbols, And)
@@ -149,3 +149,11 @@ def test_issue_3647():
with assuming(Q.negative(a)):
assert manualintegrate(1 / (a + b*x**2), x) == \
Integral(1/(a + b*x**2), x)
+
+def test_gh_issue_2850():
+ assert manualintegrate(asin(x)*log(x), x) == -x*asin(x) - sqrt(-x**2 + 1) \
+ + (x*asin(x) + sqrt(-x**2 + 1))*log(x) - Integral(sqrt(-x**2 + 1)/x, x)
+ assert manualintegrate(acos(x)*log(x), x) == -x*acos(x) + sqrt(-x**2 + 1) + \
+ (x*acos(x) - sqrt(-x**2 + 1))*log(x) + Integral(sqrt(-x**2 + 1)/x, x)
+ assert manualintegrate(atan(x)*log(x), x) == -x*atan(x) + (x*atan(x) - \
+ log(x**2 + 1)/2)*log(x) + log(x**2 + 1)/2 + Integral(log(x**2 + 1)/x, x)/2
Something went wrong with that request. Please try again.