# Checking the sign value of the derivatives of a complicated function

Consider the following function:

e[w_] := 1/(2 w (w + a i W) (1 + a i w W)) (2 w^2 + 2 a i w^3 W + a^2 i^2 (-1 + 2 w^2) W^2 - \[Sqrt](a i W (4 (i + lambda) w^3 + 4 a i w^2 (1 + 2 i + 2 lambda + (i + lambda) w^2) W + 4 a^2 i^2 w (1 + i + lambda + 2 (i + lambda) w^2) W^2 + a^3 i^3 (1 + 4 (i + lambda) w^2) W^3)))


I'm trying to do two things. First, I would like to verify whether $$e$$ is an increasing and concave function of $$w$$ under the assumption of $$a \in [0,1]$$, $$i \in [0,1]$$, $$\lambda \in [0,1]$$, $$w>0$$, $$W>0$$. That is, $$\frac{\partial e}{\partial w}>0$$, $$\frac{\partial^2 e}{\partial w^2}<0$$.

Here is my code for this:

Clear["Global*"];
e[w_]:= 1/(2 w (w + a i W) (1 + a i w W)) (2 w^2 + 2 a i w^3 W + a^2 i^2 (-1 + 2 w^2) W^2 - \[Sqrt](a i W (4 (i + lambda) w^3 + 4 a i w^2 (1 + 2 i + 2 lambda + (i + lambda) w^2) W + 4 a^2 i^2 w (1 + i + lambda + 2 (i + lambda) w^2) W^2 + a^3 i^3 (1 + 4 (i + lambda) w^2) W^3)));
Assuming[a > 0 && a < 1 && i > 0 && i < 1 && lambda > 0 && lambda < 1 && w > 0 && W > 0, FullSimplify@Reduce[e'[w] > 0]]
Assuming[a > 0 && a < 1 && i > 0 && i < 1 && lambda > 0 && lambda < 1 && w > 0 && W > 0, FullSimplify@Reduce[e''[w] < 0]]


Second, I would like to find $$w$$ that solves $$\frac{\partial e}{\partial w}=\frac{e}{w}$$ Here is my code for this:

Assuming[a > 0 && a < 1 && i > 0 && i < 1 && lambda > 0 && lambda < 1 && w > 0 && W > 0, FullSimplify@Solve[e'[w] == e[w]/w, w]]


These codes are running forever. Any help please?

• Which is running forever, the solver or the simplifier? Commented Jul 3 at 4:59
• @MichaelE2, I guess it is the solver.
– ppp
Commented Jul 3 at 5:15
• @ppp Function e[w] only depends on two (not four!) parameters a i W and i+lambda Commented Jul 3 at 8:53
• @Ulrich Neumann, thanks, your finding that it only depends on two parameters is very useful!
– ppp
Commented Jul 4 at 11:36

Function e[w]only depends on two parameters a i W and i+lambda

e[w_] := (2 w^2 + 2 a i w^3 W +
a^2 i^2 (-1 +
2 w^2) W^2 - \[Sqrt](a i W (4 (i + lambda) w^3 +
4 a i w^2 (1 + 2 i + 2 lambda + (i + lambda) w^2) W +
4 a^2 i^2 w (1 + i + lambda + 2 (i + lambda) w^2) W^2 +
a^3 i^3 (1 + 4 (i + lambda) w^2) W^3))) /. {W -> aiw/(a i),
lambda -> ip\[Lambda] - i} // Simplify


Its possible now to plot the regions

RegionPlot3D[e'[w] > 0 , {aiw, 0.1, 10}, {ip\[Lambda], 0.1, 10}, {w, 0.1, 20},Evaluated -> True, PlotLabel -> "e'[w]>0",AxesLabel -> {"a i W", "i+lambda", "w"}]


RegionPlot3D[e''[w] < 0 , {aiw, 0.1, 10}, {ip\[Lambda], 0.1, 10}, {w, 0.1, 20}, Evaluated -> True, PlotLabel -> "e''[w]<0",AxesLabel -> {"a i W", "i+lambda", "w"}]


second question

cond = Evaluate[e'[w] - e[w]/w];
ContourPlot3D[ cond  , {aiw, 0.1, 10}, {ip\[Lambda], 0.1, 10}, {w,0.1, 10}, AxesLabel -> {"a i W", "i+lambda", "w"},Contours -> { 0} ]


It looks like cond==0can't be fullfilled in this parameterrange!

• Ulrich Neumann, thanks! According to the plots, it seems e'>0 for the entire region examined, and e''<0 for only a partial region, is this correct? One problem with this simulation approach is that we cannot claim it as generally applicable since the parameter regions are not exhaustive. Maybe an analytical approach is not possible?
– ppp
Commented Jul 3 at 10:54
– ppp
Commented Jul 3 at 10:57
• @ppp I tried to answer your second question in my modifoed answer Commented Jul 3 at 13:29
• Ulrich Neumann, thanks for the answer to the second question. But I am wondering if there is a way to find the analytical solution for w explicitly?
– ppp
Commented Jul 3 at 21:54
• @ppp The condition w e'[w]==e[w] is an expression with a Sqrt term. Eliminating this Sqrt by squaring you get an expression which can be solved using Solve, but solution contains several Root` objects. Commented Jul 4 at 11:42