2
$\begingroup$

I have an equation:

$$ \frac{1}{g}=\int_0^{\frac{1}{\delta}\sinh \frac{1}{g}} \frac{\tanh\left(0.882\, b\,\delta\sqrt{1+z^2}\right)}{\sqrt{1+z^2}}\mathrm{d}z $$

I want to obtain the relation $b\,\delta)$, where $b>1$ and also $1>\delta>0$. Suppose we have $g=0.26$.

The problem is that, when I fix $g$, given a numerical value of $\delta$, trying to solve for $b$, Mathematica complains about the non-numerical value of the integrand. How can I overcome this? Here is the code I've tried:

g = 0.26;
fF[g_, b_, δ_] := 
  -1/g + 
    NIntegrate[Tanh[0.882*b*δ*Sqrt[1 + z^2]]/Sqrt[1 + z^2], {z, 0, Sinh[1/g]/δ}]
NSolve[fF[g, b, 0.2] == 0, b]

P.S.: the equation is essentially from a post on PSE.

$\endgroup$
  • 1
    $\begingroup$ try FindRoot , and define your function to take only numeric values fF[g_?NumericQ, b_?NumericQ, \[Delta]_?NumericQ] $\endgroup$ – george2079 Oct 23 '15 at 16:33
  • 1
    $\begingroup$ actually just the NumericQ does the trick. NSolve works and is faster than FindRoot $\endgroup$ – george2079 Oct 23 '15 at 16:44
  • $\begingroup$ g = 0.26; fF[g_?NumericQ, b_?NumericQ, \[Delta]_?NumericQ] := -1/g + NIntegrate[ Tanh[0.882*b*\[Delta]*Sqrt[1 + z^2]]/Sqrt[1 + z^2], {z, 0, Sinh[1/g]/\[Delta]}] FindRoot[fF[g, b, 0.2] == 0, {b, 1}] gives you (* {b -> 1.01398} *) $\endgroup$ – Dr. belisarius Oct 23 '15 at 17:14
  • $\begingroup$ @belisariusisforth It get the value, however complains:"Inverse functions are being used by NSolve, so some solutions may not \ be found; use Reduce for complete solution information. " How to get rid of that? $\endgroup$ – an offer can't refuse Oct 24 '15 at 1:04
  • $\begingroup$ Are you using this code?g = 0.26; fF[g_?NumericQ, b_?NumericQ, \[Delta]_?NumericQ] := -1/g + NIntegrate[ Tanh[0.882*b*\[Delta]*Sqrt[1 + z^2]]/Sqrt[1 + z^2], {z, 0, Sinh[1/g]/\[Delta]}] ; FindRoot[fF[g, b, 0.2] == 0, {b, 1}] $\endgroup$ – Dr. belisarius Oct 24 '15 at 1:08