The heart of my question: why can Wolfram|Alpha solve a system of equations (quickly) that Mathematica seems unable to solve? I've seen at least one similar question on this site before, but the answers seem to devolve into "Use this solution method instead ...". I'm wondering what Wolfram|Alpha is doing to solve an equation that Mathematica isn't.

Here's the example that brought this issue to my attention.


Cut/paste that into Wolfram|Alpha and the answer appears quickly. Cut/paste into Mathematica ... and wait.

If I restrict Solve to using Reals, an answer appears quickly. So: is Wolfram|Alpha assuming I want a real solution?

(A secondary question, I guess: are there default "settings" to Solve that I should get used to using to mimic W|A? I.e., just get used to using Reals as I'm not concerned about complex solutions?)

  • 1
    $\begingroup$ Solve[{0.33*p^0.67/B^0.67 - 2 L == 0, .67*B^0.33/p^0.33 - 0.5 L == 0, 100 - 2 B - .5 p == 0} // Rationalize, {p, B, L}] $\endgroup$ – Bob Hanlon Sep 14 '18 at 14:14

That's because the input is not interpreted the same way by Mathematica and W|A.

Mathematica requires precise and unambiguous input. That means that you have the possibility to phrase your problem precisely, but you are also required to phrase it precisely.

W|A is purposefully sloppy. It interprets natural language and makes guesses about what you mean. It's sometimes quite hard to control its interpretation of an input.

It is a common misconception that W|A takes Mathematica syntax. It doesn't—at least it doesn't interpret it the same way as Mathematica would, even if it does interpret certain trivially simple inputs in some way. For the rest, I believe you might as well type English and it won't make a difference.

Solve is meant for symbolic computation with exact numbers. It is not a good idea to use it with inexact input such as yours. Solve (like all other Mathematica functions) also has a specific purpose: solving polynomial equations or equations that can be reduced to such a form.

It appears that you are after an approximate numerical solution. Use the appropriate function: FindRoot. It uses direct numerical schemes such as Newton's method.

FindRoot[{0.33*p^0.67/B^0.67 - 2 L == 0, 
          0.67*B^0.33/p^0.33 - 0.5 L == 0, 
          100 - 2 B - .5 p == 0}, 
  {{p, 1}, {B, 1}, {L, 1}}]
(* {p -> 134., B -> 16.5, L -> 0.671321} *)

I suspect W|A uses FindRoot for this problem.

Note that FindRoot will return at most one solution, and that by their very nature numerical methods won't guarantee the completeness of a solution.

To use symbolic methods, provide appropriate input for the function you are using. 0.33 is not 1/3. I assume you meant 1/3, so let's do this:

Solve[{1/3 p^(2/3)/B^(2/3) - 2 L == 0, 
       2/3*B^(1/3)/p^(1/3) - (1/2) L == 0, 
       100 - 2 B - (1/2) p == 0}, 
   {p, B, L}]
(* {{p -> 400/3, B -> 50/3, L -> 2/3}} *)

Note that if you were solving this with pen and paper, you'd find it a lot easier to handle a power of 1/3 (which can be eliminated by cubing) than a power of 33/100.

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.