help-octave
[Top][All Lists]

## Re: integral

 From: Miroslaw Kwasniak Subject: Re: integral Date: Fri, 19 Aug 2005 13:29:18 +0200 User-agent: Mutt/1.5.9i

```On Thu, Aug 18, 2005 at 09:56:07PM -0700, Fred J. wrote:
> Hello
>
> I need to do an integration
>
> integrate_0^(x-1/2) integrate_(1/2+y)^0 12xy(1-y) dx
> dy
>
> how can I use octave to do this. I have been reading a
> lot in the
> first few pages of the manual but need to know if this
> is even do-able
> with octave?

Octave doesn't have symbolic toolbox but you can use Maxima.
See my (very, very) simple function for calling Maxima (with bash shell):

\$ cat /tmp/Maxima.m
function Y = Maxima (X)
x = [ "tmp=/tmp/\$\$.tmp;" ...
"echo 'display2d:false\$", X, ";'" ...
"|maxima|tee \"\$tmp\"|grep o2|" ...
"(" ...
"[ -n \"\$y\" ]&&echo \"\$y\"||((echo ERROR;cat \"\$tmp\") >&2)" ...
");rm \"\$tmp\""];
Y = system (x);
endfunction

octave:67> exp0="integrate(integrate(12*x*y*(1-y),x,1/2+y,0),y,0,x-1/2)";
octave:68> exp1=Maxima(exp0)
exp1 = 3*(32*x^5-80*x^4+40*x^3-1)/80

-------------------------------------------------------------
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
-------------------------------------------------------------

```