| 1 | initial version |
Your params=[5] seems to indicate that you want the second parameter of fto be 5, but this is highly ambiguous, and depending of the original definition of f : what if f was defined with a default ? What if y was a keyword parameter ?
An unambiguous way to get the same result is :
sage: numerical_integral(lambda u:f(u,5), 0, pi) (-1.6781430581529053, 2.2206773047754592e-14)
The anonymous function has exactly one parameter, and so does numerical_integral of this function.
HTH,
| 2 | No.2 Revision |
Your params=[5] seems to indicate that you want the second parameter of fto be 5, but this is highly ambiguous, and depending of the original definition of f : what if f was defined with a default ? What if y was a keyword parameter ?
An unambiguous way to get the same result is :
sage: numerical_integral(lambda u:f(u,5), 0, pi)
(-1.6781430581529053, The anonymous function has exactly one parameter, and so does numerical_integral of this function.
HTH,
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.