Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

As it can be shown that the function f(x)=3x^3-9x+1 has a single root in the interval abierto (0,1). Try to solve using Newton Raphson method, but that is more than a demonstration calculation

share|improve this question

2 Answers 2

f[x_] = 3 x^3 - 9 x + 1;

Solve[{f[x] == 0, 0 < x < 1}, x] // N

{{x -> 0.111574}}

Reduce[{f[x] == 0, 0 < x < 1}, x] // ToRules // N

{x -> 0.111574}

FindRoot[f[x], {x, .5}]

{x -> 0.111574}

Newton-Raphson

x -> FixedPoint[# - f[#]/f'[#] &, .5]

x -> 0.111574

share|improve this answer

Try the following form of FindRoot:

FindRoot[f[x], {x, 0, 1}, Method -> "Brent"]

This form with the Method -> "Brent" gives very good performance and stable results even in pathological cases (when two roots of the cubic equation are very close to each other but only one of them lies in the interval {0, 1}).

share|improve this answer
    
+1 for a vocabulary lesson :) –  mfvonh Jun 6 at 5:08
    
@mfvonh "+1"? You forgot to actually upvote. :) –  Alexey Popkov Jun 6 at 5:12
    
details, details –  mfvonh Jun 6 at 5:19
    
What kind of details do you need? –  Alexey Popkov Jun 6 at 5:25
    
Oh I was just making light of the fact that I missed the all-important "detail" (upvoting, now fixed :D) –  mfvonh Jun 6 at 5:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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