Mukhtar Bekkali wrote:
> I am confused why NIntegrate misbehaves on such a simple function as
> mine.
>
> Here is what I have:
>
> In:
>
> f=D[1/(1+(1+(a-b)^2)),a];
> g=Integrate[f*b*(1-b)^2,{b,0,1},Assumptions->0<a<1];
> FindRoot[g==0,{a,0,1}]
>
> Out:
>
> a->0.397207
>
> However, since Integrate takes long, I tried to use NIntegrate
> instead and this is what I get
>
> In:
>
> f=D[1/(1+(1+(a-b)^2)),a];
> g:=NIntegrate[f*b*(1-b)^2,{b,0,1}];
> FindRoot[g==0,{a,0,1}]
>
> Out:
>
> a->1
>
> or, FindRoot+NIntegrate give me the upper boundary of a. If I
> abandon the secant method and turn to Newton, i.e. use
> FindRoot[g==0,{a,0.5}] instead then I get the message that Jacobian is
> singular at a=0.5 and get no solution. Perturbing the starting value
> of a does not help.
>
> What is going on here?
My guess is that NIntegrate does not do problems with symbolic parameters,
and yet you are trying to make it calculate the integral of an expression
involving a, with no numerical value for a defined.
--
Curt Fischer
> PS. Is there a way to get M5 to tackle the problem where:
> (1) I define some function f[x]:=NIntegrate[g[x,y],{y,0,1}], then
> (2) take the derivative of f[x] with respect to x, say h[x]:=f'[x]
> and then (3) Use FindRoot to find x such that h[x]==0