error with find_root when functions containing more than one built-in constant like %pi
Subject: error with find_root when functions containing more than one built-in constant like %pi
From: Robert Dodier
Date: Sat, 27 Jan 2007 19:33:02 -0700
Bob,
Maxima treats %e differently than other symbolic constants.
%e is preserved as a symbol in contexts in which other constants
become numbers. The user can encourage Maxima to turn %e into
a number via the %enumer flag. Not sure if that works 100%.
f(x) := -(log((4 + %e)/(2*%pi)))*(((4 + %e)/(2*%pi))^x);
find_root (2*x = f(x), x, -1, 0), %enumer;
=> - .03340289826874122
g(x) := cos((%e + %pi)*x);
find_root (2*x = g(x), x, 0, 1), %enumer;
=> .1984210505656873
(1) Probably find_root should always let %enumer be true.
(2) Maxima simplifies exp(x) to %e^x and the special cases for %e
are probably related to that. As an alternative Maxima could refrain
from exp(x) --> %e^x, and then treat %e like other constants.
Hope this helps,
Robert