Hi,
This is a quick and possibly not so useful answer.
(1) I think you're running into a bug in Maxima (hence Sage) below, since
your assumption should be passed through. It's pretty hard for us Sage
developers to fix bugs in Maxima, unfortunately. Nonetheless, we are
very thankful for the bug report.
(2) Possibly doing the following workaround would be OK for you, i.e.,
just compute the definite integral you want by computing an antiderivative
and use the fundamental theorem of calculus:
sage: x,y=var('x,y')
sage: f = log(x^2+y^2)
sage: integrate(f,x)
x*log(y^2 + x^2) - 2*(x - atan(x/y)*y)
sage: g = integrate(f,x)
sage: h = g(x=1.) - g(x=0.0001415); h # this is what you want.
1.00000000000000*log(y^2 + 1.00000000000000) - 0.0001415000000000000000*log(y^2 + 0.000000020022250000000000000000) - 2*(1.00000000000000 - atan(1.00000000000000/y)*y) + 2*(0.0001415000000000000000 - atan(0.0001415000000000000000/y)*y)
sage: h(y=5)
3.231596665591034
On 10/1/07, Eliz <elyip@comcast.net> wrote:
>
> Attached is the 'edit' view of my worksheet. When I changed the lower
> bound of the definite integral from 0.0001415 to 0.0001414, we got
> into trouble.
>
> Elizabeth
> ------------------------------------------------------------------------------------------------------------
> integration_exercise
> system:sage
>
> {{{id=0|
> x,y=var('x,y')
> f=log(x^2+y^2)
> integrate(f,x)
> ///
> x*log(y^2 + x^2) - 2*(x - atan(x/y)*y)
> }}}
>
> {{{id=11|
> assume(y^2>1)
> integrate(f,x,0.0001415,1.)
> ///
> 1.00000000000000*log(1.00000000000000*y^2 + 1.00000000000000) -
> 0.0001415000000000000000*log(1.00000000000000*y^2 +
> 0.000000020022250000000000000000) +
> 2.00000000000000*atan(1.00000000000000/y)*y -
> 2.00000000000000*atan(0.0001415000000000000000/y)*y - 1.99971700000000
> }}}
>
> {{{id=16|
> assume(y^2<1)
> integrate(f,x,0.0001415,1.)
> ///
> 1.00000000000000*log(1.00000000000000*y^2 + 1.00000000000000) -
> 0.0001415000000000000000*log(1.00000000000000*y^2 +
> 0.000000020022250000000000000000) +
> 2.00000000000000*atan(1.00000000000000/y)*y -
> 2.00000000000000*atan(0.0001415000000000000000/y)*y - 1.99971700000000
> }}}
>
> {{{id=17|
> assume(y^2==1)
> integrate(f,x,0.0001415,1.)
> ///
> 1.00000000000000*log(1.00000000000000*y^2 + 1.00000000000000) -
> 0.0001415000000000000000*log(1.00000000000000*y^2 +
> 0.000000020022250000000000000000) +
> 2.00000000000000*atan(1.00000000000000/y)*y -
> 2.00000000000000*atan(0.0001415000000000000000/y)*y - 1.99971700000000
> }}}
>
> {{{id=19|
> assume(y^2>1)
> integrate(f,x,0.0001414,1.)
> ///
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/home/yip/sage_notebook/worksheets/admin/10/code/47.py", line
> 5, in <module>
> exec
> compile(ur'integrate(f,x,RealNumber(\u00270.0001414\u0027),RealNumber(\u00271.\u0027))'
> + '\n', '', 'single')
> File "/local/sage-2.8.5.1/data/extcode/sage/", line 1, in <module>
>
> File "/local/sage-2.8.5.1/local/lib/python2.5/site-packages/sage/
> calculus/functional.py", line 175, in integral
> return f.integral(*args, **kwds)
> File "/local/sage-2.8.5.1/local/lib/python2.5/site-packages/sage/
> calculus/calculus.py", line 1652, in integral
> return self.parent()(self._maxima_().integrate(v, a, b))
> File "/local/sage-2.8.5.1/local/lib/python2.5/site-packages/sage/
> interfaces/maxima.py", line 1391, in integral
> return I(var, min, max)
> File "/local/sage-2.8.5.1/local/lib/python2.5/site-packages/sage/
> interfaces/expect.py", line 884, in __call__
> return self._obj.parent().function_call(self._name, [self._obj] +
> list(args))
> File "/local/sage-2.8.5.1/local/lib/python2.5/site-packages/sage/
> interfaces/expect.py", line 831, in function_call
> return self.new("%s(%s)"%(function, ",".join([s.name() for s in
> args])))
> File "/local/sage-2.8.5.1/local/lib/python2.5/site-packages/sage/
> interfaces/expect.py", line 733, in new
> return self(code)
> File "/local/sage-2.8.5.1/local/lib/python2.5/site-packages/sage/
> interfaces/maxima.py", line 376, in __call__
> return Expect.__call__(self, x)
> File "/local/sage-2.8.5.1/local/lib/python2.5/site-packages/sage/
> interfaces/expect.py", line 678, in __call__
> return cls(self, x)
> File "/local/sage-2.8.5.1/local/lib/python2.5/site-packages/sage/
> interfaces/expect.py", line 919, in __init__
> raise TypeError, x
> TypeError: Computation failed since Maxima requested additional
> constraints (use assume):
> Is (y-1)*(y+1) positive, negative, or zero?
> }}}
>
> {{{id=20|
>
> }}}
>