Finite-difference of the derivative at an arbitrary location
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
The second-order, centered-approximation, finite difference of the derivative of $f(x)$ at $x$ is:
$$
f'(x)=frac-f(x-Delta x)+f(x+Delta x)2Delta x
$$
Question: Suppose we have the value of $f'(x)$ throughout our finite-difference grid with grid spacing $Delta x$. Let $f'(x_0)$ be such a value at $x_0$. Is there a way to find $f'(x)$ at an arbitray location between $(x_0-Delta x,x_0+Delta x)$ based on the value of $f'(x_0)$?
Attempt: I tried linearly interpolating the value of $f'(x_0)$ between $(x_0-Delta x,x_0+Delta x)$. However, the result was incorrect.
numerical-methods finite-differences
 |Â
show 2 more comments
up vote
0
down vote
favorite
The second-order, centered-approximation, finite difference of the derivative of $f(x)$ at $x$ is:
$$
f'(x)=frac-f(x-Delta x)+f(x+Delta x)2Delta x
$$
Question: Suppose we have the value of $f'(x)$ throughout our finite-difference grid with grid spacing $Delta x$. Let $f'(x_0)$ be such a value at $x_0$. Is there a way to find $f'(x)$ at an arbitray location between $(x_0-Delta x,x_0+Delta x)$ based on the value of $f'(x_0)$?
Attempt: I tried linearly interpolating the value of $f'(x_0)$ between $(x_0-Delta x,x_0+Delta x)$. However, the result was incorrect.
numerical-methods finite-differences
What do you mean "the result was incorrect"? What did you do, and what is the correct answer?
– Andrei
yesterday
Why do you think this is "second order"?
– David G. Stork
yesterday
@DavidG.Stork Because the error is proportional to $(Delta x)^2$. This is taken from my textbook, too.
– A Slow Learner
yesterday
So what is a "first order" method? (And $0$th order?)
– David G. Stork
yesterday
@Andrei The way I performed interpolation is: I let $f'(x)$ at $x_0-Delta x$ to be the maximum value, and $f'(x)$ at $x_0$ to be half the max value. I also assumed that $f'(x)$ is linear between $(x-Delta x_0,x+ Delta x_0)$. I don't know the correct result, but the result that I obtained didn't make sense in a bigger problem that I am working on.
– A Slow Learner
yesterday
 |Â
show 2 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
The second-order, centered-approximation, finite difference of the derivative of $f(x)$ at $x$ is:
$$
f'(x)=frac-f(x-Delta x)+f(x+Delta x)2Delta x
$$
Question: Suppose we have the value of $f'(x)$ throughout our finite-difference grid with grid spacing $Delta x$. Let $f'(x_0)$ be such a value at $x_0$. Is there a way to find $f'(x)$ at an arbitray location between $(x_0-Delta x,x_0+Delta x)$ based on the value of $f'(x_0)$?
Attempt: I tried linearly interpolating the value of $f'(x_0)$ between $(x_0-Delta x,x_0+Delta x)$. However, the result was incorrect.
numerical-methods finite-differences
The second-order, centered-approximation, finite difference of the derivative of $f(x)$ at $x$ is:
$$
f'(x)=frac-f(x-Delta x)+f(x+Delta x)2Delta x
$$
Question: Suppose we have the value of $f'(x)$ throughout our finite-difference grid with grid spacing $Delta x$. Let $f'(x_0)$ be such a value at $x_0$. Is there a way to find $f'(x)$ at an arbitray location between $(x_0-Delta x,x_0+Delta x)$ based on the value of $f'(x_0)$?
Attempt: I tried linearly interpolating the value of $f'(x_0)$ between $(x_0-Delta x,x_0+Delta x)$. However, the result was incorrect.
numerical-methods finite-differences
edited yesterday


Somos
10.8k1831
10.8k1831
asked yesterday
A Slow Learner
378211
378211
What do you mean "the result was incorrect"? What did you do, and what is the correct answer?
– Andrei
yesterday
Why do you think this is "second order"?
– David G. Stork
yesterday
@DavidG.Stork Because the error is proportional to $(Delta x)^2$. This is taken from my textbook, too.
– A Slow Learner
yesterday
So what is a "first order" method? (And $0$th order?)
– David G. Stork
yesterday
@Andrei The way I performed interpolation is: I let $f'(x)$ at $x_0-Delta x$ to be the maximum value, and $f'(x)$ at $x_0$ to be half the max value. I also assumed that $f'(x)$ is linear between $(x-Delta x_0,x+ Delta x_0)$. I don't know the correct result, but the result that I obtained didn't make sense in a bigger problem that I am working on.
– A Slow Learner
yesterday
 |Â
show 2 more comments
What do you mean "the result was incorrect"? What did you do, and what is the correct answer?
– Andrei
yesterday
Why do you think this is "second order"?
– David G. Stork
yesterday
@DavidG.Stork Because the error is proportional to $(Delta x)^2$. This is taken from my textbook, too.
– A Slow Learner
yesterday
So what is a "first order" method? (And $0$th order?)
– David G. Stork
yesterday
@Andrei The way I performed interpolation is: I let $f'(x)$ at $x_0-Delta x$ to be the maximum value, and $f'(x)$ at $x_0$ to be half the max value. I also assumed that $f'(x)$ is linear between $(x-Delta x_0,x+ Delta x_0)$. I don't know the correct result, but the result that I obtained didn't make sense in a bigger problem that I am working on.
– A Slow Learner
yesterday
What do you mean "the result was incorrect"? What did you do, and what is the correct answer?
– Andrei
yesterday
What do you mean "the result was incorrect"? What did you do, and what is the correct answer?
– Andrei
yesterday
Why do you think this is "second order"?
– David G. Stork
yesterday
Why do you think this is "second order"?
– David G. Stork
yesterday
@DavidG.Stork Because the error is proportional to $(Delta x)^2$. This is taken from my textbook, too.
– A Slow Learner
yesterday
@DavidG.Stork Because the error is proportional to $(Delta x)^2$. This is taken from my textbook, too.
– A Slow Learner
yesterday
So what is a "first order" method? (And $0$th order?)
– David G. Stork
yesterday
So what is a "first order" method? (And $0$th order?)
– David G. Stork
yesterday
@Andrei The way I performed interpolation is: I let $f'(x)$ at $x_0-Delta x$ to be the maximum value, and $f'(x)$ at $x_0$ to be half the max value. I also assumed that $f'(x)$ is linear between $(x-Delta x_0,x+ Delta x_0)$. I don't know the correct result, but the result that I obtained didn't make sense in a bigger problem that I am working on.
– A Slow Learner
yesterday
@Andrei The way I performed interpolation is: I let $f'(x)$ at $x_0-Delta x$ to be the maximum value, and $f'(x)$ at $x_0$ to be half the max value. I also assumed that $f'(x)$ is linear between $(x-Delta x_0,x+ Delta x_0)$. I don't know the correct result, but the result that I obtained didn't make sense in a bigger problem that I am working on.
– A Slow Learner
yesterday
 |Â
show 2 more comments
1 Answer
1
active
oldest
votes
up vote
0
down vote
You asked for an approximation to $ f'(x). $ Using simple algebra the answer is
$$ f'(x) approx frac f(x_0+Delta x) - f(x_0-Delta x) 2 Delta x +
2(x - x_0)frac f(x_0+Delta x) - f(x_0) + f(x_0-Delta x) Delta x^2 $$
where the two fractions are approximations to the first and second derivatives of $ f(x) $ at $ x = x_0. $
You can check that when $ f(x) $ is a quadratic polynomial, then the approximation is exact.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You asked for an approximation to $ f'(x). $ Using simple algebra the answer is
$$ f'(x) approx frac f(x_0+Delta x) - f(x_0-Delta x) 2 Delta x +
2(x - x_0)frac f(x_0+Delta x) - f(x_0) + f(x_0-Delta x) Delta x^2 $$
where the two fractions are approximations to the first and second derivatives of $ f(x) $ at $ x = x_0. $
You can check that when $ f(x) $ is a quadratic polynomial, then the approximation is exact.
add a comment |Â
up vote
0
down vote
You asked for an approximation to $ f'(x). $ Using simple algebra the answer is
$$ f'(x) approx frac f(x_0+Delta x) - f(x_0-Delta x) 2 Delta x +
2(x - x_0)frac f(x_0+Delta x) - f(x_0) + f(x_0-Delta x) Delta x^2 $$
where the two fractions are approximations to the first and second derivatives of $ f(x) $ at $ x = x_0. $
You can check that when $ f(x) $ is a quadratic polynomial, then the approximation is exact.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
You asked for an approximation to $ f'(x). $ Using simple algebra the answer is
$$ f'(x) approx frac f(x_0+Delta x) - f(x_0-Delta x) 2 Delta x +
2(x - x_0)frac f(x_0+Delta x) - f(x_0) + f(x_0-Delta x) Delta x^2 $$
where the two fractions are approximations to the first and second derivatives of $ f(x) $ at $ x = x_0. $
You can check that when $ f(x) $ is a quadratic polynomial, then the approximation is exact.
You asked for an approximation to $ f'(x). $ Using simple algebra the answer is
$$ f'(x) approx frac f(x_0+Delta x) - f(x_0-Delta x) 2 Delta x +
2(x - x_0)frac f(x_0+Delta x) - f(x_0) + f(x_0-Delta x) Delta x^2 $$
where the two fractions are approximations to the first and second derivatives of $ f(x) $ at $ x = x_0. $
You can check that when $ f(x) $ is a quadratic polynomial, then the approximation is exact.
edited yesterday
answered yesterday


Somos
10.8k1831
10.8k1831
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2872564%2ffinite-difference-of-the-derivative-at-an-arbitrary-location%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
What do you mean "the result was incorrect"? What did you do, and what is the correct answer?
– Andrei
yesterday
Why do you think this is "second order"?
– David G. Stork
yesterday
@DavidG.Stork Because the error is proportional to $(Delta x)^2$. This is taken from my textbook, too.
– A Slow Learner
yesterday
So what is a "first order" method? (And $0$th order?)
– David G. Stork
yesterday
@Andrei The way I performed interpolation is: I let $f'(x)$ at $x_0-Delta x$ to be the maximum value, and $f'(x)$ at $x_0$ to be half the max value. I also assumed that $f'(x)$ is linear between $(x-Delta x_0,x+ Delta x_0)$. I don't know the correct result, but the result that I obtained didn't make sense in a bigger problem that I am working on.
– A Slow Learner
yesterday