3
$\begingroup$

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:

enter image description here

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]

$\endgroup$
2
  • 2
    $\begingroup$ 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] $\endgroup$ Commented Jul 26, 2015 at 16:55
  • 1
    $\begingroup$ @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? $\endgroup$
    – David
    Commented Jul 26, 2015 at 17:07

1 Answer 1

7
$\begingroup$

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}]}} *)
$\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.