0

I'm Having a problem maximizing this function in mathematica:

Maximize[a + 0.3 * b, 0 < b < 10, a]

I just get the above back again as output when I run the code, Not helpfull

However when I maximize the equivalent function:

Maximize[a + (3/10) * b, 0 < b < 10, a]

I get a solution?!?

What is going on here? why does mathematica do this?

1 Answers1

2

If you compare these results you see that the first one switches to use NMaximize due to 0.3 being Real, whereas the second attempts to solve symbolically using Maximise due to 3/10 being Rational. This accounts for the different behaviour.

enter image description here

Map[Head, {0.3, 3/10}]

{Real, Rational}

Chris Degnen
  • 8,443
  • 2
  • 23
  • 40
  • 1
    This seams to explain the issue, but why does mathematica not try to do this on its own is beyond me. And the lack of debugging output is worrying – James Peach Mar 11 '16 at 09:35