what is the result for this integration??

191 views
Skip to first unread message

Abhishek Verma

unread,
Feb 24, 2016, 7:00:36 AM2/24/16
to sympy
Hi everyone,
I am Abhishek Verma, and I will be applying for GSoC this year.
I have trouble while calculating the Indefinite Integration.

I have a Expr=X^(log(x^log(x))) ,while Solving this by integrate() function i get the result -
>>> integrate(x**log(x**log(x)),x)
⌠           
⎮     3     
⎮  log (x)  
⎮ ℯ        dx
⌡           


But for Expr=X^(log(x^log(x^log(x))))


>>> integrate(x**log(x**log(x**log(x))),x)
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/sympy/polys/rings.py", line 365, in from_expr
    poly = self._rebuild_expr(expr, mapping)
  File "/usr/local/lib/python3.4/dist-packages/sympy/polys/rings.py", line 359, in _rebuild_expr
    return _rebuild(sympify(expr))
  File "/usr/local/lib/python3.4/dist-packages/sympy/polys/rings.py", line 351, in _rebuild
    return reduce(add, list(map(_rebuild, expr.args)))
  File "/usr/local/lib/python3.4/dist-packages/sympy/polys/rings.py", line 353, in _rebuild
    return reduce(mul, list(map(_rebuild, expr.args)))
  File "/usr/local/lib/python3.4/dist-packages/sympy/polys/rings.py", line 351, in _rebuild
    return reduce(add, list(map(_rebuild, expr.args)))
  File "/usr/local/lib/python3.4/dist-packages/sympy/polys/rings.py", line 353, in _rebuild
    return reduce(mul, list(map(_rebuild, expr.args)))
  File "/usr/local/lib/python3.4/dist-packages/sympy/polys/rings.py", line 351, in _rebuild
    return reduce(add, list(map(_rebuild, expr.args)))
  File "/usr/local/lib/python3.4/dist-packages/sympy/polys/rings.py", line 353, in _rebuild
    return reduce(mul, list(map(_rebuild, expr.args)))
  File "/usr/local/lib/python3.4/dist-packages/sympy/polys/rings.py", line 357, in _rebuild
    return domain.convert(expr)
  File "/usr/local/lib/python3.4/dist-packages/sympy/polys/domains/domain.py", line 146, in convert
    raise CoercionFailed("can't convert %s of type %s to %s" % (element, type(element), self))
sympy.polys.polyerrors.CoercionFailed: can't convert _x0**_x1 of type <class 'sympy.core.power.Pow'> to QQ[_A0,_A1,_A2,_A3,_A4,_A5,_A6,_A7,_A8,_A9,_A10,_A11,_A12,_A13,_A14,_A15,_A16,_A17,_A18,_A19,_A20,_A21,_A22,_A23,_A24,_A25,_A26,_A27,_A28,_A29,_A30,_A31,_A32,_A33,_A34,_A35,_A36,_A37,_A38,_A39,_A40,_A41,_A42,_A43,_A44,_A45,_A46,_A47,_A48,_A49,_A50,_A51,_A52,_A53,_A54,_A55,_A56,_A57,_A58,_A59,_A60,_A61,_A62,_A63,_A64,_A65,_A66,_A67,_A68,_A69,_A70,_A71,_A72,_A73,_A74,_A75,_A76,_A77,_A78,_A79,_A80,_A81,_A82,_A83,_A84,_A85,_A86,_A87,_A88,_A89,_A90,_A91,_A92,_A93,_A94,_A95,_A96,_A97,_A98,_A99,_A100,_A101,_A102,_A103,_A104,_A105,_A106,_A107,_A108,_A109,_A110,_A111,_A112,_A113,_A114,_A115,_A116,_A117,_A118,_A119,_B0]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.4/dist-packages/sympy/utilities/decorator.py", line 35, in threaded_func
    return func(expr, *args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/sympy/integrals/integrals.py", line 1232, in integrate
    risch=risch, manual=manual)
  File "/usr/local/lib/python3.4/dist-packages/sympy/integrals/integrals.py", line 487, in doit
    conds=conds)
  File "/usr/local/lib/python3.4/dist-packages/sympy/integrals/integrals.py", line 862, in _eval_integral
    h = heurisch_wrapper(g, x, hints=[])
  File "/usr/local/lib/python3.4/dist-packages/sympy/integrals/heurisch.py", line 128, in heurisch_wrapper
    unnecessary_permutations)
  File "/usr/local/lib/python3.4/dist-packages/sympy/integrals/heurisch.py", line 566, in heurisch
    solution = _integrate('Q')
  File "/usr/local/lib/python3.4/dist-packages/sympy/integrals/heurisch.py", line 555, in _integrate
    numer = ring.from_expr(raw_numer)
  File "/usr/local/lib/python3.4/dist-packages/sympy/polys/rings.py", line 367, in from_expr
    raise ValueError("expected an expression convertible to a polynomial in %s, got %s" % (self, expr))
ValueError: expected an expression convertible to a polynomial in Polynomial ring in _x0, _x1, _x2, _x3, _x4, _x5, _x6 over QQ[_A0,_A1,_A2,_A3,_A4,_A5,_A6,_A7,_A8,_A9,_A10,_A11,_A12,_A13,_A14,_A15,_A16,_A17,_A18,_A19,_A20,_A21,_A22,_A23,_A24,_A25,_A26,_A27,_A28,_A29,_A30,_A31,_A32,_A33,_A34,_A35,_A36,_A37,_A38,_A39,_A40,_A41,_A42,_A43,_A44,_A45,_A46,_A47,_A48,_A49,_A50,_A51,_A52,_A53,_A54,_A55,_A56,_A57,_A58,_A59,_A60,_A61,_A62,_A63,_A64,_A65,_A66,_A67,_A68,_A69,_A70,_A71,_A72,_A73,_A74,_A75,_A76,_A77,_A78,_A79,_A80,_A81,_A82,_A83,_A84,_A85,_A86,_A87,_A88,_A89,_A90,_A91,_A92,_A93,_A94,_A95,_A96,_A97,_A98,_A99,_A100,_A101,_A102,_A103,_A104,_A105,_A106,_A107,_A108,_A109,_A110,_A111,_A112,_A113,_A114,_A115,_A116,_A117,_A118,_A119,_B0] with lex order, got _x0**5*_x5 - _x0**3*(2*_x0**_x2*_x2*(2*_A103*_x2*_x6 + _A106*_x4*_x5 + _x4**2*_A107 + _A108*_x1*_x2 + _A110*_x4 + _A116*_x0*_x1 + 2*_A12*_x1*_x6 + 2*_A19*_x4*_x6 + _A2 + _A20*_x2*_x3 + _A21*_x1*_x3 + _A23*_x3*_x4 + _A26*_x0*_x3 + _A3*_x2 + _x5**2*_A32 + _A35*_x0*_x2 + _A39*_x1 + _x2**2*_A41 + _A50*_x3 + 3*_x6**2*_A52 + 2*_A58*_x6 + _A6*_x0*_x4 + _A62*_x0*_x5 + _x1**2*_A69 + _A72*_x2*_x5 + _A74*_x2*_x4 + 2*_A77*_x0*_x6 + _x0**2*_A78 + _A8*_x5 + _x3**2*_A81 + 2*_A83*_x3*_x6 + _A89*_x0 + 2*_A90*_x5*_x6 + _A95*_x1*_x4 + _A96*_x1*_x5 + _A99*_x3*_x5) + _A101*_x0*_x1 + _A102*_x0*_x4 + _x6**2*_A103 + _A105*_x0*_x3 + _A108*_x1*_x6 + _A109*_x0*_x5 + _A11*_x3*_x5 + _A14*_x3 + 2*_A15*_x2*_x3 + _A18*_x4 + _A20*_x3*_x6 + 2*_A24*_x1*_x2 + 2*_A27*_x2*_x5 + _A3*_x6 + _A31*_x1*_x4 + _x5**2*_A33 + _A35*_x0*_x6 + 2*_A36*_x2 + 3*_x2**2*_A38 + _A40*_x3*_x4 + 2*_A41*_x2*_x6 + _A42*_x1*_x5 + _A61*_x1 + _A70*_x0 + _x0**2*_A71 + _A72*_x5*_x6 + _A74*_x4*_x6 + _A75*_x5 + 2*_A76*_x0*_x2 + 2*_A80*_x2*_x4 + _x1**2*_A82 + _A86*_x4*_x5 + _A87*_x1*_x3 + _x4**2*_A9 + _x3**2*_A93 + _A94 + 2*_x2*(2*_A1*_x1*_x5 + _A10 + _A101*_x0*_x2 + _A108*_x2*_x6 + _x5**2*_A112 + _A113*_x3*_x4 + _A116*_x0*_x6 + 2*_A117*_x0*_x1 + _x6**2*_A12 + 2*_A13*_x1 + _A21*_x3*_x6 + _x4**2*_A22 + _x2**2*_A24 + _A31*_x2*_x4 + _A34*_x0*_x5 + _A37*_x3 + _A39*_x6 + _A4*_x3*_x5 + _A42*_x2*_x5 + _A45*_x5 + _A47*_x0*_x4 + 3*_x1**2*_A5 + _A51*_x0*_x3 + _x0**2*_A53 + _A56*_x0 + 2*_A59*_x1*_x4 + _A60*_x4*_x5 + _A61*_x2 + _x3**2*_A64 + 2*_A66*_x1*_x3 + 2*_A69*_x1*_x6 + 2*_A82*_x1*_x2 + _A87*_x2*_x3 + _A95*_x4*_x6 + _A96*_x5*_x6 + _A98*_x4) + (_x1 + 2*_x2**2)*(_A100*_x0*_x3 + _A102*_x0*_x2 + _A106*_x5*_x6 + 2*_A107*_x4*_x6 + _A110*_x6 + _A113*_x1*_x3 + _x5**2*_A115 + _A16*_x0*_x5 + 2*_A17*_x3*_x4 + _A18*_x2 + _x6**2*_A19 + 2*_A22*_x1*_x4 + _A23*_x3*_x6 + _A31*_x1*_x2 + _A40*_x2*_x3 + 2*_A46*_x0*_x4 + _A47*_x0*_x1 + _x0**2*_A48 + _x3**2*_A55 + _x1**2*_A59 + _A6*_x0*_x6 + _A60*_x1*_x5 + _A63 + _A65*_x0 + _A7*_x3*_x5 + _A74*_x2*_x6 + 2*_A79*_x4*_x5 + _x2**2*_A80 + _A84*_x3 + _A85*_x5 + _A86*_x2*_x5 + 2*_A88*_x4 + 2*_A9*_x2*_x4 + 3*_x4**2*_A91 + _A95*_x1*_x6 + _A98*_x1) + (_x0**_x1*_x1 + 2*_x0**_x1*_x2**2)*(_A100*_x0*_x4 + 2*_A104*_x3*_x5 + _A105*_x0*_x2 + _A11*_x2*_x5 + _A113*_x1*_x4 + 2*_A118*_x0*_x3 + _A119*_x0*_x5 + _A14*_x2 + _x2**2*_A15 + _x4**2*_A17 + _A20*_x2*_x6 + _A21*_x1*_x6 + _A23*_x4*_x6 + _A26*_x0*_x6 + _A29 + _A30*_x5 + _A37*_x1 + _A4*_x1*_x5 + _A40*_x2*_x4 + _x0**2*_A43 + _A50*_x6 + _A51*_x0*_x1 + _x5**2*_A54 + 2*_A55*_x3*_x4 + _A57*_x0 + 2*_A64*_x1*_x3 + _x1**2*_A66 + _A7*_x4*_x5 + 2*_A81*_x3*_x6 + _x6**2*_A83 + _A84*_x4 + _A87*_x1*_x2 + 2*_A92*_x3 + 2*_A93*_x2*_x3 + 3*_x3**2*_A97 + _A99*_x5*_x6) + (_x1*_x2*_x5 + 2*_x2**3*_x5 + _x4*_x5)*(_x1**2*_A1 + _x3**2*_A104 + _A106*_x4*_x6 + _A109*_x0*_x2 + _A11*_x2*_x3 + _A111*_x0 + 2*_A112*_x1*_x5 + _x0**2*_A114 + 2*_A115*_x4*_x5 + _A119*_x0*_x3 + _A16*_x0*_x4 + _x2**2*_A27 + _A30*_x3 + 2*_A32*_x5*_x6 + 2*_A33*_x2*_x5 + _A34*_x0*_x1 + _A4*_x1*_x3 + _A42*_x1*_x2 + 3*_x5**2*_A44 + _A45*_x1 + 2*_A49*_x5 + 2*_A54*_x3*_x5 + _A60*_x1*_x4 + _A62*_x0*_x6 + 2*_A68*_x0*_x5 + _A7*_x3*_x4 + _A72*_x2*_x6 + _A73 + _A75*_x2 + _x4**2*_A79 + _A8*_x6 + _A85*_x4 + _A86*_x2*_x4 + _x6**2*_A90 + _A96*_x1*_x6 + _A99*_x3*_x6)) - _x0**2*(_x0**2*(_A100*_x3*_x4 + _A101*_x1*_x2 + _A102*_x2*_x4 + _A105*_x2*_x3 + _A109*_x2*_x5 + _A111*_x5 + 2*_A114*_x0*_x5 + _A116*_x1*_x6 + _x1**2*_A117 + _x3**2*_A118 + _A119*_x3*_x5 + _A16*_x4*_x5 + 3*_x0**2*_A25 + _A26*_x3*_x6 + 2*_A28*_x0 + _A34*_x1*_x5 + _A35*_x2*_x6 + 2*_A43*_x0*_x3 + _x4**2*_A46 + _A47*_x1*_x4 + 2*_A48*_x0*_x4 + _A51*_x1*_x3 + 2*_A53*_x0*_x1 + _A56*_x1 + _A57*_x3 + _A6*_x4*_x6 + _A62*_x5*_x6 + _A65*_x4 + _A67 + _x5**2*_A68 + _A70*_x2 + 2*_A71*_x0*_x2 + _x2**2*_A76 + _x6**2*_A77 + 2*_A78*_x0*_x6 + _A89*_x6 + _B0) + _x0*(-_A0 - _x1**2*_A1*_x5 - _A10*_x1 - _A100*_x0*_x3*_x4 - _A101*_x0*_x1*_x2 - _A102*_x0*_x2*_x4 - _x6**2*_A103*_x2 - _x3**2*_A104*_x5 - _A105*_x0*_x2*_x3 - _A106*_x4*_x5*_x6 - _x4**2*_A107*_x6 - _A108*_x1*_x2*_x6 - _A109*_x0*_x2*_x5 - _A11*_x2*_x3*_x5 - _A110*_x4*_x6 - _A111*_x0*_x5 - _x5**2*_A112*_x1 - _A113*_x1*_x3*_x4 - _x0**2*_A114*_x5 - _x5**2*_A115*_x4 - _A116*_x0*_x1*_x6 - _x1**2*_A117*_x0 - _x3**2*_A118*_x0 - _A119*_x0*_x3*_x5 - _x6**2*_A12*_x1 - _x1**2*_A13 - _A14*_x2*_x3 - _x2**2*_A15*_x3 - _A16*_x0*_x4*_x5 - _x4**2*_A17*_x3 - _A18*_x2*_x4 - _x6**2*_A19*_x4 - _A2*_x6 - _A20*_x2*_x3*_x6 - _A21*_x1*_x3*_x6 - _x4**2*_A22*_x1 - _A23*_x3*_x4*_x6 - _x2**2*_A24*_x1 - _x0**3*_A25 - _A26*_x0*_x3*_x6 - _x2**2*_A27*_x5 - _x0**2*_A28 - _A29*_x3 - _A3*_x2*_x6 - _A30*_x3*_x5 - _A31*_x1*_x2*_x4 - _x5**2*_A32*_x6 - _x5**2*_A33*_x2 - _A34*_x0*_x1*_x5 - _A35*_x0*_x2*_x6 - _x2**2*_A36 - _A37*_x1*_x3 - _x2**3*_A38 - _A39*_x1*_x6 - _A4*_x1*_x3*_x5 - _A40*_x2*_x3*_x4 - _x2**2*_A41*_x6 - _A42*_x1*_x2*_x5 - _x0**2*_A43*_x3 - _x5**3*_A44 - _A45*_x1*_x5 - _x4**2*_A46*_x0 - _A47*_x0*_x1*_x4 - _x0**2*_A48*_x4 - _x5**2*_A49 - _x1**3*_A5 - _A50*_x3*_x6 - _A51*_x0*_x1*_x3 - _x6**3*_A52 - _x0**2*_A53*_x1 - _x5**2*_A54*_x3 - _x3**2*_A55*_x4 - _A56*_x0*_x1 - _A57*_x0*_x3 - _x6**2*_A58 - _x1**2*_A59*_x4 - _A6*_x0*_x4*_x6 - _A60*_x1*_x4*_x5 - _A61*_x1*_x2 - _A62*_x0*_x5*_x6 - _A63*_x4 - _x3**2*_A64*_x1 - _A65*_x0*_x4 - _x1**2*_A66*_x3 - _A67*_x0 - _x5**2*_A68*_x0 - _x1**2*_A69*_x6 - _A7*_x3*_x4*_x5 - _A70*_x0*_x2 - _x0**2*_A71*_x2 - _A72*_x2*_x5*_x6 - _A73*_x5 - _A74*_x2*_x4*_x6 - _A75*_x2*_x5 - _x2**2*_A76*_x0 - _x6**2*_A77*_x0 - _x0**2*_A78*_x6 - _x4**2*_A79*_x5 - _A8*_x5*_x6 - _x2**2*_A80*_x4 - _x3**2*_A81*_x6 - _x1**2*_A82*_x2 - _x6**2*_A83*_x3 - _A84*_x3*_x4 - _A85*_x4*_x5 - _A86*_x2*_x4*_x5 - _A87*_x1*_x2*_x3 - _x4**2*_A88 - _A89*_x0*_x6 - _x4**2*_A9*_x2 - _x6**2*_A90*_x5 - _x4**3*_A91 - _x3**2*_A92 - _x3**2*_A93*_x2 - _A94*_x2 - _A95*_x1*_x4*_x6 - _A96*_x1*_x5*_x6 - _x3**3*_A97 - _A98*_x1*_x4 - _A99*_x3*_x5*_x6))



I get this error message but as we know from Documentation that If integrate is unable to compute an integral, it returns an unevaluated Integral object.

What's happening ,unable to  figure out .Can anyone tell me ????

Aaron Meurer

unread,
Feb 24, 2016, 11:13:28 AM2/24/16
to sy...@googlegroups.com
That's a bug. integrate() shouldn't raise an exception.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/21f0b5ae-75ee-4c1a-b2b6-e62f6a196818%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Abhishek Verma

unread,
Feb 24, 2016, 11:30:51 AM2/24/16
to sympy
ohkk that's the bug. so want to work on this. can i work on this?? or is there someone working on  this bug??
i have added it as issue  https://github.com/sympy/sympy/issues/10680

Aaron Meurer

unread,
Feb 24, 2016, 2:13:59 PM2/24/16
to sy...@googlegroups.com
I don't think anyone else is working on this code right now.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/c46693aa-2721-4df4-92f4-0f861d62de3d%40googlegroups.com.

Abhishek Verma

unread,
Feb 25, 2016, 12:41:01 AM2/25/16
to sympy
Ohhhk thanks very much  Sir Aaron Meurer ,hope i will work to fix this bug.
can you please guide me ,how should i start??

Aaron Meurer

unread,
Feb 25, 2016, 1:55:44 PM2/25/16
to sy...@googlegroups.com
I'm not sure how easy of a bug it will be to fix. You'll need to walk
through the heurisch algorithm and figure out why it's creating a term
that isn't a polynomial.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/ec8991c4-d2fb-4ecd-a5cb-f90707a7b0bd%40googlegroups.com.

Francesco Bonazzi

unread,
Feb 25, 2016, 4:03:42 PM2/25/16
to sympy


On Thursday, 25 February 2016 06:41:01 UTC+1, Abhishek Verma wrote:
can you please guide me ,how should i start??

 Get PyCharm community edition:
https://www.jetbrains.com/pycharm/

Run your script with PyCharm's debugger, it's by far the easiest way to debug complex Python code.

Abhishek Verma

unread,
Mar 6, 2016, 4:00:08 PM3/6/16
to sympy
hii everyone as I reported about an bug unable to get the unevaluated integral object of an expression.
I found something similar to that expr= (4/(8x+1)) - (2/(8x+4)) - (1/(8x+5)) - (1/(8x+6)) * (1/16)**x  while calculating it's definite Integral in range of (0,oo) it showed an error.
I want to work on these types bugs but unable to detect to right path to fix them???

Abhishek Verma

unread,
Mar 7, 2016, 12:12:39 PM3/7/16
to sympy
Implementing (or continuing ) the work of Aaron Meurer and Chetna Gupta on implementation of Risch Algorithm for symbolic integrations,it would be my working idea for  GSOC  2016 , I have read everything as it is  given on link https://groups.google.com/forum/#!msg/sympy/bYHtVOmKEFs/UZoyDX81eP4J , discussion between
Anurag Sharma and Sir Aaron Meurer , And  Now I really got idea exactly how should I start ,I am reading Bronstein's book ,really it is self contained.

But I have very less time to get the complete Knowledge about all topics which is given in the book . I am a  Second year Computer Science Student so I have very less knowledge  related to Differential Algebra. presently I am reading this book and referring tutorials for Risch Algorithm.

I Know it's too late but  I want to make it. And I will . But I need  just Some Suggestion to,  how should go now through all of this.
 
And I also wished to know that What is present status of this Idea , Anyone working on this right now , his/her  reply would be very helpful for me.

Abhishek Verma

unread,
Mar 10, 2016, 2:10:29 AM3/10/16
to sympy
I think that issuse https://github.com/sympy/sympy/issues/10680 has been resolved , sir Aaron Meurer Can you check my pull Request .
 Thanks in advance.
cheers
 Abhishek Verma 
  
Reply all
Reply to author
Forward
0 new messages