bc[r_, x_] := r + x^2;
"NIntegrate symbolically analyzes its input to transform oscillatory
and other integrands, subdivide piecewise functions, and select
optimal algorithms." Since sol uses numerical techniques it must be
restricted to numerical inputs.
sol[r_?NumericQ] :=
Re[x /. FindRoot[bc[r, x] == 0,
{x, 1.1` + I}]];
NIntegrate[sol[r], {r, 1, 8}]
1.28089*10^-18
sol2[r_] = Re[x /. Solve[bc[r, x] == 0, x]]
{Im[Sqrt[r]], -Im[Sqrt[r]]}
Integrate[sol2[r], {r, 1, 8}]
{0, 0}
Bob Hanlon
On Sat, Aug 18, 2012 at 3:47 AM, S-Tat <
kravc...@gmail.com> wrote:
> Hi everyone,
>
> I have a simple question. There is my code, it integrates a function which is a solution of the equation:
>
> bc[r_, x_] := r + x^2;
> sol[r_] := Re[x /. FindRoot[bc[r, x] == 0, {x, 1.1 + I}]];
> NIntegrate[sol[r], {r, 1, 8}]
>
>