On Thu, Feb 26, 2009 at 12:27:54PM -0800, Ondrej Certik wrote:
> On Thu, Feb 26, 2009 at 12:11 PM, Priit Laes <plaes...@gmail.com> wrote:
> > Patch here: http://plaes.org/files/2009-Q1/sympy-fix-asin-integral.patch
> >
> > Previously sympy failed to integrate things like this:
> >
> > In [3]: integrate(1/sqrt(9 + 4*x**2), x)
> > Out[3]:
> > ⌠
> > ⎮       1
> > ⎮ ───────────── dx
> > ⎮    ⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽
> > ⎮   ╱        2
> > ⎮ ╲╱  9 + 4⋅x
> > ⌡
> >
> > With patch applied:
> >
> > In [1]: integrate(1/sqrt(9 + 4*x**2), x)
> > Out[1]:
> >     ⎛2⋅x⎞
> > asinh⎜───⎟
> >     ⎝ 3 ⎠
> > ──────────
> >    2
> >
> > This also uncovered a bug: just try to do this: integrate(1/sqrt(16 +
> > 4*x**2), x)
> 
> Thanks for the patch!
> 
> Due to this:
> 
> -    diffs = [ substitute(g.diff(x)) for g in terms ]
> +    diffs = [ substitute(simplify(g.diff(x))) for g in terms ]
> 
> 
> I would like to know Mateusz's opinion, if it's good to use simplify
> in the integrator.
> 
> Ondrej
> 

Tests pass and no slowdown, so +1.

To make further progress one should investigate if Basic.subs shouldn't
be improved, e.g. by using topological sorting and how subtleties like
simplify(log(x**2)) -> 2*log(x), when mappings has log(x**2) but not
log(x), influence heurisch().

-- 
Mateusz

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to