# Explicit Solution $\frac{\cos (x)-k}{\cos (y) +k}=\frac{\sin x}{\sin y}$

What is $$y$$ in the equation below? $$k$$ is a constant.

$$\frac{\cos (x)-k}{\cos (y) +k}=\frac{\sin x}{\sin y}$$

This looks like a nice, symmetrical formula, but I've tried several methods to no avail, including WolframAlpha/Mathematica and algebraic simplification. Here's the farthest I could get: $$\sin y \cos x - k \sin y = \sin x \cos y + k\sin x$$ $$\sin y \cos x - \sin x \cos y=k(\sin x + \sin y)$$ $$\sin(y-x) = k(\sin x + \sin y)$$

I'd appreciate any suggestions for how to solve for $$y$$ and obtain an exact, analytic solution.

• You can rearrange into $\frac a{\cos(y)+k}=\frac b{\sin(y)}\iff \frac{\sin(y)}{\cos(y)+k}=\frac ba$ Jun 27, 2023 at 13:38
• @TymaGaidash Indeed, that gets me tantalizingly close, but not quite to solving for $y$. Jun 27, 2023 at 13:41
• Do you have reasons to believe that a "solution" of the type $y=\text{something}$ should exist (right-hand side being a "formula" in $k$ and $x$), using standard notation and wellknown functions? Lots of equations cannot be solved in that way. Jun 27, 2023 at 13:49
• @JeppeStigNielsen Indeed I do. This equation is the result of a physical phenomena which I cannot delve into the details of here. It agrees numerically with a another well-known equation. Thus, I have reason to believe that there is an exact solution. Jun 27, 2023 at 13:52

A solution: $$\sin(y-x) = k(\sin x + \sin y)=2k \sin \frac{x+y}{2}\cos \frac{y-x}{2}$$ $$2\sin \frac{y-x}{2}\cos \frac{y-x}{2} - 2k \sin \frac{x+y}{2}\cos \frac{y-x}{2} =0$$ $$2\cos \frac{y-x}{2}(\sin \frac{y-x}{2} - k \sin \frac{x+y}{2}) =0$$

The first part, $$\cos \frac{y-x}{2}=0$$ is easy, $$y=x+\pi(2n+1)$$.

The second part: $$\sin \frac{y-x}{2} - k \sin \frac{x+y}{2}=0$$ $$\sin \frac{y}{2} \cos \frac{x}{2}-\cos \frac{y}{2} \sin \frac{x}{2}-k\sin \frac{y}{2} \cos \frac{x}{2}-k\cos \frac{y}{2} \sin \frac{x}{2}=0$$ $$(k-1)\sin \frac{y}{2} \cos \frac{x}{2}+(k+1)\cos \frac{y}{2} \sin \frac{x}{2}=0$$ $$(k-1)\tan \frac{y}{2} +(k+1)\tan \frac{x}{2}=0$$ Now you can express $$y$$ in terms of $$x$$ using $$\arctan$$.

• Hello Vasili. This exactly matches (numerically) with my original formula. I would like to acknowledge your simplification. If you would like to be acknowledged in my manuscript, please let me know. Jun 27, 2023 at 14:07
• @rb3652: Glad you found my answer useful and thanks for the proposition to be acknowledged. Jun 27, 2023 at 14:23
• OK. If indeed you would like to be acknowledged, please provide me of your name and email address and you will be notified when the manuscript is submitted for peer review and publication. Jun 27, 2023 at 14:30

Rearrange into:

$$\frac a{\cos(y)+k}=\frac b{\sin(y)}\iff\frac{\sin(y)}{\cos(y)+k}=\frac ba=c$$

Substitute $$\cos(y)=t,\sin^2(y)=1-t^2$$:

$$\frac{\sqrt{1-t^2}}{k+t}=c\iff1-t^2=c^2(t+k)^2\iff (c^2+1) t^2+2kc^2t+k^2c^2-1=0$$

Applying the quadratic formula finally gives:

$$y=2\pi n\pm\cos^{-1}\left(\frac{c^2k\pm\sqrt{c^2(1-k^2)+1}}{c^2+1}\right),n\in\Bbb Z,c=\frac{\sin(x)}{\cos(x)-k}$$

• To clarify, $c=\frac{\sin x}{\cos (x) -k}$? Jun 27, 2023 at 14:00

$$\frac{\cos (x)-k}{\cos (y) +k}=\frac{\sin x}{\sin y}$$

If you just want to solve for $$y$$, then we just square it

$$\sin^2y(\cos(x)-k)^2=\sin^2x(\cos(y)+k)^2$$

then use the identity $$\sin^2y=1-\cos^2y$$

$$(1-\cos^2y)(\cos x-k)^2=\sin^2x(\cos(y)+k)^2$$

Now you get a quadratic equation with respect to $$\cos y$$ and you can proceed to solve it.

Using tangent half-angle formula with $$t=\tan \frac x2$$ and $$s=\frac y2$$ we obtain

$$\frac{\cos (x)-k}{\cos (y) +k}=\frac{\sin x}{\sin y} \iff \frac{\frac{1-t^2}{1+t^2}-k}{\frac{1-s^2}{1+s^2}+k}=\frac{\frac{2t}{1+t^2}}{\frac{2s}{1+s^2}} \iff \frac{(st+1)((k-1)s+(k+1)t)}{s((k-1)s^2+k+1)}=0$$

• $$st+1=0 \iff \tan \frac x2\tan \frac y2=-1$$
• $$(k-1)s+(k+1)t=0\iff (k+1)\tan \frac x2+(k-1)\tan \frac y2=0$$