0
$\begingroup$

I didn't manage to plot a simple function with ArcCos.

Plot[ArcCos[(x + 1)/Sqrt[x]], {x, -1, 1}]

With this function, the plot returned is empty.

Do you have some ideas for conducting this plotting ?

$\endgroup$
2
  • $\begingroup$ For Power function I remember that to not have this problem I use Surd rather than Power. Is there a equivalent for inverse trigonometric functions ? $\endgroup$
    – Bendesarts
    Oct 15, 2015 at 9:19
  • $\begingroup$ May be a stupid question but I would like to be sure. If I put Re do I obtain the same plot that I could obtain a Ti calc for example ? $\endgroup$
    – Bendesarts
    Oct 15, 2015 at 12:45

2 Answers 2

2
$\begingroup$

The function is complex-valued, try

Plot[Re[ArcCos[(x + 1)/Sqrt[x]]], {x, -1, 1}]
$\endgroup$
3
  • 1
    $\begingroup$ Wouldn't be more instructive e.g. Plot[{Re @ #, Im @ #}& @ ArcCos[(x + 1)/Sqrt[x]], {x, -1, 1}, Evaluated -> True, PlotStyle -> Thick]? $\endgroup$
    – Artes
    Oct 15, 2015 at 9:25
  • 1
    $\begingroup$ Or Plot[ReIm@ArcCos[(x + 1)/Sqrt[x]], {x, -1, 1}, Evaluated -> True] $\endgroup$
    – user31001
    Oct 15, 2015 at 10:16
  • $\begingroup$ I try this : Plot[Re[ArcCos[(x + 1)/Sqrt[x]]], {x, -2, 2}] But my plot seems to be a bit strange ??? $\endgroup$
    – Bendesarts
    Oct 15, 2015 at 14:46
1
$\begingroup$

Whenever the square root of a complex number is used here, we choose the root with the positive real part (or positive imaginary part if the square was negative real).

$\arccos x=2 \arctan \frac{\sqrt{1-x^2}}{1+x}, if -1<x\le 1 $

Plot[Im[2 ArcTan[Sqrt[-x^2 - x - 1]/Sqrt[x] + x + 1]], {x, -1, 1}]

plot of imaginary part

The same for the real part:

 Plot[Re[2 ArcTan[Sqrt[-x^2 - x - 1]/Sqrt[x] + x + 1]], {x, -1, 1}]

plot of real part

$\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.