# Maximize keeps running forever

**URL:** <https://community.wolfram.com/t/maximize-keeps-running-forever/22080>\
**Category:** Questions\
**Tags:** optimization\
**Created:** [May 16, 2023, 10:53am UTC](https://community.wolfram.com/t/maximize-keeps-running-forever/22080 "2023-05-16T10:53:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anoiato](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@anoiato](https://community.wolfram.com/u/anoiato)\
**Post date:** [May 16, 2023, 10:53am UTC](https://community.wolfram.com/t/maximize-keeps-running-forever/22080/1 "2023-05-16T10:53:14Z")

</div>

Hi everyone. I’m trying to run

```
Maximize[
 ComplexExpand[
  Abs[-(b/(3 a)) + ((1 + I Sqrt[3]) (-b^2 + 3 a c))/(
    3 2^(2/3)
      a (-2 b^3 + 9 a b c - 27 a^2 d + Sqrt[
       4 (-b^2 + 3 a c)^3 + (-2 b^3 + 9 a b c - 27 a^2 d)^2])^(
     1/3)) - ((1 - I Sqrt[3]) (-2 b^3 + 9 a b c - 27 a^2 d + Sqrt[
       4 (-b^2 + 3 a c)^3 + (-2 b^3 + 9 a b c - 27 a^2 d)^2])^(1/3))/(
    6 2^(1/3) a)]], {a, b, c, d}, Integers]

```

But it simply does not return anything and just keeps running - the same happens if I try to maximise over the Reals. I don’t think I’m making any syntax mistakes, but in case you have an idea of what’s wrong, please let me know.

---

<div class="post-metadata">

**Author:** ![dontdont9](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@dontdont9](https://community.wolfram.com/u/dontdont9)\
**Post date:** [May 16, 2023, 8:03pm UTC](https://community.wolfram.com/t/maximize-keeps-running-forever/22080/2 "2023-05-16T20:03:46Z")

</div>

Since you are trying to maximize something that has a large complicated denominator…

I wondered what happened if tried to minimize the square of that denominator

```
Minimize[Denominator[Together[-(b/(3 a))+((1+I Sqrt[3])(-b^2+3 a c))/
  (3 2^(2/3)a(-2 b^3+9 a b c-27 a^2 d+Sqrt[4(-b^2+3 a c)^3+(-2 b^3+
  9 a b c-27 a^2 d)^2])^(1/3))-((1-I Sqrt[3])(-2 b^3+9 a b c-27 a^2 d+
  Sqrt[4(-b^2+3 a c)^3+(-2 b^3+9 a b c-27 a^2 d)^2])^(1/3))/(6 2^(1/3)a)]]^2,{a,b,c,d}]

```

which quickly returns

```
{0, {a -> -1, b -> -1, c -> -1/3, d -> 0}}

```

I believe you have to be careful using that information. I don’t think you can just plug those values into your original expression. But with care I think you might be able to infer your maximum may be infinity.

Please check all this VERY carefully before you even think of trusting it.

---

<div class="post-metadata">

**Author:** ![anoiato](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@anoiato](https://community.wolfram.com/u/anoiato)\
**Post date:** [May 16, 2023, 10:00pm UTC](https://community.wolfram.com/t/maximize-keeps-running-forever/22080/3 "2023-05-16T22:00:59Z")

</div>

Thanks. So I should just assume the expression is too complex but if I wait long enough there will be an answer? I agree the max is probably infinity.
