Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------------------------------------------------------
- KeyboardInterrupt Traceback (most recent call last)
- <ipython-input-117-fefb5a1b3c31> in <module>
- ----> 1 integrand = sp.Integral(integrand,(x,-oo,oo)).doit()
- 2 display(integrand)
- ~\.conda\envs\py37\lib\site-packages\sympy\integrals\integrals.py in doit(self, **hints)
- 591 antideriv = None
- 592 else:
- --> 593 antideriv = self._eval_integral(
- 594 function, xab[0], **eval_kwargs)
- 595 if antideriv is None and meijerg is True:
- ~\.conda\envs\py37\lib\site-packages\sympy\integrals\integrals.py in _eval_integral(self, f, x, meijerg, risch, manual, heurisch, conds)
- 1077 if h is None and manual is not False:
- 1078 try:
- -> 1079 result = manualintegrate(g, x)
- 1080 if result is not None and not isinstance(result, Integral):
- 1081 if result.has(Integral) and not manual:
- ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in manualintegrate(f, var)
- 1652 sympy.integrals.integrals.Integral
- 1653 """
- -> 1654 result = _manualintegrate(integral_steps(f, var))
- 1655 # Clear the cache of u-parts
- 1656 _parts_u_cache.clear()
- ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in integral_steps(integrand, symbol, **options)
- 1287 return _integral_is_subclass
- 1288
- -> 1289 result = do_one(
- 1290 null_safe(special_function_rule),
- 1291 null_safe(switch(key, {
- ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in do_one_rl(expr)
- 83 def do_one_rl(expr):
- 84 for rl in rules:
- ---> 85 result = rl(expr)
- 86 if result != expr:
- 87 return result
- ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in do_one_rl(expr)
- 83 def do_one_rl(expr):
- 84 for rl in rules:
- ---> 85 result = rl(expr)
- 86 if result != expr:
- 87 return result
- ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in null_safe_rl(expr)
- 63 """ Return original expr if rule returns None """
- 64 def null_safe_rl(expr):
- ---> 65 result = rule(expr)
- 66 if result is None:
- 67 return expr
- ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in _alternatives(integral)
- 319 debug("Rule {}: {}".format(count, rule))
- 320
- --> 321 result = rule(integral)
- 322 if (result and not isinstance(result, DontKnowRule) and
- 323 result != integral and result not in alts):
- ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in conditioned_rl(expr)
- 31 def conditioned_rl(expr):
- 32 if cond(expr):
- ---> 33 return rule(expr)
- 34 else:
- 35 return expr
- ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in _rewriter(integral)
- 277 rewritten = rewrite(*integral)
- 278 if rewritten != integrand:
- --> 279 substep = integral_steps(rewritten, symbol)
- 280 if not isinstance(substep, DontKnowRule) and substep:
- 281 return RewriteRule(
- ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in integral_steps(integrand, symbol, **options)
- 1287 return _integral_is_subclass
- 1288
- -> 1289 result = do_one(
- 1290 null_safe(special_function_rule),
- 1291 null_safe(switch(key, {
- ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in do_one_rl(expr)
- 83 def do_one_rl(expr):
- 84 for rl in rules:
- ---> 85 result = rl(expr)
- 86 if result != expr:
- 87 return result
- ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in do_one_rl(expr)
- 83 def do_one_rl(expr):
- 84 for rl in rules:
- ---> 85 result = rl(expr)
- 86 if result != expr:
- 87 return result
- ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in null_safe_rl(expr)
- 63 """ Return original expr if rule returns None """
- 64 def null_safe_rl(expr):
- ---> 65 result = rule(expr)
- 66 if result is None:
- 67 return expr
- ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in _alternatives(integral)
- 319 debug("Rule {}: {}".format(count, rule))
- 320
- --> 321 result = rule(integral)
- 322 if (result and not isinstance(result, DontKnowRule) and
- 323 result != integral and result not in alts):
- ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in conditioned_rl(expr)
- 31 def conditioned_rl(expr):
- 32 if cond(expr):
- ---> 33 return rule(expr)
- 34 else:
- 35 return expr
- ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in _rewriter(integral)
- 277 rewritten = rewrite(*integral)
- 278 if rewritten != integrand:
- --> 279 substep = integral_steps(rewritten, symbol)
- 280 if not isinstance(substep, DontKnowRule) and substep:
- 281 return RewriteRule(
- ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in integral_steps(integrand, symbol, **options)
- 1287 return _integral_is_subclass
- 1288
- -> 1289 result = do_one(
- 1290 null_safe(special_function_rule),
- 1291 null_safe(switch(key, {
- ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in do_one_rl(expr)
- 83 def do_one_rl(expr):
- 84 for rl in rules:
- ---> 85 result = rl(expr)
- 86 if result != expr:
- 87 return result
- ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in null_safe_rl(expr)
- 63 """ Return original expr if rule returns None """
- 64 def null_safe_rl(expr):
- ---> 65 result = rule(expr)
- 66 if result is None:
- 67 return expr
- ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in switch_rl(expr)
- 93 def switch_rl(expr):
- 94 rl = ruledict.get(key(expr), identity)
- ---> 95 return rl(expr)
- 96 return switch_rl
- 97
- ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in add_rule(integral)
- 497 def add_rule(integral):
- 498 integrand, symbol = integral
- --> 499 results = [integral_steps(g, symbol)
- 500 for g in integrand.as_ordered_terms()]
- 501 return None if None in results else AddRule(results, integrand, symbol)
- ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in <listcomp>(.0)
- 497 def add_rule(integral):
- 498 integrand, symbol = integral
- --> 499 results = [integral_steps(g, symbol)
- 500 for g in integrand.as_ordered_terms()]
- 501 return None if None in results else AddRule(results, integrand, symbol)
- ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in integral_steps(integrand, symbol, **options)
- 1287 return _integral_is_subclass
- 1288
- -> 1289 result = do_one(
- 1290 null_safe(special_function_rule),
- 1291 null_safe(switch(key, {
- ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in do_one_rl(expr)
- 83 def do_one_rl(expr):
- 84 for rl in rules:
- ---> 85 result = rl(expr)
- 86 if result != expr:
- 87 return result
- ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in null_safe_rl(expr)
- 63 """ Return original expr if rule returns None """
- 64 def null_safe_rl(expr):
- ---> 65 result = rule(expr)
- 66 if result is None:
- 67 return expr
- ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in switch_rl(expr)
- 93 def switch_rl(expr):
- 94 rl = ruledict.get(key(expr), identity)
- ---> 95 return rl(expr)
- 96 return switch_rl
- 97
- ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in do_one_rl(expr)
- 83 def do_one_rl(expr):
- 84 for rl in rules:
- ---> 85 result = rl(expr)
- 86 if result != expr:
- 87 return result
- ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in null_safe_rl(expr)
- 63 """ Return original expr if rule returns None """
- 64 def null_safe_rl(expr):
- ---> 65 result = rule(expr)
- 66 if result is None:
- 67 return expr
- ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in mul_rule(integral)
- 506 # Constant times function case
- 507 coeff, f = integrand.as_independent(symbol)
- --> 508 next_step = integral_steps(f, symbol)
- 509
- 510 if coeff != 1 and next_step is not None:
- ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in integral_steps(integrand, symbol, **options)
- 1287 return _integral_is_subclass
- 1288
- -> 1289 result = do_one(
- 1290 null_safe(special_function_rule),
- 1291 null_safe(switch(key, {
- ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in do_one_rl(expr)
- 83 def do_one_rl(expr):
- 84 for rl in rules:
- ---> 85 result = rl(expr)
- 86 if result != expr:
- 87 return result
- ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in do_one_rl(expr)
- 83 def do_one_rl(expr):
- 84 for rl in rules:
- ---> 85 result = rl(expr)
- 86 if result != expr:
- 87 return result
- ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in null_safe_rl(expr)
- 63 """ Return original expr if rule returns None """
- 64 def null_safe_rl(expr):
- ---> 65 result = rule(expr)
- 66 if result is None:
- 67 return expr
- ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in _alternatives(integral)
- 319 debug("Rule {}: {}".format(count, rule))
- 320
- --> 321 result = rule(integral)
- 322 if (result and not isinstance(result, DontKnowRule) and
- 323 result != integral and result not in alts):
- ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in substitution_rule(integral)
- 1090
- 1091 u_var = sympy.Dummy("u")
- -> 1092 substitutions = find_substitutions(integrand, symbol, u_var)
- 1093 count = 0
- 1094 if substitutions:
- ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in find_substitutions(integrand, symbol, u_var)
- 258 continue
- 259 u_diff = manual_diff(u, symbol)
- --> 260 new_integrand = test_subterm(u, u_diff)
- 261 if new_integrand is not False:
- 262 constant, new_integrand = new_integrand
- ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in test_subterm(u, u_diff)
- 189 return False
- 190 debug("substituted: {}, u: {}, u_var: {}".format(substituted, u, u_var))
- --> 191 substituted = manual_subs(substituted, u, u_var).cancel()
- 192
- 193 if symbol not in substituted.free_symbols:
- ~\.conda\envs\py37\lib\site-packages\sympy\core\expr.py in cancel(self, *gens, **args)
- 3682 """See the cancel function in sympy.polys"""
- 3683 from sympy.polys import cancel
- -> 3684 return cancel(self, *gens, **args)
- 3685
- 3686 def invert(self, g, *gens, **args):
- ~\.conda\envs\py37\lib\site-packages\sympy\polys\polytools.py in cancel(f, *gens, **args)
- 6666 if f.is_Number or isinstance(f, Relational) or not isinstance(f, Expr):
- 6667 return f
- -> 6668 f = factor_terms(f, radical=True)
- 6669 p, q = f.as_numer_denom()
- 6670
- ~\.conda\envs\py37\lib\site-packages\sympy\core\exprtools.py in factor_terms(expr, radical, clear, fraction, sign)
- 1272 return rv
- 1273 expr = sympify(expr)
- -> 1274 return do(expr)
- 1275
- 1276
- ~\.conda\envs\py37\lib\site-packages\sympy\core\exprtools.py in do(expr)
- 1268 elif p.args:
- 1269 p = p.func(
- -> 1270 *[do(a) for a in p.args])
- 1271 rv = _keep_coeff(cont, p, clear=clear, sign=sign)
- 1272 return rv
- ~\.conda\envs\py37\lib\site-packages\sympy\core\exprtools.py in <listcomp>(.0)
- 1268 elif p.args:
- 1269 p = p.func(
- -> 1270 *[do(a) for a in p.args])
- 1271 rv = _keep_coeff(cont, p, clear=clear, sign=sign)
- 1272 return rv
- ~\.conda\envs\py37\lib\site-packages\sympy\core\exprtools.py in do(expr)
- 1235 is_iterable or not hasattr(expr, 'args_cnc'):
- 1236 args = expr.args
- -> 1237 newargs = tuple([do(i) for i in args])
- 1238 if newargs == args:
- 1239 return expr
- ~\.conda\envs\py37\lib\site-packages\sympy\core\exprtools.py in <listcomp>(.0)
- 1235 is_iterable or not hasattr(expr, 'args_cnc'):
- 1236 args = expr.args
- -> 1237 newargs = tuple([do(i) for i in args])
- 1238 if newargs == args:
- 1239 return expr
- ~\.conda\envs\py37\lib\site-packages\sympy\core\exprtools.py in do(expr)
- 1247 cont, p = expr.as_content_primitive(radical=radical, clear=clear)
- 1248 if p.is_Add:
- -> 1249 list_args = [do(a) for a in Add.make_args(p)]
- 1250 # get a common negative (if there) which gcd_terms does not remove
- 1251 if all(a.as_coeff_Mul()[0].extract_multiplicatively(-1) is not None
- ~\.conda\envs\py37\lib\site-packages\sympy\core\exprtools.py in <listcomp>(.0)
- 1247 cont, p = expr.as_content_primitive(radical=radical, clear=clear)
- 1248 if p.is_Add:
- -> 1249 list_args = [do(a) for a in Add.make_args(p)]
- 1250 # get a common negative (if there) which gcd_terms does not remove
- 1251 if all(a.as_coeff_Mul()[0].extract_multiplicatively(-1) is not None
- ~\.conda\envs\py37\lib\site-packages\sympy\core\exprtools.py in do(expr)
- 1245 fraction=fraction, sign=sign)
- 1246
- -> 1247 cont, p = expr.as_content_primitive(radical=radical, clear=clear)
- 1248 if p.is_Add:
- 1249 list_args = [do(a) for a in Add.make_args(p)]
- ~\.conda\envs\py37\lib\site-packages\sympy\core\mul.py in as_content_primitive(self, radical, clear)
- 1897 args = []
- 1898 for i, a in enumerate(self.args):
- -> 1899 c, p = a.as_content_primitive(radical=radical, clear=clear)
- 1900 coef *= c
- 1901 if p is not S.One:
- ~\.conda\envs\py37\lib\site-packages\sympy\core\power.py in as_content_primitive(self, radical, clear)
- 1672 """
- 1673
- -> 1674 b, e = self.as_base_exp()
- 1675 b = _keep_coeff(*b.as_content_primitive(radical=radical, clear=clear))
- 1676 ce, pe = e.as_content_primitive(radical=radical, clear=clear)
- ~\.conda\envs\py37\lib\site-packages\sympy\core\power.py in as_base_exp(self)
- 893 """
- 894
- --> 895 b, e = self.args
- 896 if b.is_Rational and b.p == 1 and b.q != 1:
- 897 return Integer(b.q), -e
- KeyboardInterrupt:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement