# Solve command does not solve this equation!

I tried to solve the following equation with Mathematica:

$$\left(1-x^2\right) \left(n \left(x^4-2 x^2+5\right)-4 \pi \left(x^2-1\right)\right) \sinh (\pi x) \cosh (n x)+\sinh (n x) \left(\left(1-x^2\right) \left(\pi \left(x^4-2 x^2+5\right)-4 n \left(x^2-1\right)\right) \cosh (\pi x)-2 x \left(x^4-2 x^2-3\right) \sinh (\pi x)\right)=0$$

but the answer is: "This system cannot be solved with the methods available to Solve."

I also tried Maple, the result was a long relation in terms of RootOf. How can I obtain an explicit solution for $$x$$ in terms of $$n$$?

(1/(4 (-1 +
x^2)^2))((1 - x^2) (-4 \[Pi] (-1 + x^2) +
n (5 - 2 x^2 + x^4)) Cosh[n x] Sinh[\[Pi] x] +
Sinh[n x] ((1 -
x^2) (-4 n (-1 + x^2) + \[Pi] (5 - 2 x^2 +
x^4)) Cosh[\[Pi] x] -
2 x (-3 - 2 x^2 + x^4) Sinh[\[Pi] x])) == 0

• can you add more information about the problem i mean the math problem what's more there! – Alrubaie Oct 11 at 12:17
• is there conditions on x and n !!?? like been greater than 0 or Real or Integers !!?? – Alrubaie Oct 11 at 12:20
• $n$ and $x$ are reals and positive. Unfortunately, there is nothing more. – Baran Oct 11 at 12:20
• I modified the general equation. this is the most simplified form with all assumptions. – Baran Oct 11 at 12:26
• Unfortunately, sometimes a solutions just does not exist in simple closed form primitives. You can try Reduce and see if it comes up with something useful. – Sjoerd Smit Oct 11 at 13:34

As I noted in my answer to your other question, this type of problem can be solved numerically using FindAllCrossings from this answer.

With[
{n = 1},
FindAllCrossings[(1/(4 (-1 + x^2)^2)) ((1 - x^2) (-4 π (-1 + x^2) + n (5 - 2 x^2 + x^4)) Cosh[n x] Sinh[π x] + Sinh[n x] ((1 - x^2) (-4 n (-1 + x^2) + π (5 - 2 x^2 + x^4)) Cosh[π x] - 2 x (-3 - 2 x^2 + x^4) Sinh[π x])), {x, -5, 5}, WorkingPrecision -> 20]
]


{-1.7736824298128102343}

What the function does is that it automates the method based on ContourPlot.

Clear["Global*"]

f[n_, x_] := (1/(4 (-1 + x^2)^2)) ((1 - x^2) (-4 π (-1 + x^2) +
n (5 - 2 x^2 + x^4)) Cosh[n x] Sinh[π x] +
Sinh[n x] ((1 -
x^2) (-4 n (-1 + x^2) + π (5 - 2 x^2 + x^4)) Cosh[π x] -
2 x (-3 - 2 x^2 + x^4) Sinh[π x]));


0 is a root for all n

f[n, 0]

(* 0 *)


For any root x, -x is also a root

f[n, -x] == -f[n, x] // Simplify

(* True *)


Finding the roots for specific values of n

sol = {#, Solve[{f[#, x] == 0, 0 <= x < 3}, x, Reals]} & /@
Range[1/4, 15, 1/4];

ListPlot[Thread[{#[[1]], x /. #[[2]]}] & /@ sol,
Frame -> True, FrameLabel -> (Style[#, 14, Bold] & /@ {"n", "roots"})]


supplement to @Bob Hanlon 's answer

ContourPlot shows the possible solution directly:

ContourPlot[f[n, x] == 0, {n, 0, 15}, {x, -5, 5}, MaxRecursion -> 4, FrameLabel -> Automatic]


The solution x[n] is evaluated using NDSolve in a given range of x. The number of solutions changes with n, that's why only pointwice solution is calculated:
sol[n_] :=  NSolve[{f[n, x] == 0, 0.5 < x < 5}, x, Reals  ]

• Increasing the PlotPoints, e.g., PlotPoints -> 25 provides a more complete plot. – Bob Hanlon Oct 11 at 19:44
• @BobHanlon Thank you so much. these plots can help me to solve the problem. But, the main problem for me is to obtain a general expression for $x$ in terms of $n$, I mean find $x=f(n)$ as a solution of the above equation. – Baran Oct 11 at 21:33
• @Baran Try sol[n_] := NSolve[{f[n, x] == 0, 0.5 < x < 5}, x, Reals]` which gives you all solutions inside the prescribed x-range – Ulrich Neumann Oct 12 at 8:24