RE: Antiderivatives and Definite Integrals
- To: mathgroup at smc.vnet.net
- Subject: [mg39713] RE: [mg39670] Antiderivatives and Definite Integrals
- From: "Wolf, Hartmut" <Hartmut.Wolf at t-systems.com>
- Date: Mon, 3 Mar 2003 23:48:37 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
>-----Original Message----- >From: Garry Helzer [mailto:gah at math.umd.edu] To: mathgroup at smc.vnet.net >Sent: Saturday, March 01, 2003 8:48 AM >To: mathgroup at smc.vnet.net >Subject: [mg39713] [mg39670] Antiderivatives and Definite Integrals > > >The antiderivative of Sqrt[1+Cos[x]] discussed here recently (sorry, I >lost the thread) provides an amusing illustration of the fact that >Mathematica does not always evaluate definite integrals by first >finding an antiderivative and then substituting in the upper and lower >limits. (See the Mathematica book A.9.5) Make the definitions > >f[x_] = Integrate[Sqrt[1 + Cos[t]], {t, 0, x}] >g[x_] := Integrate[Sqrt[1 + Cos[t]], {t, 0, x}] > >Then f[2Pi] is 0 (wrong) and g[2Pi] if 4Sqrt[2] (correct). Of course >f[x]==g[x] returns True. > >Garry Helzer >Department of Mathematics >University of Maryland >1303 Math Bldg >College Park, MD 20742-4015 > > You might be interested to observe: In[1]:= f[x_] = Integrate[Sqrt[1 + Cos[t]], {t, 0, x}] Out[1]= 2*Sqrt[1 + Cos[x]]*Tan[x/2] In[2]:= g[x_] := Integrate[Sqrt[1 + Cos[t]], {t, 0, x}] In[3]:= ?g Global`g g[x_] := Integrate[Sqrt[1 + Cos[t]], {t, 0, x}] In[4]:= Plot[f[x], {x, 0, 2Pi}] // Timing Out[4]= {0.03 Second, = Graphics =} ...what you called "wrong". In[5]:= Plot[g[x], {x, 0, 2Pi}, PlotRange -> {All, {0, 6}}] // Timing Out[5]= {4.096 Second, = Graphics =} ...what you called "right". Redefine: In[6]:= f[x_] /; -Pi < x < Pi = f[x] Out[6]= 2*Sqrt[1 + Cos[x]]*Tan[x/2] In[7]:= f[x_] /; Pi < x < 3 Pi = f[x] + 4*Sqrt[2] Out[7]= 4*Sqrt[2] + 2*Sqrt[1 + Cos[x]]*Tan[x/2] In[9]:= Plot[f[x], {x, 0, 2Pi}, PlotRange -> {All, {0, 6}}] // Timing Out[9]= {0.03 Second, = Graphics =} Don't be confused by that double use of f (as a function, and as a shortcut for an algebraic expression). -- Hartmut Wolf