Solve finds wrong solution?

徘徊边缘 提交于 2020-01-07 05:23:46

问题


I have this equation in x and y:

  (x + y)^(1/2) - 6*y*(x + y)^5 - (x + y)^6 + (x - 1)/(2*(x + y)^(1/2)) = 0.

Now I call the solver:

  R_c = @(y)solve((x + y)^(1/2) - 6*y*(x + y)^5 - (x + y)^6 + (x - 1)/(2*(x + y)^(1/2)), x, 'Real', true);

which gives me the implicit solutions as a function of y. Now try

  R_c(.3)

to find the explicit solution at y = 0.3. MATLAB's answer is:

 ans =

 0.42846617518653978966562924618638
 0.15249587894102346284238111155954
 0.12068186494007759990714181154349

However, the last entry in this array is NOT a solution. Test:

 double(subs(subs((x + y)^(1/2) - 6*y*(x + y)^5 - (x + y)^6 + (x - 1)/(2*(x + y)^(1/2)), x, .12068186494007759990714181154349), y, .3))

yields

 -0.0585.

This is not a rounding error. The other 2 solutions work perfectly and solve the equation correctly. I wonder where MATLAB the third value gets from. Can anyone help?

来源:https://stackoverflow.com/questions/24537096/solve-finds-wrong-solution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!