1

I'm trying to find the solution set of {x, y} variables for the following system of equations:

Solve[{0 == -1/2*Tan[Pi*x/2] + y, 0 == -1/2*Tan[Pi*y/2] + x}, {x, y}]

But when I try this, I can't get a result. Is there another function I should use? I can get the "basic" solutions by hand noting that if $x = 0$, then $y = 2n$ where $n$ is an integer (and vice-versa for when $y = 0$). But I think there are other solutions...

Any help would be appreciated, thanks!

I'm using Mathematica 8, BTW.

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Jon
  • 123
  • 1
  • 6

1 Answers1

2

There are other solutions, this is correct. ContourPlot gives an idea:

ContourPlot[{
  -.5 Tan[.5 Pi x] + y == 0,
  -.5 Tan[.5 Pi y] + x == 0}, {x, -5.5, 5.5}, {y, -5.5, 5.5},
 PlotPoints -> 20,
 Frame -> False, Axes -> True,
 Exclusions -> Join[
   Table[{x == i}, {i, -5, 5, 2}],
   Table[{y == i}, {i, -5, 5, 2}]]]

contourplot

Exclusions prevents drawing of asymptotes and poles. This plot can tell you where to search for roots. (Note also that you don't have to type * for multiplication, pressing space instead achieves the same effect.) Now use FindRoot for example with starting values you read off the plot (select plot > right click > Get Coordinates). Click some points close to intersections and Ctrl + C copy them. Let's say these thriteen pasted and assigned to start:

start = {{-1.279, 1.279}, {0.9913, 2.543}, {3.002, 2.773}, {2.6, 
    0.9913}, {1.336, -1.307}, {-0.4166, -0.589}, {-0.1006, 
    0.1006}, {0.5603, 
    0.5603}, {-2.543, -1.02}, {-0.9913, -2.83}, {-3.031, -2.686}, \
{1.164, -3.405}, {3.175, -1.192}};
Length@start
(* 13 *)

I visualize solution points with the same ContourPlot command to which I added Epilog overdraw specification (black points). You can see that not every starting point (gray) converged to a desired destination. Perhaps I should've start-clicked more carefully, or one could tell FindRoot to search differently, you'd have to consult help on that.

sol = Map[Function[ini,
   With[{x0 = First@ini, y0 = Last@ini},
    {x, y} /. FindRoot[{
       -.5 Tan[.5 Pi x] + y == 0,
       -.5 Tan[.5 Pi y] + x == 0}, {{x, x0}, {y, y0}}]]], start];

contourplot2

BoLe
  • 5,819
  • 15
  • 33