C Y <smustudent1@yahoo.com> writes:
> I've run into a problem with the Maxima integration ability. I tried
> to integrate 3^log(x), and according to both hand and mathematica
> calculations the answer should be (x*3^log(x))/(1+log(3)). Maxima,
> however, gives 3^(2*log(x))/(2*log(3)).
The patch below fixes this problem. I tested it with the current
Maxima 5.9.0pre-cvs under clisp 2.28.
Here's some explanation.
The function `$integrate' (defined in `simp.lisp') dispatches between
the functions `rischint' and `sinint' (for indefinite integrals) and
`$defint' (for definite integrals). For indefinite integrals, it
calls `sinint' by default (I guess `sinint' implements what people
call "heuristic methods").
Now, the functions called by `sinint' deal with the integrand 3^log(x)
in a slightly perverse way: they do the equivalent of substituting
exp(x) for x, which gives the expression 3^x*%e^x. Then `elemxpt' (in
`sin.lisp') is called. As far as I understand, this function tries to
rewrite the factors in the form b^y, where b is the value of the
dynamic variable `base*' (3 in our case). In particular, it has to
solve the equation %e^x=3^y for y; this gives y=x/log(3), but it
forgets the factor 1/log(3). Finally, x is substituted for 3^x.
Of course, you can see for yourself by tracing the function `elemxpt'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cut ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*** sin.lisp.ori Tue Apr 9 00:14:48 2002
--- sin.lisp Mon Apr 8 18:40:20 2002
***************
*** 65,68 ****
--- 65,70 ----
BASE*
(SIMPLIFY (LIST '(MTIMES)
+ (list '(mexpt simp)
+ (list '(%log) base*) -1)
(LIST '(%LOG)
(CADR EXP))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cut ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Wolfgang
--
wjenkner@inode.at