I need to find the limit of an integral in a numerical way, knowing the result of that integral. What I need to solve is:
As you can see, that is the incomplete beta function. I know a
, b
and c
. And the integral limits are from 0
to x
. I need to find x
.
The
fzero
function can solve all sorts of nonlinear equations.First, calculate the incomplete beta function as a function of
X
(I subtracted thec
because we want to find thex
that makesY=0
):or, without using the builtin
betainc
function, and instead using symbolic algebra:Now use
fzero
, sincex
must be between 0 and 1, we constrain the solution to be within[0 1]
:If
fzero
doesn't work, the simplest numerical method to try is a bisection search. It's easy, and works well here, so why not use it. I did assume thatY(x)
is monotonically increasing on[0 1]
, but I think that's always the case.