Question

In: Computer Science

Find the first 6 terms of the Taylor Series for ln (x) around 1, that is...

Find the first 6 terms of the Taylor Series for ln (x) around 1, that is x = c = 1. Then use your results to calculate ln (3.52) and get the absolute error.

I'm supposed to find the first 6 terms of the Taylor series for the functions ln (x ) centered at 1 that is x = c = 1.( or a=1). Then use the results to calculate ln (3.52) and get the absolute error.

Solutions

Expert Solution

Here , since it is Computer Science question , So Done with the help of python language

Here first 6 terms of taylor series is printed first

after then the value at each terms for 3.52 is printed

SInce ln(x) , so its 1st value will always be 0.

Code:->

START

import math

n = 6
x = "x"
print("First 6 terms of Taylor Series for ln(x) given x=1 ")
print("1 0")
for i in range(1,n):
f = str(((-1)**(i-1)))
f = f + "(x-1)"*i + "/" + str(i)
print(i+1,f)

print("Now calculating for 3.52 value")
print("1 0")
x = 3.52
taylor_sum = 0
for i in range(1,n):
z = ((-1)**(i-1))*((x-1)**(i))/i
taylor_sum = taylor_sum + z
print(i+1,z)
print("Value of ln(3.52) using taylor series till 6th term : ",taylor_sum)
print("Actual Value of ln(3.52) : ",math.log(3.52))
print("Absolute error for ln(3.52) using taylor series till 6th term is : " ,math.log(3.52)-taylor_sum)


END

OUTPUT :->

First 6 terms of Taylor Series for ln(x) given x=1
1. 0
2. 1(x-1)/1
3. -1(x-1)(x-1)/2
4. 1(x-1)(x-1)(x-1)/3
5. -1(x-1)(x-1)(x-1)(x-1)/4
6. 1(x-1)(x-1)(x-1)(x-1)(x-1)/5


Now calculating for 3.52 value
1. 0
2. 2.52
3. -3.1752000000000002
4. 5.334336
5. -10.081895040000001
6. 20.32510040064
Value of ln(3.52) using taylor series till 6th term : 14.922341360639999
Actual Value of ln(3.52) : 1.2584609896100056
Absolute error for ln(3.52) using taylor series till 6th term is : -13.663880371029993

Reason for such large difference in absolute error is because taylor series works for n= infinity
And, here we are working for only first 6 parts .



Related Solutions

(e) Find the first 4 terms of the Taylor series for the following functions (i) ln...
(e) Find the first 4 terms of the Taylor series for the following functions (i) ln x centered at x0 = 1 . [8] (ii) sin x centered at x0 = π 4
Find the first four terms in the Taylor series expansion of the solution to y′′(x) −...
Find the first four terms in the Taylor series expansion of the solution to y′′(x) − 2xy′(x) + 2y(x) = 0, y(0) = 1, y′(0) = 0.
Find the Taylor series of f(x)=ln(3+2x) about x=0.
Find the Taylor series of f(x)=ln(3+2x) about x=0.
Use the definition of Taylor series to find the first three nonzero terms of the Taylor...
Use the definition of Taylor series to find the first three nonzero terms of the Taylor series (centered at c) for the function f. f(x) = 7 tan x,  c = 9π
Compute the Taylor series at x = 0 for ln(1+x) and for x cos x by...
Compute the Taylor series at x = 0 for ln(1+x) and for x cos x by repeatedly differentiating the function. Find the radii of convergence of the associated series.
(a) Determine the Taylor Series centered at a = 1 for the function f(x) = ln...
(a) Determine the Taylor Series centered at a = 1 for the function f(x) = ln x. (b) Determine the interval of convergence for this Taylor Series. (c) Determine the number n of terms required to estimate the value of ln(2) to within Epsilon = 0.0001. Can you please help me solve it step by step.
Find at least the first four nonzero terms of the power series expansion around x =...
Find at least the first four nonzero terms of the power series expansion around x = 0 for the general solution of the differential equation y"+ x²y'- xy = 0.
Use a definition of power series, to find he first 5 terms of a Taylor series...
Use a definition of power series, to find he first 5 terms of a Taylor series of f(x) at a =9 for f(x)=root of x
use the definition of the Taylor series to find the first four nonzero terms of the...
use the definition of the Taylor series to find the first four nonzero terms of the series for f(x) centered at x = a a) f(x) = xe^x, a = 0 b) f(x) = sin (x), a = π/6
Find the first four terms in the Taylor series expansion of the solution to a. y′(x)=y(x)−x,y(0)=2....
Find the first four terms in the Taylor series expansion of the solution to a. y′(x)=y(x)−x,y(0)=2. b. y′(x)=2xy(x)−x3,y(0)=1. c. (1+x)y′(x)=py(x),y(0)=1. d. y′(x) = ?x2 + y2(x), y(0) = 1. e. y′′(x)−2xy′(x)+2y(x)=0,y(0)=1,y′(0)=0.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT