Ask Your Question

Revision history [back]

click to hide/show revision 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,

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)

2.2206773047754592e-14)

The anonymous function has exactly one parameter, and so does numerical_integral of this function.

HTH,