MathGroup Archive 2006

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

Search the Archive

Re: Re: New Analytical Functions - Mathematica Verified

  • To: mathgroup at
  • Subject: [mg66967] Re: [mg66916] Re: New Analytical Functions - Mathematica Verified
  • From: Daniel Lichtblau <danl at>
  • Date: Mon, 5 Jun 2006 03:48:35 -0400 (EDT)
  • References: <> <> <e5osg1$hvp$> <>
  • Sender: owner-wri-mathgroup at

Mohamed Al-Dabbagh wrote:
> Daniel Lichtblau wrote:
>>They will change the behavior of its derivatives. Actually I think I did
>>not want to use the DiracDelta component in that particular definition
>>(or else to use further derivatives thereof in the definition for higher
>>derivatives of FractionalPart).
>>Did you try it?
> Dan,
> Your usage of DiracDelta has made some remarkable correction for the
> result, but on a very high cost of runtime! I have made some
> experiments and wanted to publish them. You should remember that my
> paper:
> has proved that the derivative of the fractional part of any function
> is the SAME as derivative of that function WITHOUT involving in the
> calculation of fractional part!

This is not exactly new. The function FractionalPart[f[x]] is 
differentiable wherever f[x] is differentiable except where it takes on 
integer (or, in the complex plane, Gaussian integer) values.

At such points one might regard the derivative as undefined, or as a 
generalized function in terms of derivatives of delta functions, 
depending on the situation at hand. One often sees FractionalPart used 
for e.g. sawtooth waves, and in that setting a generalized function 
derivative is often appropriate.

> When I used your improvement using Dirac Delta, a very substantial
> improvement occurred on the numerical results. HOWEVER, this lead to
> some very long delays. To the extent that calculating 5th derivative of
> the FractionalPart(x^5) to 1000 places of decimal would take about ONE
> HOUR!!!! Here are some results I arranged it in a page prepared for
> you:
> You will see how my formulas are A LOT faster. 
> Mohamed Al-Dabbagh

First let me correct my derivatives (or at least post what I think are 
the correct ones).

Derivative[1][FractionalPart][x_] := 1 - DiracDelta[x]

Derivative[n_Integer /; n>1][FractionalPart][x_] :=

Now we use your function f.

In[3]:= f[x_] := x^5

In[4]:= gMath[x_] := FractionalPart[f[x]]

In[5]:= InputForm[Timing[gMath''[12.2`400]]]


So it takes a fraction of a second. Offhand I do not know why it appears 
to run so slow for you.

Here is the result for the slightly more complicated example, both for 
evaluating second and fifth derivatives.

In[8]:= f[x_] := x^5*Sin[x]^2

In[10]:= InputForm[Timing[gMath''[12.2`400]]]


In[11]:= InputForm[Timing[Derivative[5][gMath][12.2`400]]]


At the bottom of your note you say: "Now you understand how powerful my 
formulas are compared to the existing ones you use in Mathematica." 
While I am at a loss to understand why the computations are so slow when 
you run them, I think you are vastly overstating the case here. 
Differentiation in Mathematica by default does but little with 
discontinuous functions such as FractionalPart. But as seen above a user 
can readily add derivatives to suit ones needs, and evaluations 
involving those derivatives seem (to me) to be reasonably fast.

Daniel Lichtblau
Wolfram Research

  • Prev by Date: Re: Packages--guikit and mathgl3d help!
  • Next by Date: Re: piecewise integration
  • Previous by thread: Re: New Analytical Functions - Mathematica Verified
  • Next by thread: Re: New Analytical Functions - Mathematica Verified