# Exclusions found but Solve and Reduce don't find exclusions

I have the following from Stan Wagons Mathematica in Action.

Plot[Sec[x]/(1 + x^2 Tan[x]), {x, -((5 \[Pi])/2), (5 \[Pi])/2},
Exclusions -> {Cos[x] == 0, 1 + x^2 Tan[x] == 0},
ExclusionsStyle -> {{Dashing[0.02], Gray, Thickness[0.008]}},
FrameTicks -> {{Automatic, None}, {Range[-2 Pi, 2 Pi, Pi], None}}]


Which produced:

However, neither Solve nor Reduce seem to find the Exclusions:

In[79]:= Reduce[1 + x^2 Tan[x] == 0, x, Reals]


During evaluation of In[79]:= Reduce::nsmet: This system cannot be solved with the methods available to Reduce. >>

Out[79]= Reduce[1 + x^2 Tan[x] == 0, x, Reals]

In[77]:= Solve[1 + x^2 Tan[x] == 0, x, Reals]


During evaluation of In[77]:= Solve::nsmet: This system cannot be solved with the methods available to Solve. >>

Out[77]= Solve[1 + x^2 Tan[x] == 0, x, Reals]

• As there are infinitely many zeroes, you have to limit it to the same range in your Plot[]: Reduce[1 + x^2 Tan[x] == 0 && -5 π/2 < x < 5 π/2, x, Reals] Commented Jul 26, 2015 at 16:55
• @Guesswhoitis. Thanks, that works. I had just thought of trying that before your comment, but thanks for the help. Any way to make the Cos[x]==0 exclusions a different ExclusionsStyle? Commented Jul 26, 2015 at 17:07

## 1 Answer

The equation has infinite number of nontrivial roots. You can query a subset of them, though:

Solve[1 + x^2 Tan[x] == 0 && -10 < x < 10, x, Reals]

(* {{x -> Root[{1 + #1^2 Tan[#1] &, -9.4360086156910331017}]},
{x -> Root[{1 + #1^2 Tan[#1] &, -6.3083089552381513776}]},
{x -> Root[{1 + #1^2 Tan[#1] &, -3.2367552992046412986}]},
{x -> Root[{1 + #1^2 Tan[#1] &, -0.89520604538423185008}]},
{x -> Root[{1 + #1^2 Tan[#1] &, 3.0333351651192716892}]},
{x -> Root[{1 + #1^2 Tan[#1] &, 6.2576534384926035492}]},
{x -> Root[{1 + #1^2 Tan[#1] &, 9.4134935234375590912}]}} *)