Integration/Antidifferentiation Program

I'd like to write a program to integrate derivatives to save time on
calc homework and get extra credit in the class. I'm not completely sure
where to start.

I'm just looking for some tips from others who understand what I'm going
to do and any suggestions.

Thanks,
Matt

···

--
Posted via http://www.ruby-forum.com/.

SleepJunkie wrote:

I'd like to write a program to integrate derivatives to save time on
calc homework and get extra credit in the class. I'm not completely sure
where to start.

I'm just looking for some tips from others who understand what I'm going
to do and any suggestions.

Thanks,
Matt

Hm... you'll probably strengthen your derivation and integration skills
more if you actually solved the problems yourself. :wink: If you really
need to have a computer work them out (such as to check your answers),
why not just use one of Mathematica, Maple, Matlab or IDL, which your
school probably has installed somewhere.

Personally, it sounds to me like too much work to write something
yourself whose answers you could be confident about.

Pistos

···

--
Posted via http://www.ruby-forum.com/\.

First of all I'd like to disagree with everybody who told you you'd be
better off doing your homework. I think you'll learn **more** about
integrating derivatives by automating the process than you will doing
it by hand a hundred million times.

Second, if I recall correctly, there's example code for this in
"Higher-Order Perl," although obviously the author of that particular
book didn't use Ruby to do it.

···

--
Giles Bowkett
http://www.gilesgoatboy.org

On 4/27/06, SleepJunkie <SleepJunk13@gmail.com> wrote:

I'd like to write a program to integrate derivatives to save time on
calc homework and get extra credit in the class. I'm not completely sure
where to start.

I'm just looking for some tips from others who understand what I'm going
to do and any suggestions.

Thanks,
Matt

--
Posted via http://www.ruby-forum.com/\.

I've been thinking about doing something like this myself, just for
shits and giggles, and I was just wondering if it would be good to use
infinite series expressions to integrate. It seems like it would be a
more standardized way of integration (unless an ln shows up somewhere).
Perhaps once you can write something that will integrate polynomial
expressions, it would be reasonable to use infinite series like this.
However, I haven't really taken the time to mess with it. I don't know
how much calculus you know, either, so I don't know if you really want
to teach yourself Taylor and Maclauren series just to do this. If
you're really into it, though, that way seems possible.

···

--
Posted via http://www.ruby-forum.com/.

There's apparently an algorithm out there that can do symbolic
integration of any elementary function, and returns either its
antiderivative, or that its antiderivative is not expressible in terms
of elementary functions. The only problem that it requires at several
points to determine whether two expressions are equal, and that,
unfortunately, is difficult, and in some cases actually impossible
(undecidable) depending on what functions you allow. See

There's also a whole theory built up from this called differential
Galois theory, which extends ideas originally developed by Évariste
Galois for the solvability of polynomial equations into solving
differential equations, which is really what antidifferentiation is
all about:

You're treading in deep water here, brother. Beware.

···

On Fri, Apr 28, 2006 at 1:31 AM, SleepJunkie <SleepJunk13@gmail.com> wrote:

I'd like to write a program to integrate derivatives to save time on
calc homework and get extra credit in the class. I'm not completely sure
where to start.

--
普通じゃないのが当然なら答える私は何ができる?
普通でも普通じゃなくて感じるまま感じることだけをするよ!
http://stormwyrm.blogspot.com

And just to add to that a bit - doing integration with a computer is
relatively straightforward if you are talking about definate integrals and
solving them using numerical methods. If you are trying solve them
symbollically, even integrating something as simple as x^2 is not trivial.

···

On 4/27/06, Pistos Christou <jesusrubsyou.5.pistos@geoshell.com> wrote:

SleepJunkie wrote:
> I'd like to write a program to integrate derivatives to save time on
> calc homework and get extra credit in the class. I'm not completely sure
> where to start.
>
> I'm just looking for some tips from others who understand what I'm going
> to do and any suggestions.
>
> Thanks,
> Matt

Hm... you'll probably strengthen your derivation and integration skills
more if you actually solved the problems yourself. :wink: If you really
need to have a computer work them out (such as to check your answers),
why not just use one of Mathematica, Maple, Matlab or IDL, which your
school probably has installed somewhere.

Personally, it sounds to me like too much work to write something
yourself whose answers you could be confident about.

Pistos

--
Posted via http://www.ruby-forum.com/\.

Pistos Christou wrote:

Hm... you'll probably strengthen your derivation and integration skills more if you actually solved the problems yourself. :wink: If you really

I agree. Matt didn't say how he wants to solve them, but if he wants to write something to solve them symbolically, rather than numerically, he may actually learn more.

But then again, that's not a task I'd want to take on.

--Steve

I can integrate and derive perfectly fine. It's more of "I just want to
do this" then "Do my homework" program. If I do it, however, I'll get
extra credit, which is always good.

I guess this is going to be harder than I thought. I'll have to program
in the chain rule, quotient rule, product rule, and others..

More suggestions are welcome :slight_smile:

···

--
Posted via http://www.ruby-forum.com/.

Giles Bowkett wrote:

First of all I'd like to disagree with everybody who told you you'd be
better off doing your homework. I think you'll learn **more** about
integrating derivatives by automating the process than you will doing
it by hand a hundred million times.

Second, if I recall correctly, there's example code for this in
"Higher-Order Perl," although obviously the author of that particular
book didn't use Ruby to do it.

--
Giles Bowkett
http://www.gilesgoatboy.org

Thanks a lot for that book, I'll have to check the book store and read
up on it or run to the library. And I agree too that I'd learn more that
way, but I'm doing great in calc now. I could, however, distribute it to
the morons in the class :wink:

···

--
Posted via http://www.ruby-forum.com/\.

A look at Axiom or Maxima (open source) or Derive (closed source but
very inexpensive, especially to college students) will pretty much show
you what the state of the art in antidifferentiation algorithms is. The
name I remember is Risch, although there may be some others.

Justin Bangerter wrote:

···

I've been thinking about doing something like this myself, just for
shits and giggles, and I was just wondering if it would be good to use
infinite series expressions to integrate. It seems like it would be a
more standardized way of integration (unless an ln shows up somewhere).
Perhaps once you can write something that will integrate polynomial
expressions, it would be reasonable to use infinite series like this.
However, I haven't really taken the time to mess with it. I don't know
how much calculus you know, either, so I don't know if you really want
to teach yourself Taylor and Maclauren series just to do this. If
you're really into it, though, that way seems possible.

--
M. Edward (Ed) Borasky

http://linuxcapacityplanning.com

I think you're going to have to look at the source of some other computer algebra systems to see and how its done. This isn't a trivial problem, and it's not just a matter of knowing all the rules, especially for integrations. (Try writing a program to do integration by parts, how is it going to decide what u and v should be for instance?)

···

On Apr 27, 2006, at 2:04 PM, SleepJunkie wrote:

I can integrate and derive perfectly fine. It's more of "I just want to
do this" then "Do my homework" program. If I do it, however, I'll get
extra credit, which is always good.

I guess this is going to be harder than I thought. I'll have to program
in the chain rule, quotient rule, product rule, and others..

More suggestions are welcome :slight_smile:

--
Posted via http://www.ruby-forum.com/\.

So.. I have no idea where to start.

I'm starting to think even this is too big for me to do. I've only made
small programs before. I'd really like a place to start, or something to
help get me started. I'm going to have to be able to parse so many
different things.

Maybe I need to learn more Ruby. I'd love to do this, though.

···

--
Posted via http://www.ruby-forum.com/.

Basic symbolic differentiation is a piece of cake. It's usually done as an exercise in Lisp programming, but there's no reason on earth you can't do it in Ruby, or for that matter, any language that supports recursion. Hell, I've seen it done in Fortran! :slight_smile:

Symbolic integration is quite a bit more difficult. However, there are quite a few open-source computer algebra packages you can learn the algorithms from. There is absolutely no need to spend the money on Mathematica or Maple -- both quite expensive outside of a university -- just to get some integrals done. Check out Maxima and Axiom.

I think a high-school-level differentiation routine would make an excellent Ruby quiz, now that I think of it.

SleepJunkie wrote:

···

I can integrate and derive perfectly fine. It's more of "I just want to do this" then "Do my homework" program. If I do it, however, I'll get extra credit, which is always good.

I guess this is going to be harder than I thought. I'll have to program in the chain rule, quotient rule, product rule, and others..

More suggestions are welcome :slight_smile:

--
M. Edward (Ed) Borasky

http://linuxcapacityplanning.com

I know nada about calc, but for what it's worth, it's used as a
teaching exercise in the Perl book I mentioned (and is probably
adapted from the Lisp teaching exercises somebody else mentioned).

Of course it's heavily dependent on recursion, if I recall correctly.

···

--
Giles Bowkett
http://www.gilesgoatboy.org

On 5/8/06, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:

A look at Axiom or Maxima (open source) or Derive (closed source but
very inexpensive, especially to college students) will pretty much show
you what the state of the art in antidifferentiation algorithms is. The
name I remember is Risch, although there may be some others.

Justin Bangerter wrote:
> I've been thinking about doing something like this myself, just for
> shits and giggles, and I was just wondering if it would be good to use
> infinite series expressions to integrate. It seems like it would be a
> more standardized way of integration (unless an ln shows up somewhere).
> Perhaps once you can write something that will integrate polynomial
> expressions, it would be reasonable to use infinite series like this.
> However, I haven't really taken the time to mess with it. I don't know
> how much calculus you know, either, so I don't know if you really want
> to teach yourself Taylor and Maclauren series just to do this. If
> you're really into it, though, that way seems possible.
>

--
M. Edward (Ed) Borasky

http://linuxcapacityplanning.com

Logan Capaldo wrote:

I think you're going to have to look at the source of some other
computer algebra systems to see and how its done. This isn't a
trivial problem, and it's not just a matter of knowing all the rules,
especially for integrations. (Try writing a program to do integration
by parts, how is it going to decide what u and v should be for
instance?)

Maxima is an open source symbolic solver/integrator, so you could start
by looking how they do it.

···

--
Posted via http://www.ruby-forum.com/\.

Just for normal college/university level calc1&2, you will need approximately 300 rules to do general integration. Derivation can be done with only about 15rules though (though in general the rules are a bit tougher)

Logan Capaldo wrote:

···

On Apr 27, 2006, at 2:04 PM, SleepJunkie wrote:

I can integrate and derive perfectly fine. It's more of "I just want to
do this" then "Do my homework" program. If I do it, however, I'll get
extra credit, which is always good.

I guess this is going to be harder than I thought. I'll have to program
in the chain rule, quotient rule, product rule, and others..

More suggestions are welcome :slight_smile:

--Posted via http://www.ruby-forum.com/\.

I think you're going to have to look at the source of some other computer algebra systems to see and how its done. This isn't a trivial problem, and it's not just a matter of knowing all the rules, especially for integrations. (Try writing a program to do integration by parts, how is it going to decide what u and v should be for instance?)

Maybe you should figure out a format for storing polynomials, make a class to deal with this, and then create some basic functions like multiply or whatever you think you'll need. or find a library to do this.

-- Elliot Temple

···

On Apr 27, 2006, at 4:29 PM, SleepJunk13 wrote:

So.. I have no idea where to start.

Hey, has anyone successfully created a program with Ruby that uses
maxima or any other "reasonably cheap" (or free) math programs?? If so,
can you point me to any resources??

http://www.ruby-forum.com/topic/177704#new

···

--
Posted via http://www.ruby-forum.com/.

After hearing all of this and talking to a co-worker (programmer who has
been doing it much longer than I have), I have decided to just go with
making a program for differentiation.

I will look at the Maxima source code, thanks.
I'll see how this goes :slight_smile:

Also, if you're curious, I'm just doing calculus of a single-variable.

···

--
Posted via http://www.ruby-forum.com/.

Hmmm ... there's actually a C++ library for writing computer algebra function -- it's called "ginac". Maybe all you need to do is write Ruby bindings to ginac and call the ginac functions. I'm not sure what "high-level" classes it has, like for differentiation, integration or equation solving.

Elliot Temple wrote:

···

On Apr 27, 2006, at 4:29 PM, SleepJunk13 wrote:

So.. I have no idea where to start.

Maybe you should figure out a format for storing polynomials, make a class to deal with this, and then create some basic functions like multiply or whatever you think you'll need. or find a library to do this.

-- Elliot Temple
Curiosity Blog – Elliot Temple

--
M. Edward (Ed) Borasky

http://linuxcapacityplanning.com