3
$\begingroup$

I am trying to solve the following inequality

2 y(Log[1 + (y-1)x] - x Log[y]) - x(1 - x)(y - 1)^2 < 0 

where

y > 1 && x < 1/2 && x > 0.

RegionPlot can handle my description but any other command (Reduce, Solve) can not. I would like Mathematica to help me extract an explicit relation between $x$ and $y$. Any help?

$\endgroup$
  • 2
    $\begingroup$ Can you post the Mathematica code you tried? $\endgroup$ – Moo Dec 18 '19 at 13:40
  • 1
    $\begingroup$ I strongly doubt that there is a closed-form solution to this equation for $x$ or $y$ in terms of elementary functions. In general, equations that can be solved for one variable or the other are the exception, not the rule. $\endgroup$ – Michael Seifert Dec 18 '19 at 14:57
  • $\begingroup$ If I plot RegionPlot[2 y(Log[1 + (y-1)x]- x Log[y])- x(1-x)(y-1)^2<0, {x, 0, 0.5}, {y, 1, 1000}], graph suggests that for all x there exists a threshold y(x) above which the inequality is satisfied. I would like to extrapolate the threshold y(x), as I can't do it analytically. Impossible? Thanks for your replies $\endgroup$ – mathastri Dec 18 '19 at 15:58
2
$\begingroup$

Extending answer by user64494

Clear["Global`*"]

$Version

(* "12.0.0 for Mac OS X x86 (64-bit) (April 7, 2019)" *)

(data = Table[{y, 
     Reduce[2*y*(Log[1 + (y - 1)*x] - x*Log[y]) - x*(1 - x)*(y - 1)^2 < 0 && 
       x >= 0 && x <= 1/2 && y > 1, x, Reals]}, {y, 11/10, 3, 1/10}]) // 
 Short[#, 3] &

enter image description here

The upper bound on x is 1/2 and the lower bound is a function of y. Use Interpolation to approximate the lower bound for a specified range of y.

xLowerBound = Interpolation[{#[[1]], #[[2, 1]]} & /@ data];

Plotting the range on x as a function of y

Plot[{1/2, xLowerBound[y]}, {y, 11/10, 3},
 Filling -> {1 -> {2}}, Frame -> True,
 FrameLabel -> (Style[#, 14, Bold] & /@ {y, xRange}),
 PlotLegends ->
  Placed[{"upper bound", "lower bound"}, {0.25, 0.25}]]

enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks a lot! I am working on your reply. $\endgroup$ – mathastri Dec 19 '19 at 9:57
  • $\begingroup$ Thank you very much for your help, this is what I was looking for. I am not familiar with the interpolation command (and rather new to Mathematica in general), and even after checking the manual I do not fully understand what is inside the square brackets {#[[1]], #[[2, 1]]} & /@ data]. Thanks again $\endgroup$ – mathastri Dec 19 '19 at 23:41
  • $\begingroup$ data elements have form {y, lowerbound < x <= upperbound}. {#[[1]], #[[2, 1]]} & is pure Function that extracts (using Part([[...]])) pair {y, lowerbound} from a data element. Pure function is mapped (/@) onto data to generate {y, lowerbound} pairs. {y, lowerbound} pairs are input to Interpolation to produce xLowerBound pure function. $\endgroup$ – Bob Hanlon Dec 20 '19 at 0:08
4
$\begingroup$

Here is an explanation. Up to the documentation to Reduce, the command solves transcendental inequalities, solvable using inverse functions. When trying

ClearAll[x, y];y = 2;Reduce[2 *y*(Log[1 + (y - 1)*x] - x* Log[y])- x*(1 - x)*(y - 1)^2 < 0&& 
  x >= 0 && x <= 1/2 && y > 1, x, Reals]

, the code is running for several minutes, resulting in

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

and

Root[{4 Log[1 + #] - # - 4 Log[2] # + #^2& , 0.37252233714804266228535622730788445063`20.363517360744417}] < x <= 1/2

This means Mathematica is not able to solve the above inequality, making use of inverse functions, so Mathematica solves it numerically. Every soft has its limitations. Perhaps, this is impossible at all.

PS. A similar example is given in the "Exp-log equation" section.

| improve this answer | |
$\endgroup$
  • $\begingroup$ thank you for your time $\endgroup$ – mathastri Dec 18 '19 at 16:37
4
$\begingroup$

Since you can not get an analytical solution y[x], generate an interpolating function ysol[x] solving the differentiated equation with NDSolve. Get initial value with FindRoot.

g[x_, y_] = 2*y*(Log[1 + (y - 1)*x] - x*Log[y]) - x*(1 - x)*(y - 1)^2;

dgl = D[g[x, y[x]] == 0, x] // FullSimplify;

yfr = y /. First@FindRoot[g[1/3, y] == 0, {y, 5}]

ysol = y /. First@NDSolve[{dgl, y[1/3] == yfr}, y, {x, 10^-6, 1/2}]

p1 = RegionPlot[y > ysol[x], {x, 0, 1/2}, {y, 1, 200}, 
        PlotPoints -> 50]
| improve this answer | |
$\endgroup$
  • $\begingroup$ +1. It's an unexpected approach. Can you kindly comment your code? A good code is a commented code. TIA. $\endgroup$ – user64494 Dec 18 '19 at 19:03
  • $\begingroup$ Regard y as a function of x, y -> y[x]. When differentiating an equation, you get derivative terms, but equation is still valid. You can solve the found differential equation with initial value found from equation. $\endgroup$ – Akku14 Dec 18 '19 at 19:46
  • $\begingroup$ This approach produces an incorrect result when slices consist of several intervals. $\endgroup$ – user64494 Dec 19 '19 at 10:48
  • 1
    $\begingroup$ You can of course adapt it to that cases. This here is an answer to this question here. $\endgroup$ – Akku14 Dec 19 '19 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.