Apologies if this is a stupid question, but here we go: Why doesn't

Minimize[Abs[x] + y, x]

return anything, and how can I fix this? (

By contrast,

Minimize[Abs[x] + 1, x]


Minimize[Abs[x]^2 + y, x]

work just fine.

  • 2
    $\begingroup$ In Mma 11.1.1 Minimize[Abs[x] + y, x] returns {y, {x -> 0}}. Bug? $\endgroup$ – rhermans Aug 24 '17 at 11:10
  • 2
    $\begingroup$ What do you mean by "fixing" it? Mathematica cannot solve all problems that can be solved. This problem is very easy to do by hand, so there is no point to do it with Mathematica. If someone comes up with a sequence of steps that does produce a result for this problem in Mathematica, chances are the same steps won't work for a more complex similar problem. For this reason, I do not think that this is an appropriate question on StackExchange (but I'll refrain from voting to close). $\endgroup$ – Szabolcs Aug 24 '17 at 11:14
  • 2
    $\begingroup$ @Szabolcs In most contexts, people appreciate provision of Minimal Working Examples because it helps elucidate what is going on. I think it is reasonable here too. I agree this is not an error in Mathematica, but I believe it is an oversight that this is not solved (and not simply a feature request), and apparently one which is reasonable, since it has been addressed. Regardless, the purpose of the question was (a) to establish if I was missing something and a different function/option would help; or (b) if there was anything worth learning about the issue. And there was: v11.1 fixes it. $\endgroup$ – Sharkos Aug 24 '17 at 11:30
  • 2
    $\begingroup$ @Szabolcs A reasonable and useful answer to this question would be, for example, "Why: Because this version of Mathematica does not in any situation support minimization with non-differentiable functions containing symbolic parameters. How: By upgrading to v11.1, or manually simplifying the problem." -- assuming that the 'Why' part is correct of course. Extra useful would be an expert's knowledge of what would be within v11.1's capability vis-a-vis symbolic minimization with piecewise functions. $\endgroup$ – Sharkos Aug 24 '17 at 11:47
  • 1
    $\begingroup$ For real values, use Abs[x_] :> Sqrt[x^2] to get a differentiable function. $\endgroup$ – Bob Hanlon Aug 24 '17 at 17:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.