Question: How do I algebraically factor out an expression from an expression? See example.


 

restart

NULL

How do I factor out a term,with command line, from an algebraic expression?

NULL

Consider the following algebraic expression.

NULL

f := A*sin(x)*theta(x)*k-A*sin(x)*theta(x)*m*omega^2

A*sin(x)*theta(x)*k-A*sin(x)*theta(x)*m*omega^2

(1)

Suppose I wanted to factor out the quantity A*sin(x)*theta(x)from both terms. Done by hand, it would look like:

"f:=A*sin(x)*theta(x)*k-A*sin(x)*theta(x)*m*omega^(2) =A*sin(x)*theta(x)*(k-m*omega^(2))."

NULL

What is the typical way to do this operation with a command? I tried using the collect() command with no success:

NULL``

collect(f, A*sin(x)*theta(x))collect(f, A*sin(x)*theta(x))

Error, (in collect) cannot collect A*sin(x)*theta(x)

 

NULL

From the help sheets, "The collect function views a as a general polynomial in x.  It collects all the coefficients with the same rational power of x." Though A*sin(x)*theta(x)could be expanded into a polynomial in x (if A and theta(x)are well-behaved), I just want to work algebraically and treat A, sin(x), and theta(x)as indeterminants.  


 

Download how_do_I_algebraically_factor_an_expression_from_an_expression.mw

Please Wait...