Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2020
43
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ---------------------------------------------------------------------------
  2. KeyboardInterrupt Traceback (most recent call last)
  3. <ipython-input-117-fefb5a1b3c31> in <module>
  4. ----> 1 integrand = sp.Integral(integrand,(x,-oo,oo)).doit()
  5. 2 display(integrand)
  6.  
  7. ~\.conda\envs\py37\lib\site-packages\sympy\integrals\integrals.py in doit(self, **hints)
  8. 591 antideriv = None
  9. 592 else:
  10. --> 593 antideriv = self._eval_integral(
  11. 594 function, xab[0], **eval_kwargs)
  12. 595 if antideriv is None and meijerg is True:
  13.  
  14. ~\.conda\envs\py37\lib\site-packages\sympy\integrals\integrals.py in _eval_integral(self, f, x, meijerg, risch, manual, heurisch, conds)
  15. 1077 if h is None and manual is not False:
  16. 1078 try:
  17. -> 1079 result = manualintegrate(g, x)
  18. 1080 if result is not None and not isinstance(result, Integral):
  19. 1081 if result.has(Integral) and not manual:
  20.  
  21. ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in manualintegrate(f, var)
  22. 1652 sympy.integrals.integrals.Integral
  23. 1653 """
  24. -> 1654 result = _manualintegrate(integral_steps(f, var))
  25. 1655 # Clear the cache of u-parts
  26. 1656 _parts_u_cache.clear()
  27.  
  28. ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in integral_steps(integrand, symbol, **options)
  29. 1287 return _integral_is_subclass
  30. 1288
  31. -> 1289 result = do_one(
  32. 1290 null_safe(special_function_rule),
  33. 1291 null_safe(switch(key, {
  34.  
  35. ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in do_one_rl(expr)
  36. 83 def do_one_rl(expr):
  37. 84 for rl in rules:
  38. ---> 85 result = rl(expr)
  39. 86 if result != expr:
  40. 87 return result
  41.  
  42. ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in do_one_rl(expr)
  43. 83 def do_one_rl(expr):
  44. 84 for rl in rules:
  45. ---> 85 result = rl(expr)
  46. 86 if result != expr:
  47. 87 return result
  48.  
  49. ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in null_safe_rl(expr)
  50. 63 """ Return original expr if rule returns None """
  51. 64 def null_safe_rl(expr):
  52. ---> 65 result = rule(expr)
  53. 66 if result is None:
  54. 67 return expr
  55.  
  56. ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in _alternatives(integral)
  57. 319 debug("Rule {}: {}".format(count, rule))
  58. 320
  59. --> 321 result = rule(integral)
  60. 322 if (result and not isinstance(result, DontKnowRule) and
  61. 323 result != integral and result not in alts):
  62.  
  63. ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in conditioned_rl(expr)
  64. 31 def conditioned_rl(expr):
  65. 32 if cond(expr):
  66. ---> 33 return rule(expr)
  67. 34 else:
  68. 35 return expr
  69.  
  70. ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in _rewriter(integral)
  71. 277 rewritten = rewrite(*integral)
  72. 278 if rewritten != integrand:
  73. --> 279 substep = integral_steps(rewritten, symbol)
  74. 280 if not isinstance(substep, DontKnowRule) and substep:
  75. 281 return RewriteRule(
  76.  
  77. ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in integral_steps(integrand, symbol, **options)
  78. 1287 return _integral_is_subclass
  79. 1288
  80. -> 1289 result = do_one(
  81. 1290 null_safe(special_function_rule),
  82. 1291 null_safe(switch(key, {
  83.  
  84. ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in do_one_rl(expr)
  85. 83 def do_one_rl(expr):
  86. 84 for rl in rules:
  87. ---> 85 result = rl(expr)
  88. 86 if result != expr:
  89. 87 return result
  90.  
  91. ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in do_one_rl(expr)
  92. 83 def do_one_rl(expr):
  93. 84 for rl in rules:
  94. ---> 85 result = rl(expr)
  95. 86 if result != expr:
  96. 87 return result
  97.  
  98. ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in null_safe_rl(expr)
  99. 63 """ Return original expr if rule returns None """
  100. 64 def null_safe_rl(expr):
  101. ---> 65 result = rule(expr)
  102. 66 if result is None:
  103. 67 return expr
  104.  
  105. ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in _alternatives(integral)
  106. 319 debug("Rule {}: {}".format(count, rule))
  107. 320
  108. --> 321 result = rule(integral)
  109. 322 if (result and not isinstance(result, DontKnowRule) and
  110. 323 result != integral and result not in alts):
  111.  
  112. ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in conditioned_rl(expr)
  113. 31 def conditioned_rl(expr):
  114. 32 if cond(expr):
  115. ---> 33 return rule(expr)
  116. 34 else:
  117. 35 return expr
  118.  
  119. ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in _rewriter(integral)
  120. 277 rewritten = rewrite(*integral)
  121. 278 if rewritten != integrand:
  122. --> 279 substep = integral_steps(rewritten, symbol)
  123. 280 if not isinstance(substep, DontKnowRule) and substep:
  124. 281 return RewriteRule(
  125.  
  126. ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in integral_steps(integrand, symbol, **options)
  127. 1287 return _integral_is_subclass
  128. 1288
  129. -> 1289 result = do_one(
  130. 1290 null_safe(special_function_rule),
  131. 1291 null_safe(switch(key, {
  132.  
  133. ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in do_one_rl(expr)
  134. 83 def do_one_rl(expr):
  135. 84 for rl in rules:
  136. ---> 85 result = rl(expr)
  137. 86 if result != expr:
  138. 87 return result
  139.  
  140. ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in null_safe_rl(expr)
  141. 63 """ Return original expr if rule returns None """
  142. 64 def null_safe_rl(expr):
  143. ---> 65 result = rule(expr)
  144. 66 if result is None:
  145. 67 return expr
  146.  
  147. ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in switch_rl(expr)
  148. 93 def switch_rl(expr):
  149. 94 rl = ruledict.get(key(expr), identity)
  150. ---> 95 return rl(expr)
  151. 96 return switch_rl
  152. 97
  153.  
  154. ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in add_rule(integral)
  155. 497 def add_rule(integral):
  156. 498 integrand, symbol = integral
  157. --> 499 results = [integral_steps(g, symbol)
  158. 500 for g in integrand.as_ordered_terms()]
  159. 501 return None if None in results else AddRule(results, integrand, symbol)
  160.  
  161. ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in <listcomp>(.0)
  162. 497 def add_rule(integral):
  163. 498 integrand, symbol = integral
  164. --> 499 results = [integral_steps(g, symbol)
  165. 500 for g in integrand.as_ordered_terms()]
  166. 501 return None if None in results else AddRule(results, integrand, symbol)
  167.  
  168. ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in integral_steps(integrand, symbol, **options)
  169. 1287 return _integral_is_subclass
  170. 1288
  171. -> 1289 result = do_one(
  172. 1290 null_safe(special_function_rule),
  173. 1291 null_safe(switch(key, {
  174.  
  175. ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in do_one_rl(expr)
  176. 83 def do_one_rl(expr):
  177. 84 for rl in rules:
  178. ---> 85 result = rl(expr)
  179. 86 if result != expr:
  180. 87 return result
  181.  
  182. ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in null_safe_rl(expr)
  183. 63 """ Return original expr if rule returns None """
  184. 64 def null_safe_rl(expr):
  185. ---> 65 result = rule(expr)
  186. 66 if result is None:
  187. 67 return expr
  188.  
  189. ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in switch_rl(expr)
  190. 93 def switch_rl(expr):
  191. 94 rl = ruledict.get(key(expr), identity)
  192. ---> 95 return rl(expr)
  193. 96 return switch_rl
  194. 97
  195.  
  196. ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in do_one_rl(expr)
  197. 83 def do_one_rl(expr):
  198. 84 for rl in rules:
  199. ---> 85 result = rl(expr)
  200. 86 if result != expr:
  201. 87 return result
  202.  
  203. ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in null_safe_rl(expr)
  204. 63 """ Return original expr if rule returns None """
  205. 64 def null_safe_rl(expr):
  206. ---> 65 result = rule(expr)
  207. 66 if result is None:
  208. 67 return expr
  209.  
  210. ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in mul_rule(integral)
  211. 506 # Constant times function case
  212. 507 coeff, f = integrand.as_independent(symbol)
  213. --> 508 next_step = integral_steps(f, symbol)
  214. 509
  215. 510 if coeff != 1 and next_step is not None:
  216.  
  217. ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in integral_steps(integrand, symbol, **options)
  218. 1287 return _integral_is_subclass
  219. 1288
  220. -> 1289 result = do_one(
  221. 1290 null_safe(special_function_rule),
  222. 1291 null_safe(switch(key, {
  223.  
  224. ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in do_one_rl(expr)
  225. 83 def do_one_rl(expr):
  226. 84 for rl in rules:
  227. ---> 85 result = rl(expr)
  228. 86 if result != expr:
  229. 87 return result
  230.  
  231. ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in do_one_rl(expr)
  232. 83 def do_one_rl(expr):
  233. 84 for rl in rules:
  234. ---> 85 result = rl(expr)
  235. 86 if result != expr:
  236. 87 return result
  237.  
  238. ~\.conda\envs\py37\lib\site-packages\sympy\strategies\core.py in null_safe_rl(expr)
  239. 63 """ Return original expr if rule returns None """
  240. 64 def null_safe_rl(expr):
  241. ---> 65 result = rule(expr)
  242. 66 if result is None:
  243. 67 return expr
  244.  
  245. ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in _alternatives(integral)
  246. 319 debug("Rule {}: {}".format(count, rule))
  247. 320
  248. --> 321 result = rule(integral)
  249. 322 if (result and not isinstance(result, DontKnowRule) and
  250. 323 result != integral and result not in alts):
  251.  
  252. ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in substitution_rule(integral)
  253. 1090
  254. 1091 u_var = sympy.Dummy("u")
  255. -> 1092 substitutions = find_substitutions(integrand, symbol, u_var)
  256. 1093 count = 0
  257. 1094 if substitutions:
  258.  
  259. ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in find_substitutions(integrand, symbol, u_var)
  260. 258 continue
  261. 259 u_diff = manual_diff(u, symbol)
  262. --> 260 new_integrand = test_subterm(u, u_diff)
  263. 261 if new_integrand is not False:
  264. 262 constant, new_integrand = new_integrand
  265.  
  266. ~\.conda\envs\py37\lib\site-packages\sympy\integrals\manualintegrate.py in test_subterm(u, u_diff)
  267. 189 return False
  268. 190 debug("substituted: {}, u: {}, u_var: {}".format(substituted, u, u_var))
  269. --> 191 substituted = manual_subs(substituted, u, u_var).cancel()
  270. 192
  271. 193 if symbol not in substituted.free_symbols:
  272.  
  273. ~\.conda\envs\py37\lib\site-packages\sympy\core\expr.py in cancel(self, *gens, **args)
  274. 3682 """See the cancel function in sympy.polys"""
  275. 3683 from sympy.polys import cancel
  276. -> 3684 return cancel(self, *gens, **args)
  277. 3685
  278. 3686 def invert(self, g, *gens, **args):
  279.  
  280. ~\.conda\envs\py37\lib\site-packages\sympy\polys\polytools.py in cancel(f, *gens, **args)
  281. 6666 if f.is_Number or isinstance(f, Relational) or not isinstance(f, Expr):
  282. 6667 return f
  283. -> 6668 f = factor_terms(f, radical=True)
  284. 6669 p, q = f.as_numer_denom()
  285. 6670
  286.  
  287. ~\.conda\envs\py37\lib\site-packages\sympy\core\exprtools.py in factor_terms(expr, radical, clear, fraction, sign)
  288. 1272 return rv
  289. 1273 expr = sympify(expr)
  290. -> 1274 return do(expr)
  291. 1275
  292. 1276
  293.  
  294. ~\.conda\envs\py37\lib\site-packages\sympy\core\exprtools.py in do(expr)
  295. 1268 elif p.args:
  296. 1269 p = p.func(
  297. -> 1270 *[do(a) for a in p.args])
  298. 1271 rv = _keep_coeff(cont, p, clear=clear, sign=sign)
  299. 1272 return rv
  300.  
  301. ~\.conda\envs\py37\lib\site-packages\sympy\core\exprtools.py in <listcomp>(.0)
  302. 1268 elif p.args:
  303. 1269 p = p.func(
  304. -> 1270 *[do(a) for a in p.args])
  305. 1271 rv = _keep_coeff(cont, p, clear=clear, sign=sign)
  306. 1272 return rv
  307.  
  308. ~\.conda\envs\py37\lib\site-packages\sympy\core\exprtools.py in do(expr)
  309. 1235 is_iterable or not hasattr(expr, 'args_cnc'):
  310. 1236 args = expr.args
  311. -> 1237 newargs = tuple([do(i) for i in args])
  312. 1238 if newargs == args:
  313. 1239 return expr
  314.  
  315. ~\.conda\envs\py37\lib\site-packages\sympy\core\exprtools.py in <listcomp>(.0)
  316. 1235 is_iterable or not hasattr(expr, 'args_cnc'):
  317. 1236 args = expr.args
  318. -> 1237 newargs = tuple([do(i) for i in args])
  319. 1238 if newargs == args:
  320. 1239 return expr
  321.  
  322. ~\.conda\envs\py37\lib\site-packages\sympy\core\exprtools.py in do(expr)
  323. 1247 cont, p = expr.as_content_primitive(radical=radical, clear=clear)
  324. 1248 if p.is_Add:
  325. -> 1249 list_args = [do(a) for a in Add.make_args(p)]
  326. 1250 # get a common negative (if there) which gcd_terms does not remove
  327. 1251 if all(a.as_coeff_Mul()[0].extract_multiplicatively(-1) is not None
  328.  
  329. ~\.conda\envs\py37\lib\site-packages\sympy\core\exprtools.py in <listcomp>(.0)
  330. 1247 cont, p = expr.as_content_primitive(radical=radical, clear=clear)
  331. 1248 if p.is_Add:
  332. -> 1249 list_args = [do(a) for a in Add.make_args(p)]
  333. 1250 # get a common negative (if there) which gcd_terms does not remove
  334. 1251 if all(a.as_coeff_Mul()[0].extract_multiplicatively(-1) is not None
  335.  
  336. ~\.conda\envs\py37\lib\site-packages\sympy\core\exprtools.py in do(expr)
  337. 1245 fraction=fraction, sign=sign)
  338. 1246
  339. -> 1247 cont, p = expr.as_content_primitive(radical=radical, clear=clear)
  340. 1248 if p.is_Add:
  341. 1249 list_args = [do(a) for a in Add.make_args(p)]
  342.  
  343. ~\.conda\envs\py37\lib\site-packages\sympy\core\mul.py in as_content_primitive(self, radical, clear)
  344. 1897 args = []
  345. 1898 for i, a in enumerate(self.args):
  346. -> 1899 c, p = a.as_content_primitive(radical=radical, clear=clear)
  347. 1900 coef *= c
  348. 1901 if p is not S.One:
  349.  
  350. ~\.conda\envs\py37\lib\site-packages\sympy\core\power.py in as_content_primitive(self, radical, clear)
  351. 1672 """
  352. 1673
  353. -> 1674 b, e = self.as_base_exp()
  354. 1675 b = _keep_coeff(*b.as_content_primitive(radical=radical, clear=clear))
  355. 1676 ce, pe = e.as_content_primitive(radical=radical, clear=clear)
  356.  
  357. ~\.conda\envs\py37\lib\site-packages\sympy\core\power.py in as_base_exp(self)
  358. 893 """
  359. 894
  360. --> 895 b, e = self.args
  361. 896 if b.is_Rational and b.p == 1 and b.q != 1:
  362. 897 return Integer(b.q), -e
  363.  
  364. KeyboardInterrupt:
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement