trigonometric system of equations

Compute the number of ordered pairs $(x,y)$ that satisfy the system \begin{align*} \sin(x+y)&=\cos(x+y)\\ x^2+y^2&=\left(\dfrac{1995\pi}{4}\right)^2 \end{align*}

I got 5622, but I'm not sure if that's correct. Can someone provide a hint?

-
It would perhaps help if you gave some indication of your workings - which solutions have you found? Then it would be possible for us to identify whether you have missed something, or alternatively if you have double-counted somewhere. –  Mark Bennet Apr 7 '12 at 21:46

Let $x=r\cos\theta$ and $y=r\sin\theta$ for $r=\frac{1995\pi}{4}$ parametrize the solutions on the circle given by the second equation. Then $\phi=x+y=r\sqrt2\sin\left(\theta+\frac\pi4\right)$ has equal sine and cosine iff $\phi\equiv\frac\pi4\pmod{\pi}$ i.e. $\iff\frac{\phi-\frac\pi4}{\pi}\in\mathbb{Z}$ $\iff\phi=\phi_k=\frac\pi4(4k+1)$ for $k\in\mathbb{Z}$. But $\left|\frac{\phi}{r\sqrt2}\right|\le1\iff$ $\left|4k+1\right|\le\frac{4r\sqrt2}{\pi}=1995\sqrt2\iff$ $\left|k+\frac14\right|\le\frac{r\sqrt2}{\pi}=\frac{1995\sqrt2}{4}\approx705.339$, $\iff k\in\{-705,\dots,705\}$, which entails $1411$ distinct, admisssible values of $\phi$.

To each one of these corresponds a line of slope $-1$ which intersects our circle at two points. So each $\phi_k\in(-1,1)$ furnishes two solutions $(x,y)$ & $(y,x)$ with $\theta=\theta_k=-\frac\pi4+\arcsin\frac{\phi_k}{r\sqrt2}$ and $(y,x)$ representing $\theta=\frac\pi2-\theta_k$, while if either of $\phi=\pm1$ were admissible (which isn't the case), it would only add one new solution. Thus we have $2\cdot1411=2822$ total solutions.

Thanks to @joriki for a second opinion on an earlier draft that stopped with $1411$.

-
Yes, you're missing something. For each of those values of $k$, there are two different values of $\theta$, corresponding to $(x,y)$ and $(y,x)$, so there are $2\cdot1411=2822$ distinct solutions. Strange coincidence, since $5622=2\cdot2811$. –  joriki Apr 7 '12 at 21:42

$x+ y = n \pi + \dfrac{\pi}{4}$ and $x^2 + y^2 = \left(\dfrac{1995 \pi}{4} \right)^2$. Letting $x = \pi X$ and $y = \pi Y$, we need number of solutions for $$X+Y =n + \dfrac14$$ and $$X^2 + Y^2 = \left(\dfrac{1995}4 \right)^2$$ Now $$(X+Y)^2 \leq 2(X^2 + Y^2)$$ Hence, $$\left( n + \dfrac14 \right)^2 \leq 2 \left(\dfrac{1995}4 \right)^2$$ $$-\dfrac{1995}4 \sqrt{2} \leq n + \dfrac14 \leq \dfrac{1995}4 \sqrt{2} \implies - \dfrac{1995 \sqrt{2} + 1}4 \leq n \leq \dfrac{1995 \sqrt{2} - 1}4$$ $$-705 \leq n\leq 705$$ For each $n$, we have two solution pairs $(x,y)$, since for each $n$ we have a quadratic in $X$ (or) $Y$.

Hence, the total number of solution pairs is $2 \times (705-(-705)+1) = 2 \times 1411 = 2822$.

-