# Finding a (sufficient) condition for an inequality - Solve takes too long

I have the following inequality $$2 \sqrt{2} n^2 \sqrt{\frac{r}{r-1}} \exp \left(2^{-\frac{\sqrt[3]{\log (n)}}{10 \sqrt[3]{\log (r)}}} \left(\frac{1}{r+1}\right)^{-\frac{\sqrt[3]{\log (n)}}{10 \sqrt[3]{\log (r)}}}-\frac{(r-1) 2^{-\frac{1}{5} \sqrt[3]{\frac{\log (n)}{\log (r)}}-2} (r+1)^{\frac{1}{5} \sqrt[3]{\frac{\log (n)}{\log (r)}}}}{3 r+1}\right)\leq 1$$

and want to find a function $$n(r)$$ such that the inequality holds by replacing $$n$$ by $$n(r)$$. Thus, I want to solve the inequality for $$n$$. $$r$$ is guaranteed to be greater than 1.

My first approach was

    Solve[2 Sqrt[2] E^(2^(-(Log[n]^(1/3)/(10 Log[r]^(1/3)))) (1/(1 + r))^(-(Log[n]^(1/3)/(10 Log[r]^(1/3)))) - (2^(-2 - 1/5 (Log[n]/Log[r])^(1/3)) (-1 + r) (1 + r)^(1/5 (Log[n]/Log[r])^(1/3)))/(1 + 3 r)) n^2 Sqrt[r/(-1 + r)] <= 1, n, Assumptions -> r > 1]


However, that has terminated in the long time I have been waiting. I tried Reduce[%] (% is the given inequality), but doesn't terminate either.

I would also be happy for some other function $$n(r)$$ that is sufficient for the inequality to hold true, but not necessarily the border case. To that end, I tried FindInstance[%,n], but that just returns the command (I might not be using it correctly?). I am not interested in any pair of (n,r) that satisfies the inequality but really in a function $$n(r)$$ that satisfies the inequality, so FindInstance might actually be the wrong approach.

Does anyone have ideas how to solve the inequality for $$n$$ or how to get a $$n(r)$$ that is sufficient for the inequality to hold?

I also considered this post on solve being too long, but the suggested solution in the comments (restarting mathematica) did not help. It really seems to be the system itself that takes so much time.

Edit I had a small typo in the one constant, I have now updated the formula and code above. The limit of the LHS of the inequality is, as $$n$$ tends towards infinity indeed $$0$$, as one can check by:

Limit[2 Sqrt[
2] E^(2^(-(Log[n]^(1/3)/(10 Log[r]^(1/3)))) (1/(1 +
r))^(-(Log[n]^(1/3)/(10 Log[r]^(1/3)))) - (2^(-2 -
1/5 (Log[n]/Log[r])^(1/3)) (-1 +
r) (1 + r)^(1/5 (Log[n]/Log[r])^(1/3)))/(1 + 3 r)) n^2 Sqrt[
r/(-1 + r)], n -> Infinity, Assumptions -> r > 1]

• Have you tried ContourPlot to at least see how the function n(r) looks like? The shape might also give you an intuition on the functional form or at least an approximation. Commented Aug 7, 2022 at 11:46
• Use CubeRoot to obtain the real cube root of a real number. At least then you will be able to use Plot3D and ContourPlot to get an idea of what you are dealing with. Commented Aug 7, 2022 at 12:21
• It looks like the minimal value of this expression is about 7.07373 at n->1, r->6.78567*10^15. Therefore there is no solution for this problem. Commented Aug 7, 2022 at 13:18
• Thank you for the comments -- you are right, @AlexTrounev, I had a small typo (I'm very sorry!) that changed a lot. I have now updated the post and added a small code sample that illustrates that, now, the limit of the LHS is indeed 0 as n goes towards infinity, so in particular $\leq 1$. Commented Aug 7, 2022 at 13:38
• @AlexTrounev Two of the $5$ changed to $10$ -- should be in both the tex typesetted formula and the expressions (the difference is really subtle, but it changes the limit) Commented Aug 7, 2022 at 13:55

Take Log of function and Log[10,variable] to have a chance to handle it and show a graphic of solution. Also restrict n>1 for real values of Log[n].

f1 = 2 Sqrt[
2] E^(2^(-(Log[n]^(1/3)/(10 Log[r]^(1/3)))) (1/(1 +
r))^(-(Log[n]^(1/3)/(10 Log[r]^(1/3)))) - (2^(-2 -
1/5 (Log[n]/Log[r])^(1/3)) (-1 +
r) (1 + r)^(1/5 (Log[n]/Log[r])^(1/3)))/(1 +
3 r)) n^2 Sqrt[r/(-1 + r)] //
FullSimplify[#, r > 1 && n > 1] &

f2 = Log[f1] // PowerExpand[#, Assumptions -> r > 1 && n > 1] &

sol1 = First@
Solve[rr == Log[10, r]^(1/3) && r > 1 && nn == Log[10, n]^(1/3) &&
n > 1, {r, n}, Reals] // FullSimplify

(*   {r -> ConditionalExpression[10^rr^3, nn > 0 && rr > 0],
n -> ConditionalExpression[10^nn^3, nn > 0 && rr > 0]}   *)

f3[rr_, nn_] =
f2 /. {n -> 10^nn^3, r -> 10^rr^3} //
PowerExpand[#, Assumptions -> rr > 0 && nn > 0] & //
FullSimplify[#, Assumptions -> rr > 0 && nn > 0] &

(*   1/4 (2^(2 - nn/(10 rr)) (1 + 10^rr^3)^(nn/(10 rr)) - (
2^(-(nn/(5 rr))) (-1 + 10^rr^3) (1 + 10^rr^3)^(nn/(5 rr)))/(
1 + 3 10^rr^3) + 8 nn^3 Log[10] + Log[64] + rr^3 Log[100] -
2 Log[-1 + 10^rr^3])   *)

(cp = ContourPlot[f3[rr, nn], {rr, 0, 12}, {nn, 0, 12},
Contours -> {10, 0, -10^3, -10^6, -10^9, -10^12, -10^15},
PlotPoints -> 50, WorkingPrecision -> 50, FrameLabel -> {rr, nn},
ImageSize -> 400];) // AbsoluteTiming


Since function f1 has to be <= 1 , Log of f1 (=f3) has to be <= 0. Get corresponding r and n from sol1: r = 10^(rr^3)

Edit

Generate interpolating function for nn[rr], where f1 == 1, (f3 ==0), regarding nn as a function of rr and differentiating f3. Calculate intial value.

df3 = D[f3[rr, nn[rr]], rr];

nn4 = nn /. First@FindRoot[f3[4, nn] == 0, {nn, 1}]

nnsol = nn /.
First@NDSolve[{Numerator[Together[df3]] == 0, nn[4] == nn4},
nn, {rr, 1, 12}, Method -> "StiffnessSwitching"]

pl = Plot[nnsol[rr], {rr, 1, 12},
PlotStyle -> {Red, Opacity[.3], Thickness[.02]}, PlotRange -> All];

Show[cp, pl]