# HG changeset patch
# User KarlDieter Crisman <kcrisman@gmail.com>
# Date 1254232002 14400
# Node ID 7d6c4a5e23a638661101833a89fdb02f334e3251
# Parent 3429495f2a434e75015ad53111da60404ac23b9f
Verify that numerical approximation bug in integration in Trac 6189 is fixed.
diff r 3429495f2a43 r 7d6c4a5e23a6 sage/calculus/calculus.py
a

b


562  562  (0.66951170887280698, 7.7686781108547113e15) 
563  563  sage: res.subs(y=.5).n() 
564  564  0.669511708873 
 565  
 566  Check if #6189 is fixed (which, by the way, also 
 567  demonstrates it's not always good to expand):: 
 568  
 569  sage: n = N; n 
 570  <function numerical_approx at ...> 
 571  sage: F(x) = 1/sqrt(2*pi*1^2)*exp(1/(2*1^2)*(x0)^2) 
 572  sage: G(x) = 1/sqrt(2*pi*n(1)^2)*exp(1/(2*n(1)^2)*(xn(0))^2) 
 573  sage: integrate( (F(x)F(x))^2, x, infinity, infinity).n() 
 574  0.000000000000000 
 575  sage: integrate( ((F(x)G(x))^2).expand(), x, infinity, infinity).n() 
 576  6.26376265908397e17 
 577  sage: integrate( (F(x)G(x))^2, x, infinity, infinity).n() 
 578  0 
565  579  """ 
566  580  if b is None and a is not None: 
567  581  # two arguments, must be endpoints 