Skip to main content
added 12 characters in body
Source Link
Dr. belisarius
  • 116.8k
  • 13
  • 208
  • 466

Not sure about what you're trying to do, but this doesn't bring up errors:

ClearAll[f]; f[a_?NumericQ] := x /. FindRoot[x^2 - 1 == a, {x, a - 1, a + 1}] NIntegrate[f[z], {z, 0, 5}] (* -> 9.13129 *) 

Edit

The result is (of course) equivalent to

Integrate[Sqrt[1 + z], {z, 0, 5}] (* -> -(2/3) + 4 Sqrt[6] *) 

Not sure about what you're trying to do, but this doesn't bring up errors:

ClearAll[f]; f[a_?NumericQ] := x /. FindRoot[x^2 - 1 == a, {x, a - 1, a + 1}] NIntegrate[f[z], {z, 0, 5}] (* -> 9.13129 *) 

Edit

The result is equivalent to

Integrate[Sqrt[1 + z], {z, 0, 5}] (* -> -(2/3) + 4 Sqrt[6] *) 

Not sure about what you're trying to do, but this doesn't bring up errors:

ClearAll[f]; f[a_?NumericQ] := x /. FindRoot[x^2 - 1 == a, {x, a - 1, a + 1}] NIntegrate[f[z], {z, 0, 5}] (* -> 9.13129 *) 

Edit

The result is (of course) equivalent to

Integrate[Sqrt[1 + z], {z, 0, 5}] (* -> -(2/3) + 4 Sqrt[6] *) 
added 34 characters in body
Source Link
Dr. belisarius
  • 116.8k
  • 13
  • 208
  • 466

Not sure about what you're trying to do, but this doesn't bring up errors:

ClearAll[f]; f[a_?NumericQ] := x /. FindRoot[x^2 - 1 == a, {x, a - 1, a + 1}] NIntegrate[f[z], {z, 0, 5}]   (* -> 9.13129 *) 

Edit

The result is equivalent to

Integrate[Sqrt[1 + z], {z, 0, 5}] (* -> -(2/3) + 4 Sqrt[6] *) 

Not sure about what you're trying to do, but this doesn't bring up errors:

ClearAll[f]; f[a_?NumericQ] := x /. FindRoot[x^2 - 1 == a, {x, a - 1, a + 1}] NIntegrate[f[z], {z, 0, 5}] 

Not sure about what you're trying to do, but this doesn't bring up errors:

ClearAll[f]; f[a_?NumericQ] := x /. FindRoot[x^2 - 1 == a, {x, a - 1, a + 1}] NIntegrate[f[z], {z, 0, 5}]   (* -> 9.13129 *) 

Edit

The result is equivalent to

Integrate[Sqrt[1 + z], {z, 0, 5}] (* -> -(2/3) + 4 Sqrt[6] *) 
Source Link
Dr. belisarius
  • 116.8k
  • 13
  • 208
  • 466

Not sure about what you're trying to do, but this doesn't bring up errors:

ClearAll[f]; f[a_?NumericQ] := x /. FindRoot[x^2 - 1 == a, {x, a - 1, a + 1}] NIntegrate[f[z], {z, 0, 5}]