Results 1 to 5 of 5

Math Help - Newton-Raphson

  1. #1
    Newbie Foxtenn5's Avatar
    Joined
    Apr 2008
    From
    Maryland
    Posts
    11

    Exclamation Newton-Raphson

    This is the entire problem...

    Use 2 repetitions of the Newton-Raphson algorithm to find the value of x near zero for which e^x=2cosx. (answer to 3 decimal places)

    What I've done so far...

    e^x=2cosx
    x=ln(2cosx)
    f'(x)=-tanx

    xo=0

    x1=0-(ln(2cos0)/(-tan0))

    .....this is where I get stuck b/c my calculator says ERROR since I can't divide by 0. What am I doing wrong???
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor Mathstud28's Avatar
    Joined
    Mar 2008
    From
    Pennsylvania
    Posts
    3,641
    Quote Originally Posted by Foxtenn5 View Post
    This is the entire problem...

    Use 2 repetitions of the Newton-Raphson algorithm to find the value of x near zero for which e^x=2cosx. (answer to 3 decimal places)

    What I've done so far...

    e^x=2cosx
    x=ln(2cosx)
    f'(x)=-tanx

    xo=0

    x1=0-(ln(2cos0)/(-tan0))

    .....this is where I get stuck b/c my calculator says ERROR since I can't divide by 0. What am I doing wrong???
    Do as many methods as you need to to get this

    f_{n+1}=x_n+\frac{f(x_n)}{f'(x_n)}

    We are trying to find the intersection or in other words the zeros of the difference of the two equations?

    So we have e^{x}=2\cos(x)\Rightarrow{e^{x}-2\cos(x)=0}

    We have out equal to zero...therefore our function is e^{x}-2\cos(x)
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie Foxtenn5's Avatar
    Joined
    Apr 2008
    From
    Maryland
    Posts
    11

    Is this how to do it?

    e^x-2cosx
    f'(x)=e^x+2sinx

    Xo=0 (?)

    X1=0-((e^0-2cos0)/(e^0+2sin0))=1

    X2=1-((e^1-2cos1)/(e^1+2sin1))=0.627904


    I ended up with 0.628, but this doesn't seem to be the exact zero.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor Mathstud28's Avatar
    Joined
    Mar 2008
    From
    Pennsylvania
    Posts
    3,641
    Quote Originally Posted by Foxtenn5 View Post
    e^x-2cosx
    f'(x)=e^x+2sinx

    Xo=0 (?)

    X1=0-((e^0-2cos0)/(e^0+2sin0))=1

    X2=1-((e^1-2cos1)/(e^1+2sin1))=0.627904


    I ended up with 0.628, but this doesn't seem to be the exact zero.
    Yes...this is a good approximation...that is what this is...just an approximation..the actual answer is .539...but to get that you would have to do a few more iterations...this is good enough for what you were asked to do...good job
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by Mathstud28 View Post
    Do as many methods as you need to to get this

    f_{n+1}=x_n+\frac{f(x_n)}{f'(x_n)}

    We are trying to find the intersection or in other words the zeros of the difference of the two equations?

    So we have e^{x}=2\cos(x)\Rightarrow{e^{x}-2\cos(x)=0}

    We have out equal to zero...therefore our function is e^{x}-2\cos(x)
    NR gives the itteration:

    x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}

    Then five iterations give:

    Code:
    >x0=0
                0 
    >x1=x0-(exp(x0)-2*cos(x0))/(exp(x0)+2*sin(x0))
                1 
    >x1=x1-(exp(x1)-2*cos(x1))/(exp(x1)+2*sin(x1))
         0.627904 
    >x1=x1-(exp(x1)-2*cos(x1))/(exp(x1)+2*sin(x1))
         0.544207 
    >x1=x1-(exp(x1)-2*cos(x1))/(exp(x1)+2*sin(x1))
         0.539797 
    >x1=x1-(exp(x1)-2*cos(x1))/(exp(x1)+2*sin(x1))
         0.539785
    So after 2 iterations you have a relativly poor approximation, you realy need more iterations

    RonL
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Newton Raphson
    Posted in the Calculus Forum
    Replies: 2
    Last Post: November 12th 2010, 02:42 AM
  2. Newton-Raphson
    Posted in the Algebra Forum
    Replies: 2
    Last Post: July 14th 2009, 01:58 AM
  3. Newton-Raphson
    Posted in the Calculus Forum
    Replies: 1
    Last Post: May 12th 2009, 03:06 AM
  4. newton raphson
    Posted in the Calculus Forum
    Replies: 1
    Last Post: December 17th 2008, 04:23 AM
  5. newton Raphson
    Posted in the Calculus Forum
    Replies: 2
    Last Post: October 15th 2007, 10:43 PM

Search Tags


/mathhelpforum @mathhelpforum