Hi,
Maybe a very basic syntax question…
I tried to check functionality with text book example:
Maximize[ {log(1+x) + b log(2-x), 1 >= x >= 0 },x]
but it fails to find the analytical solution x = 2-b / 1+b
(even if I add the explicit domain for b :
Maximize[ {log(1+x) + b log(2-x), 1 >= x >= 0 && 1/2<=b<=2 },x] )
Do I miss something ?
If I choose a real value for b, it works.
dontdont9
(Bill Nelson)
March 12, 2020, 5:38am
2
If you carefully consider all the cautions when using derivatives to find maxima then
solve {D[log(1+x) + b log(2-x),x] == 0, 1 >= x >= 0 } for x
immediately returns
x=(2-b)/(b+1) and 1/2 <= Re(b) <= 2 and Im(b) == 0
Thanks for the note. But I am still puzzled by the usage of this function.
I had checked the reference : Maximize—Wolfram Documentation
and it provides a similar example :
wjhnjust
(Wang JhONG)
March 12, 2020, 9:46am
4
I think it’s not a syntax question,the way you use function Maximize is right.
I tried:
Maximize[{log (1 + x) + b log (2 - x), 1 >= x >= 0}, x]
and got plenty of output (conditional of course, as Neslon said must be).
Mathematica gives the maximum values with conditions and then the x coordinates which have them - together in a list.
x = 2-b / 1+b is an extraneous formula to the solution.
I suggest you think about whether the 3 solutions Mathematica gives can be put into that form using algebra and the conditions.