Factor terms in mathematica

In summary, in Mathematica, you can use the Collect function to factor out terms in non-polynomial expressions. This function collects all terms with the specified variables and rearranges them in a simpler form. However, it should be noted that the order of the factors may not always be preserved.
  • #1
36
0
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]
 
Physics news on Phys.org
  • #2
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).
 
  • #3



In Mathematica, you can use the function FactorTerms to factor out common terms from expressions, including non-polynomial terms. This function takes in an expression and a list of variables to consider and returns the factored expression. For example, using the expression provided in the question, we can factor out (e^t)*t^2 as follows:

FactorTerms[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], {e^t, t}]

This will give the factored expression:

e^t t^2 (b + a t - 2 b - 6 a t + 2 b t + 3 a t^2 - 2 b t - 3 a t^2 + Log[e] (2 b t + 3 a t^2 + b t^2 + a t^3))

Note that the function also takes into account the logarithmic terms, so we get the factor of Log[e] in the final expression.

In general, FactorTerms can be used to factor out any common terms from an expression, regardless of whether they are polynomials or not.
 

1. What is a factor term in Mathematica?

A factor term in Mathematica refers to a mathematical expression that is multiplied by another expression. It is typically represented as a product of two or more variables or constants.

2. How do I use factor terms in Mathematica?

To use factor terms in Mathematica, you can simply use the asterisk (*) symbol to represent multiplication. For example, to represent the factor term 3x, you would write "3*x" in Mathematica.

3. Can I simplify factor terms in Mathematica?

Yes, you can simplify factor terms in Mathematica using the Simplify or FullSimplify functions. These functions use algebraic rules to simplify the expression and can be helpful in factoring out common terms.

4. How do I factor a polynomial in Mathematica?

To factor a polynomial in Mathematica, you can use the Factor function. This function takes in a polynomial expression and returns its factored form, if possible. For more complex polynomials, you may need to use additional functions such as Expand or Collect to simplify the expression before factoring.

5. Can I factor an expression with variables in Mathematica?

Yes, you can factor expressions with variables in Mathematica. The Factor function can handle expressions with variables just as easily as those with constants. However, if you are factoring a polynomial with multiple variables, you may need to use additional functions such as Collect to simplify the expression before factoring.

Suggested for: Factor terms in mathematica

Replies
4
Views
299
Replies
1
Views
1K
Replies
1
Views
68
Replies
1
Views
915
Replies
1
Views
1K
Replies
2
Views
1K
Replies
3
Views
445
Back
Top