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.
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.
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]
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]
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
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]
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
sol = DSolve[df == 0, a, x] /. C[1] -> 0
c = 1;
Plot[a[x] /. sol, {x, -2, 2}, GridLines -> Automatic]
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}]
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.
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}]
]

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.)
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
dsol produces a sigmoid-like plot similar to Tanh, it is not in fact the same.
– Michael E2
Apr 17 '16 at 23:23
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
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
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
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
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