How to use taylor series to approximate the derivative?

10 views (last 30 days)
Ok, here is the question: Evaluate error and appropriate step size if an analytical solution is not available. Consider the following equation: f(x)=x^n/(x^n+A^n) Assume that no analytical solution for the first derivative is available. Use a 1st order and 2nd order Taylor Series approximation to estimate the derivative as a function of step size h. Make a plot of the first derivative at x=3 as a function of h. Assume values of n=0.5, A=5. How would you use this data to justify using a given “h” value as being an accurate estimate of the derivative?
I understand how to use taylor series to find out the errors, but I do not know how to approximate the derivatives by using taylor series. I know there is build-in taylor series functions but here the question needs to plot the relationship between step size h and the derivative.
  1 Comment
Roger Stafford
Roger Stafford on 22 Jan 2013
I think you should ask for a clarification of that problem from your instructor. The difficulty is that if you obtain a valid series expansion for f(x+h) about some value x like x = 3 in powers of h out to the second order, this will actually give you the exact value of the derivative at x (and even the second derivative,) not an approximation. It becomes an approximation only in the neighborhood of x. On the other hand if you use taylor's theorem to construct such an series, it would require knowing the first and second derivatives. I am betting that he or she meant to say x "in the neighborhood", and not "at", of 3.
You can obtain a valid series expansion of f(x+h) about x in powers of h without knowing the derivatives by using the binomial expansion which works even with fractional powers for n. Write
f(x+h) = (x+h)^n/((x+h)^n+a^n)
= 1/(1 + (a/(x+h))^n)
= 1/(1 + a^n/x^n*(1+h/x)^(-n))
and then use binomial expansion for the exponent -n to get:
(1+h/x)^(-n) = 1 - n/x*h + n*(n+1)/2/x^2*h^2 + ... (drop higher powers of h)
Then substitute this in the above and use the binomial expansion there for a -1 exponent (since the quadratic in h will be in the denominator.)

Sign in to comment.

Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!