0

I need to find $a$ from this equation:

Solve[(2*b)/a - 1/(n*π)*Sin[(2*n*π*b)/a] - 1/2 == 0, a]

but I get the response:

Solve::nsmet: This system cannot be solved with the methods available to Solve.

I have also tried other methods: NSolve, Root, Reduce etc but it is always the same. Is there any way to solve this?

zhk
  • 11,939
  • 1
  • 22
  • 38

2 Answers2

2

The only way to solve your equation for a is numerical, assigning values to n and b. Here I choose some random ones.

b = 1; n = 2;
Plot[{-1/(n*π)*Sin[(2*n*π*b)/a], -(2*b)/a + 1/2}, {a, -10,10}]

enter image description here

f[a_] := (2*b)/a - 1/(n*π)*Sin[(2*n*π*b)/a] - 1/2;
FindRoot[f[a] == 0, {a, 3}]

{a -> 4.}

f[4]

0

zhk
  • 11,939
  • 1
  • 22
  • 38
1

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"}]

enter image description here

Simon Woods
  • 84,945
  • 8
  • 175
  • 324