0
$\begingroup$

I have to solve the following equation a Tanh[z-b] = z, with a and b parameters and z the unknown.

With a and b known I can use FindRoot. But letting a and b as unknown parameters, I don't know how to solve these type of equations.

Thank you in advance.

$\endgroup$
3
  • $\begingroup$ The equation has no analytic solution. Only numerics work here... (unless you want some asymptotic solution for, say, very small a or something like that) $\endgroup$ Commented Jul 3, 2019 at 23:32
  • $\begingroup$ Thank you very much for you answers. I was searching for parametric solutions like z =f(a,b), maybe just for some regimes like small a like AccidentalFourierTransform suggested, if nothing else could be done. $\endgroup$ Commented Jul 4, 2019 at 7:17
  • $\begingroup$ Your equation has a solution in terms of a generalized Lambert function $z=b+W(a-b;-a-b;1)$. See arxiv.org/pdf/1505.01555 $\endgroup$
    – yarchik
    Commented Jul 4, 2019 at 7:22

2 Answers 2

1
$\begingroup$

The equation is a typical example of a transcendental equation and, as such, it has no analytic solution for symbolic $a,b$. That being said, it does admit an asymptotic expansion for small $a$ (or large $b$), which converges rapidly enough: $$ z_\star=\tanh(b) \sum_{i=1}^\infty P_i(\operatorname{sech}(b)) a^i $$ where the polynomials $P_i$ are given by $$ \begin{aligned} P_1(x)&=-1\\ P_2(x)&=-x^2\\ P_3(x)&=x^2 - 2 x^4\\ &\cdots \end{aligned} $$

P[1][x_] := -1;
P[2][x_] := -x^2;
P[3][x_] := x^2 - 2 x^4;
P[4][x_] := -((2 x^2)/3) + (14 x^4)/3 - 5 x^6;
P[5][x_] := x^2/3 - (19 x^4)/3 + 19 x^6 - 14 x^8;
P[6][x_] := -((2 x^2)/15) + (94 x^4)/15 - (199 x^6)/5 + (224 x^8)/3 - 42 x^10;
P[7][x_] := 1/45 x^2 (2 - 222 x^2 + 2673 x^4 - 9608 x^6 + 13050 x^8 - 5940 x^10);
P[8][x_] := 1/315 x^2 (-4 + x^2 (1020 - 11 x^2 (1998 + x^2 (-12272 + 945 x^2 (32 - 34 x^2 + 13 x^4)))));
P[9][x_] := 1/315 (x^2 - 575 x^4 + 21417 x^6 - 211423 x^8 + 841685 x^10 - 1567335 x^12 + 1366365 x^14 - 450450 x^16);


a Tanh[z - b] == z /. z -> Tanh[b] Sum[P[i][Sech[b]] a^i, {i, 1, 9}] + O[a]^10 // Simplify

--

For example, if we take $a=1/\pi$ and $b=e$, then the numerical solution is $z_\star=-0.316842\dots$, to be compared with the four first truncations of the asymptotic solution: $$ \color{red}{-0.31}5550\\ \color{red}{-0.31}7284\\ \color{red}{-0.316}751\\ \color{red}{-0.3168}54\\ $$

--

FWIW, it appears that $$ \begin{aligned} P_j(x)&=-\frac{2^{2j-2} \left(\frac{1}{2}\right)_{j-1} }{j!}x^{2 j-2}\\ &+\frac{2^{2 j-5} (j-2) (5 j-6) \left(\frac{3}{2}\right)_{j-3} }{3 j!}x^{2 j-4}\\ &-\frac{2^{2 j-9} (j-3) \left(125 j^3-783 j^2+1552 j-960\right) \left(\frac{5}{2}\right)_{j-5} }{15 j!}x^{2 j-6}+\cdots \end{aligned} $$ where $(\alpha)_\beta$ denotes the Pochhammer function. It would be interesting to study whether one can find the general form of $P_j$ and, perhaps, resum the series.

$\endgroup$
0
$\begingroup$

If you know the parameterranges, ContourPlot3D easily shows possible solutions

ContourPlot3D[a Tanh[z - b] == z, {a, 0, 1}, {b, 0, 5}, {z, -1, 0},AxesLabel -> {a, b, z}]    

enter image description here

numerical solution

solN[a_?NumericQ, b_?NumericQ] :=z /. NSolve[{a Tanh[z - b] == z, -5 < z < 5}, z][[1]]  (*needs a z-range*)
solN[1/Pi, E] 
(* -0.316842 *)

or

sol[a_?NumericQ, b_?NumericQ] :=z /. NMinimize[{1, a Tanh[z - b] == z}, z][[2]]
sol[1/Pi, E]
(* -0.316842 *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.