# I am unable to solve with Reduce, Solve, or NSolve?

I simply want to solve:

Reduce[((M*Exp[β*M*(1 - x)])/β)*((1/M) - β*x - Exp[-β*M*(1 - x)]) + (1/M) == 0, x]


where

&& x > 0 && x < 1 && β >= 0  && M > 0


Apparently, reduce cannot solve and Solve or NSolve gives a warning.

In the end, I just want to plot x versus beta.

• There must be a better way than this: expr = ((M*Exp[β*M (1 - x)])/β)*((1/M) - β*x - Exp[-β*M (1 - x)]) + (1/M); ListPlot[Map[{x, β} /.#&, Map[Last,Select[Table[ NMinimize[{Norm[ expr], x == j, β >= 0, M > 0}, {x, β, M}], {j, .02, .98, .02}], #[] < 10^-6 &]]]] It complains about zero denominators but then selects solutions and plots x versus β.
– Bill
Jul 1, 2018 at 16:28
• I doubt the is an analytical solution for your equation. And if you want to use NSolve, you'll have to specify numeric values for all variables (except x, of course) Jul 1, 2018 at 16:49
• If you tighten your conditions with β >= 0.1 then the complaints about zero denominators go away while not seeming to lose any solutions.
– Bill
Jul 1, 2018 at 17:30
• I think the solution produced by Solve is satisfactory, despite the warning. Jul 2, 2018 at 0:40
• Thanks for that discovery @Bill! I will take a look. Also, @Michael E2, how can we be sure that the solution given by Solve is satisfactory? You don't have to spell everything out, you can just give me an idea. Everyone is very helpful here and non-judgmental it seems. If this was Quora or Reddit, however, I probably would be shamed for such a question.
– user59026
Jul 2, 2018 at 18:48

As Lukas Lang he said it can't be found analytical solution for your equation,only numerically.

I assume Mvalue. M is in range 1..5and has values:

Table[M, {M, 1, 5, 1/2}] // N
(* {1., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5.} *)

func[x_, β_, M_] := 1/M + (E^(M (1 - x) β)M (-E^(-M (1 - x) β) + 1/M - x β))/β

ContourPlot[Evaluate@Table[func[x, β, M] == 0, {M, 1, 5, 1/2}], {β, 0, 1}, {x, 0, 1},
FrameLabel -> Automatic, PlotLegends -> {"M=1", "M=1.5", "M=2", "M=2.5", "M=3", "M=3.5",
"M=4", "M=4.5", "M=5"}] I will use Bill code with little improved by me.It's slow and give artifacts!.Just for the curiosity and comparison.

expr = ((M*Exp[β*M (1 - x)])/β)*((1/M) - β*x - Exp[-β*M (1 - x)]) + (1/M);
ListLinePlot[Table[Map[{β, x} /. # &, Map[Last, Select[Table[
NMinimize[{Norm[expr], x == j, β >= 0}, {β, x},
Method -> "NelderMead"], {j, 1/100, 1, 1/100}], #[] <
10^-5 &]]], {M, 1, 5, 1/2}], PlotRange -> {{0, 1}, {0, 1}},
PlotLabels -> {"M=1", "M=1.5", "M=2", "M=2.5", "M=3", "M=3.5",
"M=4", "M=4.5", "M=5"}, AxesLabel -> {"β", "x[β]"}, AspectRatio -> 1] // Quiet EDITED: 02.07.2018

Approximate solution by series at point x=1/2 of order 3.

eq = ((M*Exp[β*M*(1 - x)])/β)*((1/M) - β*x - Exp[-β*M*(1 - x)]) + (1/M);
eq1 = Series[((M*Exp[β*M*(1 - x)])/β)*((1/M) - β*x -Exp[-β*M*(1 - x)]) +
(1/M), {x, 1/2, 3}] // Normal
sol = x /. Solve[eq1 == 0, x];(*Only first solution !!! *)

Plot[Evaluate@Table[sol[], {M, 1, 5, 1/2}], {β, 0, 1},
PlotRange -> {{0, 1}, {0, 1}},
PlotLabels -> {"M=1", "M=1.5", "M=2", "M=2.5", "M=3", "M=3.5", "M=4",
"M=4.5", "M=5"}, AxesLabel -> {"β", "x[β]"}, AspectRatio -> 1] • Great plots! Thanks! I appreciate your effort. By the way, I found a potential way to evaluate this expression using a fast Fourier transform (hindawi.com/journals/ijem/2015/523043). I am not sure which way would be ideal, since I haven't used this in practice, but I guess I can just compare the results and see what happens!
– user59026
Jul 2, 2018 at 18:44

Besides the complete answers other gave you, I would like to add some considerations. Defining

z=Exp[M (1-x) beta]


for the constraints on M, x, beta you have z>=1. This position gives you the equation

beta (1-z M x)==(M-z)


where z depends on M, x, z. One equation in three unknowns of course cannot give a definite answer.

• Thanks! And, yes, I was aware of this. M is a fixed parameter. One equation and two unknowns, provided I fix the value of M, allows me to express x in terms of beta - which was the aim
– user59026
Jul 2, 2018 at 18:38