sharks said:
Homework Statement
Solve for positive root of equation: 10 + 3x^2 = e^x
Homework Equations
The usual Newton-Raphson formula.
The Attempt at a Solution
f(x) = 10 + 3x^2 - e^x
f'(x) = 6x -e^x
The first thing to do is to do a simple analysis of the function at hand, which is f(x)=10+3x
2-e
x. The function is continuous everywhere, so that's good. It goes to -∞ (exponentially) as x→+∞, and to +∞ (quadratically) as x→-∞. So there must be at least one zero. Since f(0)=9, at least one of the zeros lies between 0 and +∞.
Newton-Raphson has big problems when f'(x) is zero. In this case, f'(x)=6x-e
x is negative at x=0, negative for very large x, but is positive for x=1. So we have a potential problem. f'(x) is positive for x=2 as well, negative for x=3. Choosing an initial guess between 0 and 2 might well be a very bad idea here.
The graphs of 10+3x
2 and e
x do cross somewhere between x=0 and x→+∞. I'll hold off on the rest of my comments on the specific problem at hand you yourself have a better guess as to how to proceed. I will comment on your last post.
sharks said:
I am aware that most of the time (from what i read in my little online research) any arbitrary value can be chosen
Most of the time you should expect that NR will behave badly. That's why more powerful techniques such as Levenberg–Marquardt only use NR (actually, Gauss-Newton) when the candidate solution is in an a region where Newton's method is well-behaved.
but here i need to choose an initial value that's reasonable so that i can complete the problem in less time (exams, tests) and i also need to make sure that the oscillations don't go on endlessly or give me no roots, as sometimes is the case (again, from what i read and understood).
There are tests to see if something bad has happened. But generic rules to guarantee a good choice? No. For example, ...
However, i asked one of my friends (who also has no definitive idea on how to do this) and he tells me that as a general rule, i should always evaluate f(0) and then use that value as the initial value. Is that correct and common practice? Or am i just being misled into more confusion, if that's even possible?
Here's a simple counterexample: f(x)=x^2+2x-1. f(0)=-1, and f'(-1)=0. Kaboom!