Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Topic: second derivative
Replies: 5   Last Post: Feb 12, 2013 2:16 PM

 Messages: [ Previous | Next ]
 Derek Goring Posts: 3,663 Registered: 12/7/04
Re: second derivative
Posted: Feb 12, 2013 2:16 PM

On Wednesday, February 13, 2013 5:07:20 AM UTC+13, winnie wrote:
> "aasim Azooz" <aasimazooz@yahoo.com> wrote in message <g2483i\$bfa\$1@fred.mathworks.com>...
>

> >
>
> > if y=f(x) then the first derivative is
>
> > y1=diff(y)./diff(x)
>
> > The second derivative is
>
> > y2=diff(y1)./diff(x)
>
> > don't forget that the size of y1 is less than the size of y
>
> > by one and the size of y2 is less than the size of y by two
>
> >
>
> > Aasim Azooz
>
> >
>
>
>
> Hi,
>
>
>
> I just looked into computing an approximate second derivative with Matlab and found the answer given by Aasim (above).
>
>
>
> However, shouldn't it rather be:
>
> y2=diff(y1)./diff(x^2) ?
>
>
>
> The answer Aasim gave comes up repeatedly (in similar form) in my web searches, hence I am not sure whether I am making a conceptual error here...
>
> My x values are equally spaced, in case that makes a difference.
>
>
>
> Thanks,
>
> Winnie

Yes, you are making a conceptual error.
Aasim has the correct algorithm.

Date Subject Author
6/2/08 Lu Yu
6/2/08 Walter Roberson
6/2/08 Roger Stafford
6/3/08 aasim Azooz
2/12/13 winnie
2/12/13 Derek Goring