Question: Using R Studio. 4. The derivative of a function $f(x)$ can be approximated by the Newton's quotient $5frac{f(x+h) - f(x)}{n}$$ f(x+h)-f(x) where $h$ is a

 Using R Studio. 4. The derivative of a function $f(x)$ can

Using R Studio.

4. The derivative of a function $f(x)$ can be approximated by the Newton's quotient $5\frac{f(x+h) - f(x)}{n}$$ f(x+h)-f(x) where $h$ is a small number. Write a function to calculate the Newton's quotient for $f(x) = exp(x)$. The function should take two scalar arguments, $X$ and $h$. Use a default value of $h=1.e-6$. Test your function at the point $x=1$ using the default value of $h$, and compare to the true value of the derivative $f'(1) = e^1$

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!