Newton-Raphson Method
A numerical technique for finding approximate solutions to equations.
Understanding the Roots
Solving Equations Applications
Iterative method converging towards a root. Solving non-linear equations, finding equilibrium points, and
root-finding in engineering and optimization problems.
The Tangent Line Approximation
1 Taylor Expansion 2 Iterative Formula
Approximates f(x) near a guessed solution. xn+1=xn−f(xn)f′(xn).x\_{n+1} = x\_n - \\frac{f(x\_n)}{f'(x\
_n)}.xn+1 =xn −f′(xn )f(xn ) .
Step-by-Step Algorithm
1 Input
Function f(x), its derivative f'(x), initial guess x0,
tolerance ϵ, maximum iterations N.
2 Process
Iteratively compute: xn+1=xn−f(xn)f′(xn).x\_{n+1} = x\_n -
\\frac{f(x\_n)}{f'(x\_n)}.xn+1 =xn −f′(xn )f(xn ) .
3 Output
Approximation of the root xn+1 and the number of
iterations.
Example: Solving x^2 - 4 = 0
Function
f(x) = x^2 - 4, f'(x) = 2x.
Initial Guess
x0 = 1.
Iterations
x1 = 2.5, x2 = 2.05, x3 = 2.0006.
Python Implementation
def newton_raphson(f, df, x0, epsilon=1e-6, max_iter=100):
x = x0
for i in range(max_iter):
fx = f(x)
dfx = df(x)
if abs(fx) < epsilon:
return x
if dfx == 0:
raise ValueError("Derivative is zero. No convergence.")
x = x - fx / dfx
raise ValueError("Maximum iterations reached.")
f = lambda x: x**2 - 4
df = lambda x: 2*x
root = newton_raphson(f, df, 1.0)
print(f"Root: {root}")
Visualizing the Method
Function Plot
1 f(x) = x^2 - 4.
Iterative Steps
2
Marked on the graph.
Convergence
3
Toward the root.
Strengths and Weaknesses
Advantages Disadvantages
Fast convergence, simple implementation. Sensitive to initial guesses, requires derivative
computation, fails if f'(xn) = 0.
Diverse Applications
Physics Engineering Machine Learning
Solving complex equations. Optimization and design. Algorithm development.
In Conclusion
Newton-Raphson method: powerful, widely-used, solves equations,
understand strengths and limitations.