【急】如何用mathematica求方程 cotx=1/x-x/2 最接近于0的两个正根?用FindRoot[Cot[x]-1/x+x/2==0,{x,0}]求会报错,而且还要求两个\(Power::"infy" \(\(:\)\(\ \)\) "Infinite expression \(1\/0.`\) encountered."\)\[Infinity]::"indet":"Indeterminate expression \(\(\(0.` \[InvisibleSpace]\\)\) + \*InterpretationBox[\"ComplexInfinity\",DirectedInfinity[]] + \\*InterpretationBox[\"ComplexInfinity\",DirectedInfinity[]]\) encountered."FindRoot::"frnum":"Function \({Indeterminate}\) is not a length \

问题描述:

【急】如何用mathematica求方程 cotx=1/x-x/2 最接近于0的两个正根?
用FindRoot[Cot[x]-1/x+x/2==0,{x,0}]求会报错,而且还要求两个
\(Power::"infy" \(\(:\)\(\ \)\)
"Infinite expression \(1\/0.`\) encountered."\)
\[Infinity]::"indet":"Indeterminate expression \(\(\(0.` \[InvisibleSpace]\
\)\) + \*InterpretationBox[\"ComplexInfinity\",DirectedInfinity[]] + \
\*InterpretationBox[\"ComplexInfinity\",DirectedInfinity[]]\) encountered."
FindRoot::"frnum":"Function \({Indeterminate}\) is not a length \(1\) \
list of numbers at \({x}\) = \({0.`}\)."

Cot[x] - 1/x + x/2在0处是奇点,所以FindRoot[Cot[x]-1/x+x/2==0,{x,0}]当然不行.你应该FindRoot[Cot[x]-1/x+x/2==0,{x,0.1}]或FindRoot[Cot[x]-1/x+x/2==0,{x,-0.1}]不过注意到该函数唯一的“根”:0被抠掉了,所以...