Reading into this week’s discussion and looking for other resources to understand the material, I ran across the mention of the animation package which had some interesting features built in, including Newton’s method. Looking for examples I found a previous submission for this class (see link below). I chose to scrap my original markdown and use this package for 3 separate problems (not the one already done by Bethany Poulin)

Link to her work: https://rpubs.com/bpoulin-CUNY/386609

Exercise 4.1

In Exercises 9 – 12, use Newton’s Method to approximate all roots of the given functions accurate to 3 places after the decimal. If an interval is given, find only the roots that lie in that interval. Use technology to obtain good initial approximations.

Question 9: \[f(x)={ x }^{ 3 }+5{ x }^{ 2 }-x-1\]

library(animation)
## Warning: package 'animation' was built under R version 3.6.3
newton.method(FUN = function(x) x^3+5*x^2 -x -1, tol = 0.001, interact = FALSE)

Question 10:

\[f(x)={ x }^{ 4 }+2{ x }^{ 3 }-7{ x }^{ 2 }-x+5\]

newton.method(FUN = function(x) x^4+2*x^3 - 7*x^2 -x +5, tol = 0.001, interact = FALSE)

Problem 11 can be found at https://rpubs.com/bpoulin-CUNY/386609

Problem 12 \[f(x)={ x }^{ 2 }\cos { x } +\left( x-1 \right) \sin { x } on\quad \left( -3,3 \right) \]

newton.method(FUN = function(x) x^2*cos(x)+(x-1)*sin(x), init= -2, rg= c(-3,3, tol = 0.001), interact = FALSE)

```