MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Derivative



Il prof wrote:
> 
> Has anybody an idea of how to implement an algorithm for calculating
> symbolic derivatives?
> Any help will be appreciate
> 
> thank you
> 
> rvalente @ iol.it

Of course Mathematica has this built in.

(1)
If you want to do it yourself then to begin with you can simply write
the elementary rules:

d[expr_, x_]/;FreeQ[expr,x] := 0 (*when expr is free of x*) d[x_,x_] :=
1
d[a_ + b_, x_] := d[a,x] + d[b,x]
d[a_ b_, x] := d[a, x] b + a d[b, x] d[a_^n_,x_]/;FreeQ[n,x] := n
a^(n-1) d[a,x]

We could go on, but let's apply the rules so far entered.

d[3 x^4 - 1/(2- a x^3)^2, x]

               2
    3     6 a x
12 x  - -----------
                3 3
        (2 - a x )

Check against the built in differentiating function.

D[ 3 x^4 - 1/(2- a x^3)^2, x]

               2
    3     6 a x
12 x  - -----------
                3 3
        (2 - a x )

(2) Check out George Beck's notebook Step-by-Step Differentiation in the
Help Browser: Getting Started/Demod | Demos | Notebook Demos

-- 
Allan Hayes
Training and Consulting
Leicester, UK
hay@haystack.demon.co.uk
http://www.haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44 (0)116 271 8642




  • Prev by Date: Hermite Normal Form
  • Next by Date: Re: Matrix Multiplication
  • Prev by thread: Derivative
  • Next by thread: Black-Scholes option pricing model