Status: Accepted
Owner: asmeurer
Labels: Type-Defect Priority-Medium Polynomial Integration

New issue 2040 by asmeurer: Better way to make a rational function out of an expression
http://code.google.com/p/sympy/issues/detail?id=2040

In the Risch Algorithm (issue 2010), I need to convert the expression into a rational function, which is done by first converting the non-rational parts (exp, log) into dummy variables. My current method is along the lines of

if expr.is_rational_function(*T):
    a, d = expr.as_numer_denom()
    a, d = Poly(a, t), Poly(d, t)

Where t = T[-1]. This works fine in most cases, but it fails in cases like this one:

expr = sqrt(x**2 + y**2 + 2*x*y)
T = [x, y]

because expr.is_rational_function(*T) fails on it, but it really is a rational function because expr == sqrt((x + y)**2) = x + y. So I think there needs to be some function that not only is smarter about making rational functions out expressions, but also streamlines the above process.

(P.S., I know about all the assumptions nonsense. Basically, when we work with integration, we ignore assumptions and work with things algebraically, and I need a function that does that.)

By the way, here's an example function that requires this functionality in risch_integrate() to work. It is equivalent to log(x + 1) + log(x + 2) or just log(x**2 + 3*x + 2):

sqrt(log(x**2 + 3*x + 2)*(log(x + 1) + log(x + 2)))

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-iss...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to