posible bug - clashing variable names in integrals
Subject: posible bug - clashing variable names in integrals
From: Barton Willis
Date: Sun, 4 Oct 2009 07:54:36 -0500
---------
>All?I?want?to?do?is?to?use?Maxima?to?do?proofs?where?factoring?expressions
>of?the?form
>
>integral(integral(f(x),x,a,b)*g(x),x,c,d)
>
>into
>
>integral(f(x),x,a,b)*(integral(g(x),x,a,b)
You can experiment with something like this:
(%i31) safe_op(e) := block([inflag :true], if not mapatom(e) then op(e)
else false)$
(%i32) myfreeof(x,e) := freeof(x,e) or (safe_op(e) = 'iint and freeof
(x,third(e)) and freeof(x,fourth(e)))$
(%i33) iint(e,x,a,b) := block([c : 1, f : 1],
if safe_op(e) = "*" then (
for ek in e do (
if myfreeof(x,ek) then c : c * ek else f : f * ek),
c * funmake('iint,[f,x,a,b]))
else funmake('iint,[e,x,a,b]))$
(%i34) int_outative(e) := (
e : subst('integral = 'iint, e),
e : ev(e, nouns),
subst('iint = 'integral,e))$
(%i35) int_outative(integral(integral(f(x),x,a,b)*g(x),x,c,d));
(%o35) integral(f(x),x,a,b)*integral(g(x),x,c,d)
I haven't tested this code, but it might be a start on something that is
useful to you. This code will fail on indefinite integrals.
Barton