Skip to content

PowerExpand ​

Expand powers and logarithms of products in expr as though every variable were positive. Provided by @enumeratio/analytic.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguagePowerExpand✓
PowerExpand(expr)expr with Ln and Power distributed over products, assuming positivity.
Typed signatures
TypePackageApplies
(expression) -> expressionanalyticalways

Domain: Transformations

Details
  • A bottom-up rewrite: Ln(xy) → Ln(x) + Ln(y), Ln(x^n) → n·Ln(x), (ab)^c → a^c·b^c, and the same two rules specialized for Sqrt.
  • Does not check or track positivity -- it assumes it unconditionally, same as Wolfram's default (PowerExpand ignores Assumptions unless told otherwise, which this does not model either).

Examples

Basic #

x2=x\sqrt{x^2} = x for positive xx

live ↗
InPowerExpand(x2)\mathrm{PowerExpand}(\sqrt{x^2})Outxx

Splits a logarithm of a product

live ↗
InPowerExpand(ln⁡(xy))\mathrm{PowerExpand}(\ln(xy))Outln⁡(x)+ln⁡(y)\ln(x)+\ln(y)

Splits a product under the root into a product of roots

live ↗
InPowerExpand(xy)\mathrm{PowerExpand}(\sqrt{xy})Outxy\sqrt{x}\sqrt{y}
Scope #

Pulls out an exponent

live ↗
InPowerExpand(ln⁡(xn))\mathrm{PowerExpand}(\ln(x^{n}))Outnln⁡(x)n\ln(x)

Distributes a power over a product

live ↗
InPowerExpand((ab)c)\mathrm{PowerExpand}((ab)^{c})Outacbca^{c}b^{c}
live ↗
InPowerExpand(ab)\mathrm{PowerExpand}(\sqrt{ab})Outab\sqrt{a}\sqrt{b}

A product raised to a power splits termwise

live ↗
InPowerExpand((xy)a)\mathrm{PowerExpand}((xy)^{a})Outxayax^{a}y^{a}

Takes the root of a square as the argument, ignoring branches

live ↗
InPowerExpand(z2)\mathrm{PowerExpand}(\sqrt{z^2})Outzz

The log of a reciprocal gives the negative log

live ↗
InPowerExpand(ln⁡(1z))\mathrm{PowerExpand}(\ln(\frac{1}{z}))Out−ln⁡(z)-\ln(z)

The power comes out of the log: ln⁡za=aln⁡z\ln z^a = a\ln z

live ↗
InPowerExpand(ln⁡(za))\mathrm{PowerExpand}(\ln(z^{a}))Outaln⁡(z)a\ln(z)
Possible issues #

The branch-blind rule gives (x−y)+(y−x)=0(x-y) + (y-x) = 0

live ↗
InPowerExpand((x−y)2+(y−x)2)\mathrm{PowerExpand}(\sqrt{(x-y)^2}+\sqrt{(y-x)^2})Out00
About
Examples11
Checked againstWolfram Language 11 agree
CrosswalkWolfram Language

See also: FunctionExpand, Ln