From help-request at octave dot org Fri Feb 4 21:02:13 2005 Subject: Re: differential and integral calculus From: Paul Kienzle To: Andreas Volz Cc: help at octave dot org Date: Fri, 4 Feb 2005 22:05:55 -0500 The symbolic toolbox in octave-forge can handle differentiation: octave:1> symbols octave:2> x=sym('x') x = x octave:3> f = x^3-2*x^2+5 f = 5.0+x^(3.0)-(2.0)*x^(2.0) octave:4> differentiate (f,x) ans = (3.0)*x^(2.0)-(4.0)*x This can be improved somewhat with awkward syntax: octave:5> f = x^vpa("3")-vpa("2")*x^vpa("2")+vpa("5") f = 5+x^3-2*x^2 octave:6> differentiate (f,x) ans = 3*x^2-4*x octave:7> f = Sin(x)*(x^vpa("3")-vpa("2")*x^vpa("2")+vpa("5")) f = (5+x^3-2*x^2)*sin(x) octave:8> differentiate (f,x) ans = (3*x^2-4*x)*sin(x)+cos(x)*(5+x^3-2*x^2) To make it more usable, somebody could modify the type operations to automatically recognize that they are working with integers and create unlimited precision integers out of them. There are also some primitive symbolic integration routines in the underlying library GiNaC, but it only operates on polynomials. - Paul On Feb 3, 2005, at 2:32 PM, Andreas Volz wrote: > Hi, > > I'm a octave newbie and try to work with differential and integral > calculus. I need some help to get a working example for this. Could you > help me? > > Here is a simple example: > > f(x)=x^3+-2x^2+5 > f'(x)=3x^2-4x > > and for example integrating f'(x) to see that f(x) results. > > And what is with more difficult calculations? I know only the german > names, so perhaps I do a wrong translation. What is with chain rule > (Kettenregel), quotient rule (Quotientenregel) or all the other funny > things to do differential or integral calculus. Could octave detect > which rule to use for which function or have I to tell octave the right > rule? Can octave do a differential calculus for this? > > f(x)=(x^2-3x)*sin x > f'(x)=? > > I hope someone could help me with this questions. Some friends are > working with matlab or maple and told me this is working with this > apps. > So I hope it works also with octave. > > regards > Andreas > > > > ------------------------------------------------------------- > Octave is freely available under the terms of the GNU GPL. > > Octave's home on the web: http://www.octave.org > How to fund new projects: http://www.octave.org/funding.html > Subscription information: http://www.octave.org/archive.html > ------------------------------------------------------------- > ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------