# Plot gives 1/0 on singularity of elementary function [duplicate]

This question already has an answer here:

My understanding is that Mathematica 11 Plot can now handle singularities automatically when plotting. identify-types-of-singularities-and-discontinuitie

I found an a function where Mathematica 11.0.1 gives a 1/0 error message. But still the plot is generated. Here it is 1/(Tan[1/t])

f = 1/Tan[1/t];
Plot[f, {t, - Pi/2, Pi/2},
ExclusionsStyle -> {None, Directive[Red, AbsolutePointSize]}] It is having hard time with 1/Tan[1/t] The singularities for this function are (using function that finds these, thanks to Edmund and Carl Woll from does-mathematica-have-a-function-to-find-all-singularities-of-an-expression)

singularityDomain[f_, x_] := Module[{res = FunctionDomain[f, x]},
Reduce[! res] /; ! MatchQ[res, _FunctionDomain]]

Clear[x]
singularityDomain[1/Tan[1/x], x] Is this known, is this a bug?

## marked as duplicate by Michael E2 plotting StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Jan 25 '17 at 13:10

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

• Known bug. Comes from the improvements in the Exclusions system, i.e. setting Exclusions -> None turns off the messages (and the benefits of exclusion processing, too). – rcollyer Jan 24 '17 at 14:35
• @rcollyer thanks. If this is known, should I delete this post then? – Nasser Jan 24 '17 at 14:38
• @rcollyer is there currently a question which has this bug in it? – Feyre Jan 24 '17 at 15:05
• @Feyre I don't know of another one. My knowledge comes from internal testing. – rcollyer Jan 24 '17 at 15:18
• @MichaelE2 I think it is. – rcollyer Jan 24 '17 at 18:40

## 2 Answers

This is a known bug introduced in 11.0 with the improvements to the Exclusions code. One workaround is

Plot[1/Tan[1/t], {t, - Pi/2, Pi/2}, Exclusions -> None]


eliminates the message but removes the benefits of Exclusions. A better alternative is to specify the Exclusions yourself,

Plot[1/Tan[1/t], {t, - Pi/2, Pi/2}, Exclusions -> {Tan[1/t] == 0}]


Recommend that you avoid any region where you know that a function becomes infinitely dense.

f[t_] = 1/Tan[1/t];

Manipulate[
reg = ImplicitRegion[
(ts && -max < t < -min) || min < t < max, t];
Plot[f[t], t ∈ reg,
PlotPoints -> 100,
MaxRecursion -> 15],
{{ts, True, "two-sided"}, {True, False}},
{{min, 0.025}, 0.001, 0.1, Appearance -> "Labeled"},
{{max, Pi/2}, 1.1 min, Pi/2, Appearance -> "Labeled"}] 