log(x^2) -> 2 log(x)



On 5/24/10 9:04 PM, John Lapeyre wrote:
> Hi,
>
> I get this:
>  (%i1) log(x^2)
>  (%o1)  2 log(x)
>
> Which is true for real, positive x, but not for negative x,
> or other complex values.
>
> Shouldn't this only simplify this way if x>0 ?
>   
Probably.

You can control this using logexpand.  Setting logexpand to false
prevents this.

Ray