Setting $x=a/b$ the equation is
eqn = (-1/2 + 2 x - Sin[2 x n π]/(n π)) == 0
Hopefully it is obvious that there is a solution $x=1/4$ for even $n$. For odd $n$ the solution will shift away from $1/4$ because of the sin term. Write $x=1/4 + e/{(2 \pi n)}$ and we get this for $e$:
Simplify[eqn /. {x -> 1/4 + e/(2 π n)}, n ∈ Integers && n > 0] // TrigExpand
(* e == Cos[(n π)/2] Sin[e] + Cos[e] Sin[(n π)/2] *)
If $n$ is even we have $e=\sin (e)$ so $e=0$ as previously observed. If $n$ is odd we have $e=\cos(e) sin(n \pi/2)$. In general we can say $e=q \sin(n\pi /2)$ where $q$ is the solution to the transcendental equation $y=\cos(y)$ (This we will have to find numerically).
Thus we can write the solution as
q = y /. FindRoot[y == Cos[y], {y, 0.5}, WorkingPrecision -> 30]
(* 0.739085133215160641655312087674 *)
x = 1/4 + q Sin[n π/2]/(2 π n)
Checking the result for the first few n:
Table[eqn, {n, 10}]
(* {True, True, True, True, True, True, True, True, True, True} *)
Visualize the solutions for $x$ vs $n$:
DiscretePlot[x, {n, 1, 30}, PlotRange -> {0, 0.5}, AxesLabel -> {"n", "x"}]
n
andb
? I guess thatn
is a non-negative integer, butb
? $\endgroup$Solve[Sin[x] == x, x]
, which has only one solution.FindInstance[Sin[x] == x, x]
gives it,{{x -> 0}}
. $\endgroup$