Question: I have the following differentiation, I need to implement it in C#:

```
W(t)=d/dt(log(A(t)))

```

Where `A(t)` is a array of double data.

How can I obtain the resulting `W(t)` array from the derivative above?

Thanks 

edit:

```
public double[,] derivative()
{
    dvdt = new double[envelope.GetLength(0), envelope.GetLength(1)];
    int h = 1;

    for (int j = 0; j < envelope.GetLength(0); j++)
    {
        for (int i = 0; i < envelope.GetLength(1)-1 ; i++)
        {
            dvdt[j, i] = (envelope[j, i + h] - envelope[j, i]) / (h);
        }
    }
    return dvdt;
}

```

I found this library <http://autodiff.codeplex.com/> but i cant understand how the sample code is working and how i can apply it to my problem eh

Answer: 
None of this *directly* addresses your question, but it may help you to get moving again. Getting stuck on trivial items in your thesis can be a royal pain.

Do you have access to Mathematica? [Last I checked they had a .NET wrapper around their core engine called .NET/Link.](http://www.wolfram.com/learningcenter/tutorialcollection/NETLinkUserGuide/NETLinkUserGuide.pdf)

The performance of Mathematica is stellar. Also, it now supports resources such as GPUs and clusters which could provide a huge performance boost if any of your app lends itself to parallelization.

This would let you focus on the rest of your app instead of having to reinvent the wheel. Also, since you could enter your formulas directly in the Mathematica notebook editor, you could take a more generic, data-driven approach from the C# side.

[Here is some typically-impenetrable Wolfram documentation](http://reference.wolfram.com/mathematica/NETLink/tutorial/CallingMathematicaFromNET.html).

[See also this thread](https://stackoverflow.com/questions/1608380/parser-for-the-mathematica-syntax) about parsing Mathematica in C#.

(I only recommend Mathematica because you mentioned that you may need a solver for more than one formula/equation/etc. Unless *implementing* the solver is a core part of your theses topic, I'd recommend using an off-the-shelf component like this and focusing on your original research.)
I think many of the answers are overthinking this. `d/dt(log(x))` is just `1/x`, so you just need to calculate the reciprocal for each point in the array `A`.

```
double[] W = Array.ConvertAll<double, double>(A, x => 1.0 / x);

```