From: Eric Fleury Newsgroups: sci.math.symbolic Subject: Re: Challenge to Machines Date: Tue, 12 Jan 1999 14:11:05 +0100 Hi, Here is the solution using MuPAD 1.4 *----* MuPAD 1.4.0 -- Multi Processing Algebra Data Tool /| /| *----* | Copyright (c) 1997 - 98 by SciFace Software GmbH | *--|-* All rights reserved. |/ |/ *----* Licensed to: INRIA Lorraine >> int(1/(1+tan(t)^x),t=0..PI/2); PI -- 4 Eric Fleury -- ----------------------------------------------------------------------------- Eric FLEURY e-mail: Eric.Fleury@loria.fr UMR 7503 LORIA, INRIA Lorraine http: www.loria.fr/~fleury Campus Scientifique - BP 239 Tel: (33) 3 83 59 30 90 54506 Vandoeuvre les Nancy CEDEX (FRANCE) Fax: (33) 3 83 27 83 19 ----------------------------------------------------------------------------- ============================================================================== From: "Allan Hayes" Newsgroups: sci.math.symbolic Subject: Re: Challenge to Machines Date: Tue, 5 Jan 1999 02:51:01 -0000 Larry Mead wrote in message <76isja$fbc$4@thorn.cc.usm.edu>... >Sirs, here is a challenge to your Maple, mathcad, mathematica and >macsyma programs. Do the following integral exactly: > > / Pi/2 >I(x) = | dt / [ 1 + (tan(t))^x ] > / 0 > >where x is an arbitrary real number. > >Human intelligence will solve this problem after a bit of thought after >the use of symmetry. Machines are not yet up to this type of problem. It >bothers me how so many students of physics and mathematics now will simply >throw a problem onto the computer without first giving the problem >adequate thought. Anyone else bothered by this as well? > >-- >Lawrence R. Mead Ph.D. (Lawrence.Mead@usm.edu) >Eschew Obfuscation! Espouse Elucidation! >www-dept.usm.edu/~physics/mead.html > Mathematica does not evaluate this integral, so congratulations to MuPad Christopher Creutzig posting). Here is a suggestion that like Helmut Kahovec's solution with Maple, makes use of the symmetry ( I would need to check out some of the math more carefully to give a rigorous derivation) For t in the open interval {0, Pi/2) Since Tan[Pi/4 + t] Tan[Pi/4 -t] =1 and, with f[x_,t_]= 1/(1+Tan[t]^x), D[f[x,Pi/4+t],x] is -((Log[Tan[Pi/4 + t]]*Tan[Pi/4 + t]^x)/ (1 + Tan[Pi/4 + t]^x)^2) We see that for real x D[f[x,Pi/4+t],x] + D[f[x,Pi/4+t],x] ==0 and therefore Integrate[f[x,t],{x,0,Pi/2}] does not change with x and is always equal to Integrate[f[x,t]/.x->0,{t,0,Pi/2}] = Integrate[ 1/2, {t,0, Pi/2}] = Pi/4 Allan --------------------- Allan Hayes Mathematica Training and Consulting www.haystack.demon.co.uk hay@haystack.demon.co.uk Voice: +44 (0)116 271 4198 Fax: +44 (0)870 164 0565 ============================================================================== From: lrmead@orca.st.usm.edu (Larry Mead) Newsgroups: sci.math.symbolic Subject: Re: Challenge to Machines Date: 5 Jan 1999 14:43:28 GMT David Wilkinson (David@quarksoft.demon.co.uk) wrote: : Larry : MathCad 8 will not do this in its original form but will give the right : answer numerically for any x, which is Pi/4. It will give the right : answer symbolically for any specified integer x but not for non-integer : values. A plot of the integrand against t shows it is odd about the : point (Pi/4,0.5). I tried changing to the variable y = t-Pi/4, which : results in tan(t) = (1+tan(y))/(1-tan(y)) but there was no improvement. Just a little bit of manipulation (write tan as sin/cos, clear fractions, substitute t -> pi/2-t etc) one can easily do this integral exactly for all x without ever even suspecting that the result is independent of x. You actually fell into my trap by first trying to evaluate the integral numerically ;-). : While these machine methods are neither all-powerful nor perfect I am : grateful for any help they can give. They make far less mistakes than I : do! Yes, of course and this is why *I* like them too. But then I *already* can do most do-able integrals (I have done some real monsters) and my students do not. It behooves them to first *understand* the techniques used by the machine and apply them *first*; Ie., think first, calculate later. This applies also to grade school students and pocket calculators. Students now entering college are abysmally ignorant of all but the simplest properties of numbers and most could not pass an arithmetic exam I created without a calculator. The dependence on machines is a great worry. Indeed, it is this failure to grasp arithmetic which prompted the city of Los Angeles school system to ban pocket calculators in their public schools. Finally, the School Board had to admit that math scores had plummeted just after the introduction of these electronic beasts, and they are trying hard now to reverse that trend. IMO, this should be done at the HS and College levels as well. : David Wilkinson Sorry to preach in the middle of this forum, but I had to vent ;-). Regards, -- Lawrence R. Mead Ph.D. (Lawrence.Mead@usm.edu) Eschew Obfuscation! Espouse Elucidation! www-dept.usm.edu/~physics/mead.html ============================================================================== Newsgroups: sci.math.symbolic From: macsyma@world.std.com (Jeffrey P. Golden) Subject: Challenge to Machines Date: Wed, 6 Jan 1999 23:20:08 GMT > Date: Fri Jan 01 11:19:54 EST 1999 > From: lrmead@orca.st.usm.edu (Larry Mead) > Subject: Challenge to Machines > Organization: University of Southern Mississippi > X-Newsreader: TIN [version 1.2 PL2] > > Here is a challenge to your Maple, Mathcad, Mathematica and > Macsyma programs. Do the following integral exactly: > > / Pi/2 > I(x) = | dt / [ 1 + (tan(t))^x ] > / 0 > > where x is an arbitrary real number. Here is an approach using Macsyma due to Bill Gosper: --------------------------------------------------------------- /* Here is the original integral: */ (c1) (linel:72,'integrate(1/(1+tan(t)^x),t,0,%pi/2)); %pi --- 2 / [ 1 (d1) I ----------- dt ] x / tan (t) + 1 0 /* A change of variables: */ (c2) (% + changevar(%,t=%pi/2-u,u,t))/2; %pi %pi --- --- 2 2 / / [ 1 [ 1 I ----------- du + I ----------- dt ] x ] x / cot (u) + 1 / tan (t) + 1 0 0 (d2) ----------------------------------------- 2 /* INTegral CONTRACT is not in the shipping Macsyma. It can be simulated here using PART and SUBST: */ (c3) intcontract(%); %pi --- 2 / [ 1 1 I (----------- + -----------) du ] x x / tan (u) + 1 cot (u) + 1 0 (d3) ----------------------------------- 2 /* Simplify by converting to sin and cos, noting that they are positive in the interval (0, pi/2), -- the integrand simplifies to 1 : */ (c4) block([radexpand:all],trigsimp(%)); %pi (d4) --- 4 --------------------------------------------------------------- From: Jeffrey P. Golden Organization: Macsyma Inc. Reply-To: jpg@macsyma.com URL: http://www.macsyma.com ============================================================================== From: "Allan Hayes" Newsgroups: sci.math.symbolic Subject: Re: Challenge to Machines Date: Thu, 7 Jan 1999 14:58:24 -0000 The correspondence on this topic has raised some basic issues about computer algebra systems and how they should be developed and used. On the face of it the present thread is a challenge to machines to do whatever calculations we can do as well as many that we can't. Certainly, we need them to do as much calculation as possible; but their overiding role is to help us, and that means helping us use our own skills and reasoning capabilities. Some examples of this have come up in the use that Helmut Kahovic and Jeffrey P. Golden have made of Maple and Macsyma in manipulating integrals, I show how Mathematica can be used in this way below. There is a real challenge to make systems more able to do this sort of thing and to extend the facilites to more general symbolic manipulation and reasoning. We will all benefit from this -- Larry Mead's students could be helped to reason and understand as well as to calculate. To get to the integral: Suppose that F[(a+b)-t]+F[t ]= k in {a,b} (1) (this holds with F[t] = 1/(1+ Tan[t]^x) and a = 0, b = Pi/2) Then A = int[ F[t],{t,a,b} ] (2) A = int[-F[{a+b) - u],{u,b,a}] change variable t-> (a+b) - u A = int[F[{a+b) - u],{u,a,b}] swap limits, take - inside the integral A = int[F[{a+b) - t],{t,a,b}] (3) 2A = int[F[t]+F[{a+b ) -t],{t,a,b}] by (2)+(3) 2A = int[k ,{t,a,b}] by (1) 2 A = k (b-a) A = k (b-a)/2 I want to do this sort of thing with Mathematica. I have used two of my own packages in the following. < u, t == a + b - u] A == int[-F[a + b - u], {u, b, a}] ChangeVariable[%, u -> t, u == t] A == int[-F[a + b - t], {t, b, a}] SwapLimits[%] A == -int[-F[a + b - t], {t, a, b}] IntegralOut[%] A == int[F[a + b - t], {t, a, b}] eq1 + % 2A == int[F[a + b - t], {t, a, b}] + int[F[t], {t, a, b}] IntegralOut[%] 2A == int[F[a + b - t] + F[t], {t, a, b}] % /. F[a + b - t] + F[t] -> k 2A == int[k, {t, a, b}] Simplify[EvaluateIntegral[%]] 2A == (-a + b)*k %/2 A == 1/2 (-a + b)k Allan, --------------------- Allan Hayes Mathematica Training and Consulting www.haystack.demon.co.uk hay@haystack.demon.co.uk Voice: +44 (0)116 271 4198 Fax: +44 (0)870 164 0565 ============================================================================== From: "Allan Hayes" Newsgroups: sci.math.symbolic Subject: Re: Challenge to Machines Date: Tue, 12 Jan 1999 14:47:48 -0000 Jan Krupa wrote in message <369B292F.4D94FE62@alpha.sggw.waw.pl>... >Does anybody have any idea how to use some CAS (mathematica, maple, >mupad, maksyma,...) to get the formulae simplified ? Here are some ways with with Mathematica - some human intervention is still needed - maybe with further implementation of assumptions this will be unnecessary. Let f[x_,t_] = 1/(1+Tan[t]^x); (1) expr1 = D[f[x,Pi/4+t],x] + D[f[x,Pi/4-t],x]; (* -Pi/4 1 1 Allan --------------------- Allan Hayes Mathematica Training and Consulting www.haystack.demon.co.uk hay@haystack.demon.co.uk Voice: +44 (0)116 271 4198 Fax: +44 (0)870 164 0565 ==============================================================================