Use the Taylor series given in Key Idea 8.8.1 to create the Taylor series of the given functions.
\(f(x)=sin(2x+3)\)
library(pracma)
f <- function(x) sin(2*x + 3)
taylor_series <- taylor(f, 0)
print(taylor_series)
## [1] 0.09407953 1.31998927 -0.28224001 -1.97998499 0.14112001
Calculate the first few terms:
\[ f(x) = sin(2x+3)\\ f'(x) = 2cos(2x+3)\\ f''(x) = -4sin(2x+3)\\ f'''(x) = -8cos(2x+3)\\ f''''(x) = 16sin(2x+3)\\ \]
Evaluate at x=0: \[ f(0) = sin(3)\\ f'(0) = 2cos(3)\\ f''(0)= -4sin(3)\\ f'''(0)=-8cos(3)\\ f''''(0)=16sin(3)\\ \]
Use the Taylor Series formula to find the terms:
\[ a_0 = f(0) = sin(3)\\ a_1 = \frac{f'(0)}{1!} = 2cos(3)\\ a_2 = \frac{f''(0)}{2!} = -2sin(3)\\ a_3 = \frac{f'''(0)}{3!} = -\frac{4}{3} cos(3)\\ a_4 = \frac{f''''(0)}{4!} = \frac{2}{3}sin(3) \]
The Taylor Series up until the fourth derivative is:
\[ sin(3) + 2cos(3) -2sin(3) - \frac{4}{3} cos(3) + \frac{2}{3} sin(3) \]