Message Boards Message Boards

0
|
5980 Views
|
4 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Maximize function with given parameter not working..

Posted 4 years ago

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 ? enter image description here

If I choose a real value for b, it works. enter image description here

POSTED BY: l b
4 Replies
Anonymous User
Anonymous User
Posted 4 years ago

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.

POSTED BY: Anonymous User

I think it's not a syntax question,the way you use function Maximize is right.enter image description here

POSTED BY: Wang JhONG
Posted 4 years ago

Thanks for the note. But I am still puzzled by the usage of this function. I had checked the reference : https://reference.wolfram.com/language/ref/Maximize.html and it provides a similar example : enter image description here

POSTED BY: l b
Posted 4 years ago

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
POSTED BY: Bill Nelson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract