1

I am trying to solve the following equation numerically under Matlab2014b environment.However matlab does not output numerically solutions, it instead output the following

>>solve(1/beta(13,11)*x^(12)*(1-x)^(10)==1.8839,x)
      RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 - (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[1]
      RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 + (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[1]
      RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 - (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[2]
      RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 + (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[2]
      RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 - (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[3]
      RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 + (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[3]
      RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 - (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[4]
      RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 + (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[4]
      RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 - (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[5]
      RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 + (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[5]
      RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 - (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[6]
      RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 + (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[6]
      RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 - (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[7]
      RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 + (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[7]
      RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 - (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[8]
      RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 + (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[8]
      RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 - (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[9]
      RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 + (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[9]
     RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 - (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[10]
     RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 + (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[10]
     RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 - (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[11]
     RootOf(z^11 - 5*z^10 + 10*z^9 - 10*z^8 + 5*z^7 - z^6 + (4096*10^(1/2)*3342794185613871913^(1/2))/66540040320887625, z)[11]

On the other hand, I have no problem of solving the equation with Wolframmath. I am wondering what cause the problem, it may worth noting that the equation does have complex solution but I am only interested in the solution between 0 and 1.

  • Matlab is not as good as wolphram alpha on numerical equation solving. I tried to use a function handle and `fsolve` and `fzero` instead. That function seemed to have some troubles as well, but if the guess was close enough I got an answer. I am not sure if I would trust the resuts, since the root around 0.41 appeared for the call `fsolve(f,0.8)`, but for `fsolve(f,0.6)` I manage to find the root around 0.66. However, I found out that the function `fzero` worked great here. I works exactly as you would expect it to. – patrik Jan 30 '15 at 07:38
  • When I enter the command in 2013a, I do get numerical solutions. I defined x using `syms x` before. Maybe the different lies in the context. Does this happen also if you enter the command directly after startup? – A. Donda Jan 30 '15 at 15:23

1 Answers1

1

I encountered the same problem just now and I think I've found the solution.

From the information I get, MATLAB does this sometime to simply the representation of a analytic solution. To evaluate the solutions, simply call vpafunction. Here is a minimal reproduction and solution.

    syms x
    solve(x^5 + x + 7)

The result will be like

    ans =

     RootOf(z^5 + z + 7, z)[1]
     RootOf(z^5 + z + 7, z)[2]
     RootOf(z^5 + z + 7, z)[3]
     RootOf(z^5 + z + 7, z)[4]
     RootOf(z^5 + z + 7, z)[5]

Simply try

    vpa(ans)

Then the numerical result will show:

    ans =

                                           -1.4108138510595771319852918753499
     - 0.5084694089730227818822736708423 + 1.3686164883298987835863274173391i
     - 0.5084694089730227818822736708423 - 1.3686164883298987835863274173391i
      1.2138763345028113478749196085173 + 0.92418811092205120320563065825557i
      1.2138763345028113478749196085173 - 0.92418811092205120320563065825557i

See MATLAB documentation for detail:

http://au.mathworks.com/help/symbolic/solve.html#zmw57dd0e111869

Alan Wang
  • 465
  • 5
  • 5