3
$\begingroup$

I'm trying plot an inverse function

InverseFunction[2 A ArcTanh[(# A)/Sqrt[-1 + #^2 B]] + A Log[1 + #^2 (A^2 - B)] - 2 Log[# B + Sqrt[-1 + #^2 B]] &][x]

Plot[Abs[%] /. {A -> 0.2, B -> 0.3}, {x, 0, 2}, PlotRange -> All]

But I can't get any result??!!

$\endgroup$
1
  • 1
    $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – Michael E2 Dec 30 '20 at 3:44
6
$\begingroup$

We can draw y=f[x] by

ParametricPlot[{x, f[x]}, {x, 0, 2}] 

and draw its inverse x=f[y] by

ParametricPlot[{f[y], y}, {y, 0, 2}]
f[x_] := 2 A ArcTanh[(# A)/Sqrt[-1 + #^2 B]] + 
       A Log[1 + #^2 (A^2 - B)] - 2 Log[# B + Sqrt[-1 + #^2 B]] &[
     x] /. {A -> 0.2, B -> 0.3} // Abs;
ParametricPlot[{{x, f[x]}, {f[x], x}}, {x, 0, 2}]

enter image description here

We can also use ContourPlot

f[x_] := 2 A ArcTanh[(# A)/Sqrt[-1 + #^2 B]] + 
       A Log[1 + #^2 (A^2 - B)] - 2 Log[# B + Sqrt[-1 + #^2 B]] &[
     x] /. {A -> 0.2, B -> 0.3} // Abs;
ContourPlot[{y == f[x], x == f[y]}, {x, 0, 2}, {y, 0, 2}]
$\endgroup$
2
  • $\begingroup$ You just plot f(x) but as you see I used InverseFunction[f(x)] it means I want to plot f^-1(x) $\endgroup$ – Armin Sharafi Dec 30 '20 at 2:00
  • 2
    $\begingroup$ @ArminSharafi Here we draw y=f[x] and x=f^-1[y] at the same picture. $\endgroup$ – cvgmt Dec 30 '20 at 2:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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