-1
$\begingroup$

How do you plot 1/x in the range {x,0,5}? As at x=0, there occurs a singularity in the function. Is it possible to plot this type of function near the x=0 limit?

$\endgroup$

closed as off-topic by Michael E2, Bob Hanlon, MarcoB, m_goldberg, b.gates.you.know.what Sep 19 '15 at 7:45

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Michael E2, Bob Hanlon, MarcoB, m_goldberg, b.gates.you.know.what
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ What do you mean by plotting it near the limit?? You can use Plot[1/x, {x, 0, 5}] or even with range {x,-1,1} and you'll get a plot that hides diverging parts. When you set PlotRange to All you'll get big values. I can't imagine what would you like to see on that graph as it's only a function getting bigger and bigger as x tends to zero. $\endgroup$ – user16320 Sep 18 '15 at 9:53
  • $\begingroup$ Welcome! 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 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$ – user9660 Sep 18 '15 at 9:53
  • 1
    $\begingroup$ Try Plot[1/x, {x, -5, 5}, Frame -> True, Axes -> False] $\endgroup$ – user9660 Sep 18 '15 at 9:54
2
$\begingroup$

Of course, you'll never be able to plot this function entirely, it is, after all, diverging to infinity. But maybe this will also be of help:

Table[
 Plot[1/x, {x, 0, 5}, PlotRange -> {{-1, 5.5}, {-i/10, i}}],
 {i, {10, 100, 1000}}]

plots

Not really much to see, is there?

PS Please do excuse my working with non-standard options set for Plot at the moment.

$\endgroup$
0
$\begingroup$

You can plot near the singularity by using

Plot[1/x, {x, 0, 5}, Exclusions -> 0]
$\endgroup$

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