4

How can I solve this equation:

((a^2 - 1)*((a^2 - 1)*ArcTanh[a] - a))/(2*Sqrt[2*(a^2 - 1)^4]) == C*x

I am looking a solution for $a$ in function of $x$. I tried Solve and similar methods but I got unevaluated expression.

MarcoB
  • 67,153
  • 18
  • 91
  • 189
John
  • 43
  • 3

3 Answers3

4

If it may also be a graphic solution? Consider:

FunctionDomain[ArcTanh[a], a]
(* -1 < a < 1 *)


((a^2 - 1)*((a^2 - 1)*ArcTanh[a] - a))/(2*Sqrt[2*(a^2 - 1)^4]) == c*x;
x[a_] = 1/c*((a^2 - 1)*((a^2 - 1)*ArcTanh[a] - a))/(2*Sqrt[2*(a^2 - 1)^4]);

With c as parameter

p = Plot[x[a] /. c -> 1, {a, -1, 1}, AxesLabel -> Automatic, GridLines -> Automatic]

enter image description here

p1 = Join @@ Cases[Normal@p, Line[x1__] :> x1, Infinity];
a = Interpolation@Thread@{Last /@ p1, First /@ p1}

Plot[a[x], {x, -3, 3}, GridLines -> Automatic, AxesLabel -> Automatic]

enter image description here

Edit

The easiest way to find the function a(x) is to build the inverse of f(a).

f = 1/c*((#^2 - 1)*((#^2 - 1)*ArcTanh[#] - #))/(2*Sqrt[2*(#^2 - 1)^4]) &;
a = InverseFunction@f

enter image description here

This function can be evaluated numerically with c as parameter, e.g.

c = 1;
Table[a[x], {x, -2, 2}] // N
(* {-0.888998, -0.76291, 0., 0.76291, 0.888998} *)

Plot[{f[x], a[x]}, {x, -2, 2}, GridLines -> Automatic, 
 PlotLegends -> {"f[x]", "a[x]"}, AspectRatio -> 0.8]

enter image description here

Edit 2

Please forgive me, I have a problem with the solutions. I follow here Michel E2's method.

f = ((a^2 - 1)*((a^2 - 1)*ArcTanh[a] - a))/(2*Sqrt[2*(a^2 - 1)^4]) - c x /. a -> a[x];
df = D[f, x] // Simplify

enter image description here

sol = DSolve[df == 0, a, x] /. C[1] -> 0

enter image description here

c = 1;
Plot[a[x] /. sol, {x, -2, 2}, GridLines -> Automatic]

enter image description here

  • thank you for your solution. Using @MichaelE2's and your method I solved my problem. – John Apr 18 '16 at 22:07
3

I am going to give a generic answer which work in such cases. The main idea is to go numerical. You solve it for some parameter values and get an idea of the function which might be the answer.

dat = Table[{c, x, 
           a /. NSolve[((a^2 - 1)*((a^2 - 1)*ArcTanh[a] - a)) /(2*Sqrt[2*(a^2 - 1)^4])
       == c x && 0 < a < 10, a][[1]]}, {c, 0.1, 1, .1}, {x, 0.1, 1., .1}]

dat1 = Flatten[dat, 1];
f = Interpolation[dat1];
Plot3D[f[c, x], {c, 0.1, 1}, {x, 0.1, 1}]

enter image description here

Ignore the Solve::rantz error message. Note that I use [[1]] and a range 0 < a < 10. This comes handy if you have multiple root and also gives faster result because it looks for root only within that region.

Sumit
  • 15,912
  • 2
  • 31
  • 73
3

One way: Derive the differential equation of the family (solve for the constant and differentiate); and use DSolve to solve it.

D[(1/x)((a^2 - 1)*((a^2 - 1)*ArcTanh[a] - a)) /
     (2*Sqrt[2*(a^2 - 1)^4]) /. a -> a[x], x] // Together // Numerator;
{dsol} = DSolve[% == 0, a, x] /. C[1] -> c
(*
  {{a -> Function[{x}, 
      InverseFunction[-(1/2) Log[1 - #1^2] + 
          1/2 Log[-ArcTanh[#1] - #1 + ArcTanh[#1] #1^2] &][c + Log[x]/2]]}}
*)

Evaluating an InverseFunction on exact input can sometimes take a long time. Be sure to use approximate machine reals when plotting or doing other numerical work. (This is accomplished by N below. Alternatively one could use the iterator {x, -1., 1.} instead of {x, -1, 1} to specify the plot domain.)

Block[{c = 1},
 Plot[a[N@x] /. dsol, {x, -1, 1}]
 ]

Mathematica graphics

While InverseFunction can be inconvenient at times, the solution dsol does present a as a function of x and the parameter c.


Update: I guess I should point out that the inverse function is basically just the solution to the equation written in the form of an inverse function.

This simpler solution is equivalent to the produced by dsol:

{a -> Function[{x}, 
   InverseFunction[1/(1 - #1^2)*(-ArcTanh[#1] - #1 + ArcTanh[#1] #1^2) &][Exp[2 c] x]]}

It is equivalent to the OP's original equation via Exp[2 c] == 2 Sqrt[2] C. (Please note that capital C is a Protected Mathematica symbol.)

Michael E2
  • 235,386
  • 17
  • 334
  • 747
  • thank you for your answer. Your graph (dsol) presents solution to this equation and it looks like Tanh[Constant*x], where Constant is related to c. For different values of c the shape of Tanh[] will be different. So, how can I find this Constant? For example, to have solution in form of Tanh[x]. – John Apr 17 '16 at 22:53
  • @JohnM. You're welcome. I think you can see from this image that, while dsol produces a sigmoid-like plot similar to Tanh, it is not in fact the same. – Michael E2 Apr 17 '16 at 23:23
  • Thank you again. This was useful. I noticed that I can not represent dsol with Tanh[x], they are similar but not the same. However, is there a way to represent this curve (sigmoid function) with some function (approximate solution) in term of x? – John Apr 18 '16 at 00:38
  • @Michael E2 Why you have another functional course? –  Apr 18 '16 at 09:37
  • 1
    @JohnM. Over a finite interval, one can construct an interpolating function with NDSolve or FunctionInterpolation, which would evaluate faster than InverseFunction. Or one could use another approximation method, such as a Chebyshev series expansion I used here. One might try fitting a formula (see FindFit, LinearModelFit, and the whole *Fit family). – Michael E2 Apr 18 '16 at 09:59
  • @rewi I'm not sure what you mean by "course." The second formula, which I got from manipulating the DSolve result, has for its argument to InverseFunction the left-hand side of the OP's equation up to a constant factor, with #1 replacing a. I thought that clarified the relationship of the DSolve solution to the equation, especially the relationship between the constants. But perhaps you meant something else? – Michael E2 Apr 18 '16 at 10:13
  • @Michael E2 Your function is mirrored at the x axis –  Apr 18 '16 at 12:32
  • @rewi Do you mean Log[x] should be an issue? In Mathematica Log is defined for negative real numbers. It's complex-valued, but the logarithms in the inverse function cancel out the imaginary part of Log[x]. E.g., Solve[Log[-1] == Log[x]] and FindRoot[Log[-1] == Log[x], {x, -0.1}]. Is that what you meant? (Otherwise it is clear from the equation that the solution should be symmetric in this way.) – Michael E2 Apr 18 '16 at 12:46
  • @Michael E2 Thanks Michael E2. Is my thinking wrong when I build the inverse of f in my solution? Should I delete my answer? –  Apr 18 '16 at 13:02
  • @rewi Don't you just need to use a negative value for c and then they'll look the same? DSolve probably just did something like that, since the c disappears from my DE. – Michael E2 Apr 18 '16 at 18:33
  • @MichaelE2, thank you very much. You solved my problem. Comments from @rewi are also useful. Again, thank you! – John Apr 18 '16 at 22:04