PRELIM
PRELIM
DISCUSSIONS:
1. TAYLOR SERIES
Definition - In the previous section we started looking at writing down a power series representation of a
function. The problem with the approach in that section is that everything came down to needing to be able to
relate the function in some way to
and while there are many functions out there that can be related to this function there are many more that simply
can’t be related to this. So, without taking anything away from the process we looked at in the previous section,
what we need to do is come up with a more general method for writing a power series representation for a
function. So, for the time being, let’s make two assumptions. First, let’s assume that the function f(x) does in
fact have a power series representation about x=a,
Next, we will need to assume that the function, f(x), has derivatives of every order and that we can in fact find
them all. Now that we’ve assumed that a power series representation exists, we need to determine what the
coefficients, cn, are. This is easier than it might at first appear to be. Let’s first just evaluate everything at x = a.
This gives,
f(a)=C0
So, all the terms except the first are zero and we now know what c0 is. Unfortunately, there isn’t any other value
of x that we can plug into the function that will allow us to quickly find any of the other coefficients. However,
if we take the derivative of the function (and its power series) and then plug it in x=a we get,
and we now know c.
Let’s continue with this idea and find the second derivative.
Hopefully, by this time you’ve seen the pattern here. It looks like, in general, we’ve got the following formula
for the coefficients.
This even works for n=0 if you recall that 0! =1 and define f(0)(x) =f(x).
So, provided a power series representation for the function f(x) about x=a exists the Taylor Series for f(x)
about x=a is,
TAYLOR SERIES;
Example:
As with the last example, we’ll start off in the same manner.
.
So, we get a similar pattern for this one. Let’s plug the numbers into the Taylor Series.
In this case, we only get terms that have an odd exponent on x and as with the last problem once we ignore the
zero terms there is a clear pattern and formula. So, renumbering the terms as we did in the previous example,
we get the following Taylor Series.
EXERCISES:
2. ln (3+4x) about x = 0
2. Bisection method
Definition: The bisection method is used to find the roots of a polynomial equation. It separates the
interval and subdivides the interval in which the root of the equation lies. The principle behind this
method is the intermediate theorem for continuous functions. It works by narrowing the gap between the
positive and negative intervals until it closes in on the correct answer. This method narrows the gap by
taking the average of the positive and negative intervals. It is a simple method and it is relatively slow.
The bisection method is also known as interval halving method, root-finding method, binary search
method or dichotomy method.
Follow the below procedure to get the solution for the continuous function:
Find two points, say a and b such that a < b and f(a)* f(b) < 0
t is the root of the given function if f(t) = 0; else follow the next step
Divide the interval [a, b] – If f(t)*f(a) <0, there exist a root between t and a
The bisection method is an approximation method to find the roots of the given equation by repeatedly
dividing the interval. This method will divide the interval until the resulting interval is found, which is
extremely small.
Example: Determine the root of the given equation x2-3 = 0 for x = [1, 2]
Solution:
Given: x2-3 = 0
The given function is continuous, and the root lies in the interval [1, 2].
I.e., t = (1+2)/2
t =3 / 2
t = 1.5
If f(t)<0, assume a = t.
and
If f(t)>0, assume b = t.
1 1 2 1.5 -2 1 -0.75
So, at the seventh iteration, we get the final interval [1.7266, 1.7344]
MATLAB CODE:
RESULT OF THE CODE:
1. f(x) = x+ 4
2. f(x) = 3x + 6
3. FALSE – POSITION METHOD ( REGULAR FALSE)
Definition - Method of False Position (Regula-Falsi Method) Method of False Position (aka Linear
Interpolation Method) is an iterative method of finding roots of a given equation using a straight line
connecting two points in the curve. Using this straight line, the current estimate is based on the
intersection of the straight line and the x-axis. Consider the curve shown below. Point(xr,0) is an
estimate of the root of the curve y =f(x). Using similar triangles,
Also, the curve y = f(x) will meet the x-axis at a certain point between A[a, f(a)] and B[b, f(b)].
Now, the equation of the chord joining A[a, f(a)] and B[b, f(b)] is given by:
Let y = 0 be the point of intersection of the chord equation (given above) with the x-axis. Then,
If f(x1) ≠ 0 and if f(x1) and f(a) have opposite signs, then we can write the second approximation as:
Example:
1. Find a root for the equation 2ex sin x = 3 using the false position method and correct it to three
decimal places with three iterations.
Solution:
=0–3
= -3 < 0
= 2e sin 1 – 3
= 1.5747 > 0
Let a = 0 and b = 1.
= 3/4.5747
= 0.6557
Thus, x1 = 0.6557
= 2.3493 – 3
= -0.6507 < 0
Let a = 0.6557
= (1.0325 + 0.6507)/(2.2254)
= 1.6832/2.2254
= 0.7563
Therefore, x2 = 0.7563
= 2.9239 – 3
= -0.0761 < 0
= (1.1909 + 0.0761)/1.6508
= 1.2670/1.6508
= 0.7675
So, x3 = 0.768
Therefore, the best approximation of the root up to three decimal places is 0.768 (up to three decimal
places).
PRACTICE:
EXCERCISES
1. Find a root for the equation x3 – 3x + 1 = 0 using the false position method and correct it to three
decimal places with three iterations.
2. Find the root correct to two decimal places of the equation xex = cos x, using the regular false
method.
4. INCREMENTAL SEARCH METHOD
Definition: The approximate locations of the roots are best determined by plotting the function. Often a
very rough plot, based on a few points, is sufficient to provide reasonable starting values. Another useful
tool for detecting and bracketing roots is the incremental search method.
The basic idea behind the incremental search method is simple: If f(x1) and f(x2) have opposite signs,
then there is at least one root in the interval (x1, x2). If the interval is small enough, it is likely to contain
a single root. Thus the zeros of f (x) can be detected by evaluating the function at intervals ∆x and
looking for a change in sign.
There are several potential problems with the incremental search method:
It is possible to miss two closely spaced roots if the search increment x is larger than the spacing of the
roots. A double root (two roots that coincide) will not be detected. Certain singularities (poles) of f (x)
can be mistaken for roots. For example, f (x) = tan x changes sign at x = ± π, n = 1, 3, 5, . . ., as shown
in Figure
Definition: The fixed point iteration method in numerical analysis is used to find an approximate solution to
algebraic and transcendental equations. Sometimes, it becomes very tedious to find solutions to cubic, bi-
quadratic and transcendental equations; then, we can apply specific numerical methods to find the solution; one
among those methods is the fixed point iteration method.
The fixed point iteration method uses the concept of a fixed point in a repeated manner to compute the solution
of the given equation. A fixed point is a point in the domain of a function g such that g(x) = x. In the fixed point
iteration method, the given function is algebraically converted in the form of g(x) = x.
Suppose we have an equation f(x) = 0, for which we have to find the solution. The equation can be expressed as
x = g(x). Choose g(x) such that |g’(x)| < 1 at x = x o where xo,is some initial guess called fixed point iterative
scheme. Then the iterative method is applied by successive approximations given by x n = g(xn – 1), that is, x1 =
g(xo), x2 = g(x1) and so on.
Example 1:
Find the first approximate root of the equation 2x3 – 2x – 5 = 0 up to 4 decimal places.
Solution:
As per the algorithm, we find the value of xo, for which we have to find a and b such that f(a) < 0 and f(b) > 0
Now, f(0) = – 5
f(1) = – 5
f(2) = 7
Thus, a = 1 and b = 2
2x3 – 2x – 5 = 0
⇒ x = [(2x + 5)/2]1/3
The approximate root of 2x3 – 2x – 5 = 0 by the fixed point iteration method is 1.6006.
Example 2:
Find the first approximate root of the equation cos x = 3x – 1 up to 4 decimal places.
Solution:
As per the algorithm, we find the value of xo, for which we have to find a and b such that f(a) < 0 and f(b) > 0
Now, f(0) = 2
f(𝜋/2) = -3𝜋/2 – 1 < 0
Hence, xo is a value lying between 0 and 𝜋/2, for ease of calculation let us take xo = 0
cos x – 3x + 1 = 0
⇒ x = (cos x + 1)/3
EXERCISES:
3. Find the first approximate root of the equation 2x3 – 7x2 – 6x + 1 = 0 up to 4 decimal places.
6. NEWTON RHAPSON METHOD
Definition: The Newton Raphson Method is referred to as one of the most commonly used techniques for
finding the roots of given equations. It can be efficiently generalised to find solutions to a system of equations.
Moreover, we can show that when we approach the root, the method is quadratically convergent. In this article,
you will learn how to use the Newton Raphson method to find the roots or solutions of a given equation, and the
geometric interpretation of this method.
Let x0 be the approximate root of f(x) = 0 and let x1 = x0 + h be the correct root. Then f(x1) = 0
⇒ f(x0 + h) = 0….(1)
f(x0) + hf1(x0) + … = 0
⇒ h = -f(x0) /f’(x0)
Similarly, the successive approximations x2, x3, …., xn+1 are given by
This is called Newton Raphson formula.
Example 1:
Find a real root of the equation -4x + cos x + 2 = 0, by Newton Raphson method up to four decimal places,
assuming x0 = 0.5.
Solution:
x0 = 0/5
f’(x) = -4 – sin x
Now,
x1 = x0 – f(x0)/f’(x0)
= 0.5 – (0.8775/-4.4794)
= 0.5 + 0.1958
= 0. 6958
SAMPLE OF MATLAB:
RESULT OF THE CODE:
PRACTICE
EXERCISES:
1. f(x)=x^3-x-1
2. f(x)=x^3+2x^2+x-1
7. SECANT METHOD
Definition: The secant method is a root-finding procedure in numerical analysis that uses a series of roots of
secant lines to better approximate a root of a function f. Let us learn more about the second method, its formula,
advantages and limitations, and secant method solved example with detailed explanations in this article.
The tangent line to the curve of y = f(x) with the point of tangency (x 0, f(x0) was used in Newton’s approach.
The graph of the tangent line about x = α is essentially the same as the graph of y = f(x) when x 0 ≈ α. The root
of the tangent line was used to approximate α.
Consider employing an approximating line based on ‘interpolation’. Let’s pretend we have two root estimations
of root α, say, x0 and x1. Then, we have a linear function
q(x) = a0 + a1x
The secant method procedures are given below using equation (1).
Step 1: Initialization
Step 2: Iteration
In the case of n = 1, 2, 3, …,
until a specific criterion for termination has been met (i.e., The desired accuracy of the answer or the maximum
number of iterations has been attained).
If the initial values x0 and x1 are close enough to the root, the secant method iterates xn and converges to a root of
function f. The order of convergence is given by φ, where
The convergence is particularly superlinear, but not really quadratic. This solution is only valid under certain
technical requirements, such as f being two times continuously differentiable and the root being simple in the
question (i.e., having multiplicity 1).
There is no certainty that the secant method will converge if the beginning values are not close enough to the
root. For instance, if the function f is differentiable on the interval [x0, x1], and there is a point on the interval
where f’ =0, the algorithm may not converge.
Example:
Compute two iterations for the function f(x) = x3 – 5x + 1 = 0 using the secant method, in which the real roots of
the equation f(x) lies in the interval (0, 1).
Solution:
x0 = 0, x1 = 1, and
f(x0) = 1, f(x1) = -3
= 1 – [(0 – 1) / ((1-(-3))](-3)
= 0.25.
= 0.186441
PRACTICE
EXERCISES:
1. Compute the root of x2e−x/2−1=0 in the interval [0, 2] using the secant method. The root should be
correct to three decimal places. The initial values are 1.42 and 1.43.