Is it possible to apply fsolve method for an integral with the unknown in the upper limit and in the integrand??? I am ussing quad method for integration in python.
Thanks in advance!!!
Is it possible to apply fsolve method for an integral with the unknown in the upper limit and in the integrand??? I am ussing quad method for integration in python.
Thanks in advance!!!
Sure.
Suppose you want to find x such that the integral over t from t=0 to t=x of t*(1-x*t) is 0. You can do this by defining two functions.
integrand(t, x)
will evaluate t*(1-x*t), andfunc(x)
will integrateintegrand
usingquad
, withx
as both the upper limit of the integration, and as the extra argument of the integrand. Here's a demo:Output: