Mathematical Tools for Physics

(coco) #1
11—Numerical Analysis 318

11.2 Solving equations
Example:sinx−x/2 = 0
From the first graph, the equation clearly has three real solutions, but finding them is the problem. The
first method for solvingf(x) = 0is Newton’s method.


x 1
x 0

From the second graph, observe that ifx 0 is taken as a first approximation to the root off, the straight
line tangent to the curve can be used to calculate an improved approximation. The equation of this line is


y−f(x 0 ) =f′(x 0 )(x−x 0 ).

The root of this line isy= 0, with solution


x=x 0 −f(x 0 )/f′(x 0 ).

Call this solutionx 1. You can use this in an iterative procedure to find


x 2 =x 1 −f(x 1 )/f′(x 1 ), (4)

and in turnx 3 is defined in terms ofx 2 etc.
Example: Solvesinx−x/2 = 0. From the graph, a plausible guess for a root isx 0 = 2.


x 1 =x 0 −(sinx 0 −x 0 /2)/(cosx 0 − 1 /2)
= 1. 900995594 f(x 1 ) =. 00452
x 2 =x 1 −(sinx 1 −x 1 /2)/(cosx 1 − 1 /2)
= 1. 895511645 f(x 2 ) =−. 000014
x 3 =x 2 −(sinx 2 −x 2 /2)/(cosx 2 − 1 /2)
= 1. 895494267 f(x 3 ) = 2× 10 −^10
Free download pdf