The code
Limit[Log[2 - Sin[x]*Cos[x]], x -> Infinity]
outputs
Interval[{0, Log[3]}]
in Mathematica 10.0.2.0 . It should be
Interval[{Log[3/2]}, Log[5/2]}]
instead of. Is there a workaround?
Slow down the approach,
Limit[Log[2 - Sin[x]*Cos[x]] /. x -> x/2, x -> Infinity]
or speed it up,
Limit[Log[2 - Sin[x]*Cos[x]] /. x -> 2 x, x -> Infinity]
-- both yield
Interval[{Log[3/2], Log[5/2]}]
Trace
, which was unilluminating. My feeling was that the transformation Sin[2x] -> 2 Sin[x] Cos[x]
, getting the trig. fns. in terms of x
(e.g. TrigExpand
), and Sin
, Cos
being between ±1
might be tempting M. Changing x
in the above and similar ways seems to work, perhaps by preventing the double angle formula from being applied. It was basically a guess. BTW, in my view of how Limit
and Interval
work, I think both results are "correct," although a more precise result is more desirable.
$\endgroup$
Commented
Jan 15, 2015 at 0:45
A limited kind of work-around:
expr = Log[2 - Sin[x]*Cos[x]];
TrigReduce //@ expr /. x -> Interval[∞]
Interval[{Log[3/2], Log[5/2]}]
f[x_] = Log[2 - Sin[x]*Cos[x]];
Simplify[f[x] == f[x + n Pi], Element[n, Integers]]
True
Since the function is periodic, the limit interval is just the minimum and maximum of the function.
Interval@(f[x] /. Solve[{f'[x] == 0, 0 <= x <= 2 Pi}, x, Reals] //
FullSimplify // Union)
Interval[{Log[3/2], Log[5/2]}]
Alternatively, with version 10
FunctionRange[f[x], x, y] // FullSimplify
Log[3/2] <= y <= Log[5/2]
Interval@Cases[%, _?NumericQ]
Interval[{Log[3/2], Log[5/2]}]
Limit[Sin[x]*Cos[x], x -> Infinity]
is a simple example of the bug. $\endgroup$Limit
does not in general find the tightest possible interval for functions that oscillate. $\endgroup$