I am trying to code the following maximization program that I am not able to solve algebraically (Of course I manage to get the first derivative, but struggle finding its root):
$\begin{equation} Max_{\{F\}} F \cdot (1+\alpha \cdot ln(1-\frac{F}{\alpha})) \end{equation} \\ \text{Subject to: }F>0, F<\alpha \\ \text{where } \alpha > 0 \text{ is a parameter (real).}$
The function is indeed concave and has indeed a solution (unique), based on the graph:
f[a_Real, x_Real] := x*(1 + a*Log[1 - x/a])
Manipulate[Plot[f[a, x], {x, 0, a}], {a, 0, 5, 0.01}]
So far I've tried the brute force (no restriction on domain(s)) following code (solving for first derivative equal zero):
g[a_Real, x_Real] := D[x*(1 + a*Log[1 - x/a]), x]
Solve[g[a, x] == 0,x]
Unfortunately, I get the following error "Solve: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information."
I am VERY new to Wolfram Mathematica, and don't really understand how to do this...
Would there be a more efficient code that would allow me to get a closed form solution for $F$ (as a function of $\alpha$) solving this program ?
g[a_?NumericQ] := Maximize[{x*(1 + a*Log[1 - x/a]), x >= 0 && x <= a}, x]
. For example,g[1]
performs{((E^2 - E^ProductLog[E^2]) (1 + Log[1 - (E^2 - E^ProductLog[E^2])/E^2]))/E^2, {x -> ( E^2 - E^ProductLog[E^2])/E^2}}
. You may preferNMaximize
instead of. $\endgroup$