Results 1 to 9 of 9

Math Help - Newton Raphson

  1. #1
    Newbie
    Joined
    Feb 2009
    Posts
    11

    Newton Raphson

    Any help with this would be greatly appreciated... I haven't been using maths since I finished high school but have a maths test to do tomorrow as part of an interview. Here is a sample question, and I have no idea where to begin with it!


    Provide reasoning that the equation:

    10 = exp(-2x) + 2^x

    has at least one solution in the range 0 <x < 5

    Use the Newton Raphson technique to find an approximate solution to the equation.

    The Newton Raphson formula provided is:

    <br />
x_2 = x_1 - f(x_1) / f '(x_1)<br />
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Oct 2005
    From
    Earth
    Posts
    1,599
    The method is quite easy actually, it can just be tedious because you have to do many iterations of the calculation to get a good approximation. The basic idea is that you make an initial guess of the zero, which is x_0 , or x_1 from your post. Then you use that guess to find a closer guess, x_2. Now use x_2 as your guess and you'll get x_3, etc. etc. It can take 20-30 iterations for some functions and 10ish for others, really depends on how close you want to get.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor

    Joined
    Apr 2005
    Posts
    15,693
    Thanks
    1466
    Quote Originally Posted by tangehayes View Post
    Any help with this would be greatly appreciated... I haven't been using maths since I finished high school but have a maths test to do tomorrow as part of an interview. Here is a sample question, and I have no idea where to begin with it!


    Provide reasoning that the equation:

    10 = exp(-2x) + 2^x

    has at least one solution in the range 0 <x < 5
    This part, at least, is easy. If x= 0, exp(-2(0))+ 2^0= 1+ 1= 2. If x= 5, exp(-2(5))+ 2^5= exp(-10)+ 32= 32+ some positive number. Since f(x)= exp(-2x)+ 2^x is the sum of continuous functions, it is continuous itself so, since 10 is between 2 and 32, there must be some x, between 0 and 5 so that exp(-2x)+ 2^x= 10.

    Use the Newton Raphson technique to find an approximate solution to the equation.

    The Newton Raphson formula provided is:

    <br />
x_2 = x_1 - f(x_1) / f '(x_1)<br />
    Good! f(x)= exp(-2x)+ 2^x so f'(x)= -2exp(-2x)+ ln(2) 2^x. The rest is arithmetic.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor Reckoner's Avatar
    Joined
    May 2008
    From
    Baltimore, MD (USA)
    Posts
    1,024
    Thanks
    75
    Awards
    1

    Smile

    Quote Originally Posted by tangehayes View Post
    Any help with this would be greatly appreciated... I haven't been using maths since I finished high school but have a maths test to do tomorrow as part of an interview. Here is a sample question, and I have no idea where to begin with it!
    Out of curiosity, what kind of job is it? If you don't mind my asking, that is.

    Provide reasoning that the equation:

    10 = exp(-2x) + 2^x

    has at least one solution in the range 0 <x < 5
    Rewrite it as

    e^{-2x}+2^x-10=0.

    Call the left-hand expression f. Then f(x) is everywhere continuous, so we may apply the intermediate value theorem.

    f(0)=e^0+2^0-10=1+1-10=-8, and f(5)=e^{-10}+2^5-10=\frac1{e^{10}}+32-10=\frac1{e^{10}}+22,

    which is positive. Since 0 lies between those two values, there must be some value c,\;0<c<5, for which f(c)=0.

    Use the Newton Raphson technique to find an approximate solution to the equation.
    First let's differentiate f to get

    f'(x)=\frac d{dx}\left[e^{-2x}+2^x-10\right]

    =-2e^{-2x}+(\ln2)2^x.

    So Newton-Raphson gives the formula

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

    =x_n-\frac{e^{-2x_n}+2^{x_n}-10}{-2e^{-2x_n}+(\ln2)2^{x_n}}

    We know there is a zero somewhere in (0,5), so let us take a guess and try x_1=2.5 as a starting point. Now we iterate:

    \begin{tabular}{c|c}<br />
$x_n$&$x_{n+1}$\\\hline<br />
$2.5$&$3.60975$\\<br />
$3.60975$&$3.34869$\\<br />
$3.34869$&$3.32199$\\<br />
$3.32199$&$3.32175$\\<br />
$3.32175$&$3.32174$<br />
\end{tabular}

    This should be pretty close.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Newbie
    Joined
    Feb 2009
    Posts
    11
    Thanks for that - its very hepful.

    I'm just a little confused as to one part of the differentiation. I'm not sure how you are getting the (ln2)2^x when differentiating 2^x - I thought that would have differentiated to 2??

    math]

    =-2e^{-2x}+(\ln2)2^x.
    [/tex]

    The interview is for a software engineering role in financial services by the way!
    Follow Math Help Forum on Facebook and Google+

  6. #6
    MHF Contributor
    Joined
    Oct 2005
    From
    Earth
    Posts
    1,599
    Whenever you have the form of a constant to a power, a^x the derivative of it is a^x*\ln(a)*dx
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Super Member
    earboth's Avatar
    Joined
    Jan 2006
    From
    Germany
    Posts
    5,830
    Thanks
    123
    Quote Originally Posted by tangehayes View Post
    ...

    I'm just a little confused as to one part of the differentiation. I'm not sure how you are getting the (ln2)2^x when differentiating 2^x
    ...
    If
    f(x) = 2^x you can re-write the RHS to:

    f(x)=\left(e^{\ln(2)}\right)^x = e^{\ln(2)\cdot x}

    Use the chain rule to differentiate this function and you'll get the formula Jameson has posted.
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Super Member
    earboth's Avatar
    Joined
    Jan 2006
    From
    Germany
    Posts
    5,830
    Thanks
    123
    Quote Originally Posted by Reckoner View Post
    ...
    So Newton-Raphson gives the formula

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

    =x_n-\frac{e^{-2x_n}+2^{x_n}-10}{-2e^{-2x_n}+(\ln2)2^{x_n}}

    We know there is a zero somewhere in (0,5), so let us take a guess and try x_1=2.5 as a starting point. Now we iterate:

    \begin{tabular}{c|c}<br />
$x_n$&$x_{n+1}$\\\hline<br />
$2.5$&$3.60975$\\<br />
$3.60975$&$3.34869$\\<br />
$3.34869$&$3.32199$\\<br />
$3.32199$&$3.32175$\\<br />
$3.32175$&$3.32174$<br />
\end{tabular}

    This should be pretty close.
    Quote Originally Posted by tangehayes View Post
    ...

    Use the Newton Raphson technique to find an approximate solution to the equation.

    The Newton Raphson formula provided is:

    <br />
x_2 = x_1 - f(x_1) / f '(x_1)<br />
    From Reckoner's post you could assume that you have a lot of typing to do. But there is a short cut. If and only if your calculator has a \boxed{\text{ANS}} - key the calculation is very easy.

    Type:

    2.5 \boxed{\text{=}}

    Type \boxed{\text{ANS}} instead of x_n in Reckoner's term:

    \boxed{\text{ANS}} - ((e^(-2* \boxed{\text{ANS}}) + 2^ \boxed{\text{ANS}} - 10) / (-2*e^(-2* \boxed{\text{ANS}})+ln(2)*2^ \boxed{\text{ANS}})) \boxed{\text{=}}

    Now the new result is written into the \boxed{\text{ANS}} and you only have to press the \boxed{\text{=}} - key until two consecutive results are equal.
    Follow Math Help Forum on Facebook and Google+

  9. #9
    MHF Contributor Reckoner's Avatar
    Joined
    May 2008
    From
    Baltimore, MD (USA)
    Posts
    1,024
    Thanks
    75
    Awards
    1

    Smile

    Quote Originally Posted by earboth View Post
    From Reckoner's post you could assume that you have a lot of typing to do. But there is a short cut. If and only if your calculator has a \boxed{\text{ANS}} - key the calculation is very easy.
    That's exactly how I did it on my end--I just copied and pasted the values! Thanks for pointing that out, as entering in all of those digits repeatedly could become quite tedious.
    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: December 17th 2008, 04:23 AM
  4. Newton-Raphson
    Posted in the Calculus Forum
    Replies: 4
    Last Post: April 30th 2008, 05:40 AM
  5. newton Raphson
    Posted in the Calculus Forum
    Replies: 2
    Last Post: October 15th 2007, 10:43 PM

Search Tags


/mathhelpforum @mathhelpforum