0% found this document useful (0 votes)
8 views6 pages

Secant Method

secant method

Uploaded by

Abdullah Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views6 pages

Secant Method

secant method

Uploaded by

Abdullah Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

SECANT METHOD

One application of the Secant Method in computer science is in financial


modeling for calculating the internal rate of return (IRR) on investments.
Investors need to determine the IRR to assess the profitability of projects, but
the calculations can be complex. The Secant Method simplifies this by using
two previous estimates to quickly find the rate at which the investment breaks
even. While it may be a minor part of software development, implementing
this algorithm can be very handy for financial analysts, allowing them to make
informed decisions and maximize returns efficiently.

The word secant is derived from


the Latin word secant, which
means to cut. The secant method
uses a secant line, a line joining
two points that cut the curve, to
approximate a root.
MATHEMATICAL REPRESENTATION
Newton’s method is very good and fast but its major weakness is the calculation of
derivative in
𝑓(𝑝𝑛−1 )
𝑝𝑛 = 𝑝𝑛−1 − , for n ≥ 1.
𝑓′ (𝑝𝑛−1 )

To avoid 𝑓 ′ (𝑝𝑛−1 ) in Newton’s method we can replace it with an approximation


𝑓(𝑥) − 𝑓(𝑝𝑛−1 )
𝑓 ′ (𝑝𝑛−1 ) = lim
𝑥→𝑝𝑛−1 𝑥 − 𝑝𝑛−1
If 𝑝𝑛−2 is close to 𝑝𝑛−1 , then
𝑓(𝑝𝑛−1 ) − 𝑓(𝑝𝑛−2 )
𝑓 ′ (𝑝𝑛−1 ) ≈
𝑝𝑛−1 − 𝑝𝑛−2
Putting this approximation in Newton’s Formula gives
𝑓(𝑝𝑛−1 )(𝑝𝑛−1 − 𝑝𝑛−2 )
𝑝𝑛 = 𝑝𝑛−1 −
𝑓(𝑝𝑛−1 ) − 𝑓(𝑝𝑛−2 )
This technique is called the Secant method.

GEOMETRIC REPRESENTATION
Example
Use Secant method to find solution accurate to within 10−5 for 𝑓(𝑥 ) =
𝑥 3 − 2𝑥 2 − 5 in [1, 4].
Solution: For Secant method, let us take 𝑝0 = 2 and 𝑝1 = 3, from [1, 4].
Formula for Secant method is
𝑓(𝑝𝑛−1 )(𝑝𝑛−1 − 𝑝𝑛−2 )
𝑝𝑛 = 𝑝𝑛−1 −
𝑓(𝑝𝑛−1 ) − 𝑓(𝑝𝑛−2 )
* For calculator take 𝑝0 = 𝑥 and 𝑝1 = 𝑦 and write function as
(𝑦 3 − 2𝑦 2 − 5)(𝑦 − 𝑥)
𝑦−
((𝑦 3 − 2𝑦 2 − 5) − (𝑥 3 − 2𝑥 2 − 5))
and for 𝑝2 𝑡𝑎𝑘𝑒 𝑥 = 2 and 𝑦 = 3.
For 𝑝3 𝑡𝑎𝑘𝑒 𝑥 = 3 and 𝑦 = 2.55556 and so on.
So for n=2, we have
𝑓(𝑝1 )(𝑝1 − 𝑝0 )
𝑝2 = 𝑝1 − = 2.55556
𝑓 (𝑝1 ) − 𝑓 (𝑝0 )
𝑓(𝑝2 )(𝑝2 − 𝑝1 )
𝑝3 = 𝑝2 − = 2.66905
𝑓(𝑝2 ) − 𝑓 (𝑝1 )
𝑝4 = 2.69237
𝑝5 = 2.69063
𝑝6 = 2.69065 = 𝑝7 is the solution of f(x).
PROBLEM STATEMENT
As a software developer working on a financial modeling application, you need to
implement a feature that calculates the break-even point for various investment
projects. To find the break-even point, you’ve modeled it using the equation
2𝑥 cos(2𝑥) − (𝑥 − 2)2 = 0
and need to solve for 𝑥 within the range of 2 ≤ 𝑥 ≤ 3. To ensure accurate results,
you decide to apply the Secant Method to find a solution that is accurate to within
10−3 . This implementation will allow users to quickly assess the profitability of their
investments, making your software a valuable tool for financial decision-making.

PYTHON CODE, SOLUTION, AND RESULT


ADVANTAGE/DISADVANTAGE
The convergence of the Secant method is much faster than functional iteration but
slightly slower than Newton’s method. This is generally the case. Newton’s
method or the Secant method is often used to refine an answer obtained by another
technique, such as the Bisection method, since these methods require good first
approximations but generally give rapid convergence.

PRACTICE
Q1. The accumulated value of a savings account based on regular periodic
payments can be determined from the annuity due equation,

In this equation, A is the amount in the account, P is the amount regularly


deposited, and i is the rate of interest per period for the n deposit periods. An
engineer would like to have a savings account valued at $750,000 upon retirement
in 20 years and can afford to put $1500 per month toward this goal. What is the
minimal interest rate at which this amount can be invested, assuming that the
interest is compounded monthly?
Q2. Use Secant method to find solution of 𝑥 3 + 3𝑥 2 − 1 = 0 accurate to within
10−5 for in [-3, -2].

You might also like