1 | initial version |
Here's an example that I think does what you want. Notice in particular that numerical_integral
returns a tuple (ans, err)
so you need to extract the zero-th component of it before using it in find_root
.
sage: F(u,z) = sin(z+u)
sage: find_root(lambda w: numerical_integral(lambda v: F(w, v),-pi/2,pi/2)[0], pi/2, 3*pi/2)
3.141592653589793