Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Correction to "Fundamental Theorem of Calculus and Mathematica"

5 views
Skip to first unread message

Len

unread,
Jun 11, 2009, 9:44:21 PM6/11/09
to
Greetings:

I define a function (using f[x_]:=) as the definite integral (from 0
to x) of sin(t^2). When I differentiate using Mathematica I get the
correct answer of sin(x^2).

But when I define a function (using g[x_]:=) as the definite integral
(from 0 to x) of e^(-t^2) and differentiate, I get the incorrect
answer of 0. (The correct answer is e^(-x^2).)

Why the inconsistency?

Oddly, if I define the function g above using "=" instead of ":=", all
works well.

Can someone explain the odd behavior?

Thanks,

Len

Simon

unread,
Jun 12, 2009, 5:46:14 AM6/12/09
to
Hi Len,

Running both 6.0.3 and 7.0.1, I don't seem to get that problem:

In[1]:= f[x_]:=Integrate[Sin[t^2],{t,0,x}]

In[2]:= D[f[x],x]
Out[2]= Sin[x^2]

In[3]:= g[x_]:=Integrate[Exp[-t^2],{t,0,x}]

In[4]:= D[g[x],x]
Out[4]= E^-x^2

Simon

Murray Eisenberg

unread,
Jun 13, 2009, 6:03:51 AM6/13/09
to
Yes. However, with those definitions of f and g:

f'[x]
Sin[x^2]

g'[x]
0

I believe that's the discrepancy to which the original poster refers.
And this originates from what you'll see if you use the FullForm, the
FullForm of h'[x] being Derivative[1][h][x]:

Derivative[1][f]
(FresnelS^\[Prime])[Sqrt[2/\[Pi]] #1]&

Derivative[1][g]
0&

The latter arises from:

g[x]
1/2 Sqrt[\[Pi]] Erf[x]

So I don't understand why the derivative of g is the constantly 0
function. After all, Mathematica DOES know:

Derivative[1][Erf]
(2 E^-#1^2)/Sqrt[\[Pi]]&

And that surely is not the zero function!

--
Murray Eisenberg mur...@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305

David Bailey

unread,
Jun 13, 2009, 6:04:24 AM6/13/09
to
My guess is that you had been doing things with Mathematica prior to
that, and as a result, g had some sort of definition. If the problem
happens again, try typing

??g

If you get a strange result, it is often useful to kill the kernel so
that you start with a clean slate.

David Bailey
http://www.dbaileyconsultancy.co.uk

Curtis Osterhoudt

unread,
Jun 13, 2009, 6:04:34 AM6/13/09
to
Works here ("7.0 for Linux x86 (32-bit) (November 11, 2008)").

In[4]:= f[x_] := Integrate[Sin[t^2], {t, 0, x}]

In[5]:= D[f[x], x]

Out[5]= Sin[x^2]

In[6]:= g[x_] := Integrate[Exp[-t^2], {t, 0, x}]

In[7]:= D[g[x], x]

Out[7]= E^-x^2


On Thursday 11 June 2009 07:44:34 pm Len wrote:
> Greetings:
>
> I define a function (using f[x_]:=) as the definite integral (from 0
> to x) of sin(t^2). When I differentiate using Mathematica I get the
> correct answer of sin(x^2).
>
> But when I define a function (using g[x_]:=) as the definite integral
> (from 0 to x) of e^(-t^2) and differentiate, I get the incorrect
> answer of 0. (The correct answer is e^(-x^2).)
>
> Why the inconsistency?
>
> Oddly, if I define the function g above using "=" instead of ":=", all
> works well.
>
> Can someone explain the odd behavior?
>
> Thanks,
>
> Len
>
>


--
==================================
Curtis Osterhoudt
cfo@remove_this.lanl.and_this.gov
PGP Key ID: 0x4DCA2A10
==================================

Alexei Boulbitch

unread,
Jun 13, 2009, 6:05:39 AM6/13/09
to
Greetings:

I define a function (using f[x_]:=) as the definite integral (from 0
to x) of sin(t^2). When I differentiate using Mathematica I get the
correct answer of sin(x^2).

But when I define a function (using g[x_]:=) as the definite integral
(from 0 to x) of e^(-t^2) and differentiate, I get the incorrect
answer of 0. (The correct answer is e^(-x^2).)

Why the inconsistency?

Oddly, if I define the function g above using "=" instead of ":=", all
works well.

Can someone explain the odd behavior?

Thanks,

Len


Hi, Len,
I tried and this is the result:

In[3]:= g[x_] := Integrate[Exp[-t^2], {t, 0, x}]

In[4]:= D[g[x], x]

Out[4]= \[ExponentialE]^-x^2

Sorry, Alexei

--
Alexei Boulbitch, Dr., habil.
Senior Scientist

IEE S.A.
ZAE Weiergewan
11, rue Edmond Reuter
L-5326 Contern
Luxembourg

Phone: +352 2454 2566
Fax: +352 2454 3566

Website: www.iee.lu

This e-mail may contain trade secrets or privileged, undisclosed or otherwise confidential information. If you are not the intended recipient and have received this e-mail in error, you are hereby notified that any review, copying or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal from your system. Thank you for your co-operation.

Len

unread,
Jun 13, 2009, 6:07:16 AM6/13/09
to
Hi Simon:

Interesting! Like you, I get correct results when differentiating
using "D". But when I differentiate using the prime sign (g'[x] ) I


get the incorrect answer of 0.

Len

Jens-Peer Kuska

unread,
Jun 13, 2009, 6:01:31 AM6/13/09
to
Hi,

this is nonsens.

f[x_] := Integrate[Sin[t^2], {t, 0, x}]

g[x_] := Integrate[Exp[-t^2], {t, 0, x}]

D[#, x] & /@ {g[x], f[x]}

gives

{E^(-x^2), Sin[x^2]}

That is why it is useful to post your full input and not a
verbal description.

Regards
Jens

Albert Retey

unread,
Jun 14, 2009, 5:38:52 AM6/14/09
to
Hi,

> Interesting! Like you, I get correct results when differentiating
> using "D". But when I differentiate using the prime sign (g'[x] ) I
> get the incorrect answer of 0.

I think this is a case where Trace is useful, and when looking at the
output of Trace it seems clear that this is why it goes wrong for g':

In[14]:= Integrate[Exp[-t^2], {t, 0, #}]

Out[14]= 1/2 Sqrt[\[Pi]] Erf[3]

In[15]:= Integrate[Sin[t], {t, 0, #}]

Out[15]= 1 - Cos[#1]

I think Out[14] clearly is a bug, because whatever # may be, it is not 3
in almost all cases :-)

hth,

albert

peter

unread,
Jun 14, 2009, 5:40:11 AM6/14/09
to
In[1]:= f[x_]:=Integrate[Sin[t^2],{t,0,x}]
In[2]:= D[f[x],x]
Out[2]= Sin[x^2]
In[3]:= g[x_]:=Integrate[Exp[-t^2],{t,0,x}]
In[4]:= D[g[x],x]
Out[4]= E^-x^2
In[9]:= $Version
Out[9]= 7.0 for Mac OS X x86 (32-bit) (February 18, 2009)

2009/6/12 Len <lwap...@gmail.com>:


> Greetings:
>
> I define a function (using f[x_]:=) as the definite integral (from 0
> to x) of sin(t^2). When I differentiate using Mathematica I get the
> correct answer of sin(x^2).
>
> But when I define a function (using g[x_]:=) as the definite integral
> (from 0 to x) of e^(-t^2) and differentiate, I get the incorrect
> answer of 0. (The correct answer is e^(-x^2).)
>
> Why the inconsistency?
>

> Oddly, if I define the function g above using "=" instead of ":=", al=


l
> works well.
>
> Can someone explain the odd behavior?
>
> Thanks,
>
> Len
>
>

--
Peter Lindsay

0 new messages