Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Factor terms in mathematica

  1. May 6, 2009 #1
    is there a way to factor terms in non polynomials

    for example, to factor out (e^t)*t^2, (e^t)*t

    e^t t^2 (b + a t) + e^t (2 b + 6 a t) + e^t (2 b t + 3 a t^2) -
    2 (e^t (2 b t + 3 a t^2) + e^t (b t^2 + a t^3)) +
    e^t (2 b t + 3 a t^2) Log[e] + e^t (b t^2 + a t^3) Log[e]
     
  2. jcsd
  3. Jun 26, 2009 #2

    EnumaElish

    User Avatar
    Science Advisor
    Homework Helper

    You can factor out terms in Mathematica using Collect[expression, {terms}].

    For example, Collect[a + a b + a b c, {a, b}] = a (1 + b (1 + c)).

    But Collect[(a b)^2 + a b + a b c, {a}] = a^2 b^2 + a (b + b c), not a(a b^2 + b + b c).
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook