[comp.sys.handhelds] Question - Indefinite Integration

jma@beach.cis.ufl.edu (John 'Vlad' Adams) (09/27/90)

Ok, forgive the novice question, but we all started with our
first HP at one point...  Is there a way to evaluate
an integral sans limits on the 48SX?
--
John  M.  Adams    --**--    Professional Student on the six-year plan!     ///
Internet:   jma@beach.cis.ufl.edu   -or-   vladimir@maple.circa.ufl.edu    ///
"We'll always be together, together in electric dreams" Tangerine Dream \\V//
Sysop of The Beachside.   FIDOnet 1:3612/557.   904-492-2305  (Florida)  \X/

b3300876@rick.cs.ubc.ca (george kai yee chow) (09/28/90)

In article <24605@uflorida.cis.ufl.EDU> jma@beach.cis.ufl.edu (John 'Vlad' Adams) writes:
>Ok, forgive the novice question, but we all started with our
>first HP at one point...  Is there a way to evaluate
>an integral sans limits on the 48SX?

Nope. And a browse thru the manual seems to support that. I 
was sorta disappoint since it really would be too much 
hassle. The best I've manage to do is to toss in symbolic
bounds and let the 48 do the evaluate at.

>--
>John  M.  Adams    --**--    Professional Student on the six-year plan!     ///
>Internet:   jma@beach.cis.ufl.edu   -or-   vladimir@maple.circa.ufl.edu    ///
>"We'll always be together, together in electric dreams" Tangerine Dream \\V//
>Sysop of The Beachside.   FIDOnet 1:3612/557.   904-492-2305  (Florida)  \X/

davisp@skybridge.SCL.CWRU.Edu (Palmer Davis) (09/28/90)

In article <24605@uflorida.cis.ufl.EDU> jma@beach.cis.ufl.edu (John 'Vlad' Adams) writes:
>Ok, forgive the novice question, but we all started with our
>first HP at one point...  Is there a way to evaluate
>an integral sans limits on the 48SX?

Sure... just use zero and the variable you're integrating with respect to
as your "limits."

-- PTD --



--
Palmer T. Davis                 |  davisp@scl.cwru.edu  -OR-  ptd2@po.cwru.edu
Case Western Reserve University | {att,sun,decvax,uunet}!cwjcc!skybridge!davisp
------------------------------------------------------+------------------------
Wake up and smell the cat food in your bank account.  |     Life is short.

dj1l+@andrew.cmu.edu (Demian A. Johnston) (09/28/90)

Yes;  
	Just give the integral symbolic limits.  For example if you are
integrating with respect to "X" do sometyhing like giving the integral
limits from 0 to "x" it's somewhere in the users manual.

Demian J.

edp@jareth.enet.dec.com (Eric Postpischil (Always mount a scratch monkey.)) (09/28/90)

In article <24605@uflorida.cis.ufl.EDU>, jma@beach.cis.ufl.edu (John 'Vlad'
Adams) writes:

>Ok, forgive the novice question, but we all started with our
>first HP at one point...  Is there a way to evaluate
>an integral sans limits on the 48SX?

Not directly, but you can evaluate an integral with symbolic limits.  So you can
evaluate with the upper limit symbolic and the lower limit a constant.  You
could then either live with the constant expression in the result or remove it
with some manipulation.


				-- edp

louxj@jacobs.CS.ORST.EDU (John W. Loux) (09/29/90)

>Ok, forgive the novice question, but we all started with our
>first HP at one point...  Is there a way to evaluate
>an integral sans limits on the 48SX?

I have no problem with a novice question, it's the novice answers that bother
me, especially since the answer has been posted once before.

First off, simply supplying 0 for one of the limits in definite integration
does not work because all functions of zero do not return zero --- and some
will burp and die on you.

Second off, yes it is possible to do indefinite integration using the 48, but
it's not particularly direct or documented.

Consider:  S X dX --- i.e., the integral of X with respect to X.

First, create the expression using arbitrary, symbollic limits:

		S(A,B,X,X)

EVAL'uate this to get the first integration step:

		'X^2/2|(X=B)-(X^2/2|(X-A))'

Split this expression using OBJ-> and drop the bottom three levels:

		'X^2/2|(X=B)'

You can now either evaluate this expression to replace X with B or use OBJ->
again to split the expression and drop the bottom three stack levels again.

The result is either 'B^2/2' or 'X^2/2'.  You can substitute X for B in the
first expression in one of several ways (viz., 'X' 'B' STO EVAL) and add 'C'
if you like ('C' +).

This is the general procedure for expressions that the 48 can integrate
symbollically.

While we're at it, I'm still waiting for someone to respond to the posting on
how one goes about symbollically integrating e^((y^2)/2) symbollically.  The
numeric solution is straight-forward: simply supply numeric limits, build the
expression and use ->NUM to get the numeric result.

I hope I've helped some,

John

rrd@hpfinote.HP.COM (Ray Depew x2419) (09/29/90)

> Ok, forgive the novice question, but we all started with our
> first HP at one point...  Is there a way to evaluate
> an integral sans limits on the 48SX?

> John  M.  Adams    --**--    Professional Student on the six-year plan!

Two solutions:

1)  Fake it, by setting the limits at -MAXR and MAXR.   MAXR (MaxReal) is 
    the largest number the 48 will handle.  If you're curious to see what 
    MAXR is, press MAXR  ->NUM  and you will see 9.999999999999E499 on
    Level 1.

2)  Wlodek M-J, in his massive work on the HP-41, had a beautiful workaround
    for indefinite integrals.  I gave the book to someone else (darn it!), 
    so I don't remember what it was.  But it was an elegant mathematical
    manipulation, and I used it several times on my 41.  Perhaps someone else
    with the book would be good enough to post it here for our benefit?


Regards
Ray Depew
HP Colorado IC Division 
rrd@hpfitst1.hp.com

madler@piglet.caltech.edu (Mark Adler) (09/29/90)

I responded to the e^(y^2/2) integration question privately, but it seems
others are curious ...

First off, what he really wanted was e^(-y^2/2), which is rather different
for real y, and also quite useful, being the gaussian distribution (up to
normalization).  There is no symbolic answer that can be expressed as a
rational function of trig and/or log/exp functions (except for special
values of the integration bounds like -infinity, 0, and infinity).

What is done when you have a useful, unsolvable integral is "solve it by
naming it".  The integral is given a name (the error function or
complementary error function, erf(x) or erfc()), and then you have tables
and subroutines to evaluate it.  In fact, the HP has a function that'll
do it: UTPN (upper tail probability normal) in MATH/PROB.  Given the
arguments 0 1 x, UTPN will return the integral from x to infinity of
e^(-t^2/2)/sqrt(2pi) dt.  The sqrt(2pi) is to make the result one for
x equal to -infinity.  The complementary error function (erfc()) is
a little different, but a simple transformation of UTPN will give it.

Naturally, UTPN is much faster (and probably more accurate) than
doing the integral numerically on the HP-48.

Mark Adler
madler@piglet.caltech.edu

flinton@eagle.wesleyan.edu (10/04/90)

In article <19080015@hpfinote.HP.COM>, rrd@hpfinote.HP.COM (Ray Depew x2419) 
answers the question of John M. Adams:
>> Ok, forgive the novice question, but we all started with our
>> first HP at one point...  Is there a way to evaluate
>> an integral sans limits on the 48SX?
	A recent book gives another answer (of sorts).  The book is "Calculus
Activities" by Dennis Pence (PWS - Kent Publishing Co., Boston, 1990).  
In section 4 of Chapter 9 (pp. 172-175) you find the author's approach
to plotting an indefinite integral over a given range.  Sorry, no closed
forms available -- just plots of acceptable approximations.  Better than
nothing, though, I hope.
				-- Fred 

ags@seaman.cc.purdue.edu (Dave Seaman) (10/05/90)

In article <1990Oct4.005626.33899@eagle.wesleyan.edu> flinton@eagle.wesleyan.edu writes:

>In section 4 of Chapter 9 (pp. 172-175) you find the author's approach
>to plotting an indefinite integral over a given range.  

If you mean an "indefinite integral" in the sense that most people have been
using the term in this newsgroup (i.e. an integral with no specified limits,
yielding an answer that includes a constant of integration), then the plot is
exceedingly simple.

It is all black.

In some quarters, the term "indefinite integral" means an integral of the form

	F(x) = (integral from a to x) f(t) dt

where a is a constant.  For some reason, I get the feeling that that is not what
people have been asking for when they say they want to do indefinite integrals
on the HP48.

--
Dave Seaman	  					
ags@seaman.cc.purdue.edu