Sorry, but some powers automatically denest: In [6]: print sqrt(x/2) sqrt(2)*sqrt(x)/2
so it is impossible to pull them together. expand_log does what you want, though it also expands using the additive rule. It's not too much more complicated to make it work with a multiplication of powers instead of a single power, though, if you insist on writing your own targeted simplification function. Aaron Meurer On Mon, Jul 22, 2013 at 2:28 AM, Ben Lucato <ben.luc...@gmail.com> wrote: > Say I have an expression like: > > y = sqrt(2) * sqrt(-x + 4)/2 > > and then we call powsimp(y), we get: > > sqrt(-2*x + 8)/2 > > is there a way to get > > sqrt((-x + 4) / 2), i.e. have the denominator of the fraction be checked > too? I tried looking at the docs but there didn't seem to be a > simplification for this. > > > My reasoning is for writing logs: if I can collect everything inside a log > to have a power, then that power can be moved outside the log - in this > case, log(y) would become: > > log((-x + 4) / 2) / 2 > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sympy+unsubscr...@googlegroups.com. > To post to this group, send email to sympy@googlegroups.com. > Visit this group at http://groups.google.com/group/sympy. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at http://groups.google.com/group/sympy. For more options, visit https://groups.google.com/groups/opt_out.