I want to extract a factor from the equations, it's not a common factor, just a factor defined by myself, like this: (ac+b) --> c(a+b/c) I have tried Factor,FactorTerms,Eliminate, but it do not work as I expect, if the factor do not contained in the terms, it could not be extracted, like: b=c*(b/c) I turn to MATHEMATICA for its ability on symbolic calculations, I want to replace pen and paper with the computer program, for convenient and accuracy. Sometimes I need to rearrange the equations to extract some factors or apply some math skills, but the MATHEMATICA always automatically simplify my expression. This is my equation:

-((b La r \[Omega] - b k La^2 \[Omega]^2)/(
  g h k w + g h k^3 La^2 w)) == 1

I want to extract (\[Omega]^2*b)/(k^2*g*h*w) and put this part on one side and the other parts on the other side, like this:

(\[Omega]^2*b)/(k^2*g*h*w) == the other part

I have tried:

eq11=-((b La r \[Omega] - b k La^2 \[Omega]^2)/(
  g h k w + g h k^3 La^2 w)) == 1
eq12 = Times[(\[Omega]^2*b)/(k^2*g*h*w), 
  Divide[eq11[[1]], (\[Omega]^2*b)/(k^2*g*h*w)]]


factorOut[fac_][expr_] := 
 Replace[expr, p_Plus :> fac Simplify[p/fac], All]

enter image description here

enter image description here

I would appreciate it if who can fix my problem

  • $\begingroup$ Welcome to Mathematica.SE! I hope you will become a regular contributor. To get started, 1) take the introductory tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign, and 4) give help too, by answering questions in your areas of expertise. $\endgroup$
    – bbgodfrey
    Jun 21, 2021 at 3:46
  • $\begingroup$ Thanks those who provide help, all of the answers are very great! $\endgroup$ Jun 22, 2021 at 9:03

3 Answers 3


May be this way

eq = -((b La r \[Omega] - b k La^2 \[Omega]^2)/(g h k w + 
   g h k^3 La^2 w)) == 1

sub1 = (b \[Omega]^2)/(g h k^2 w)

eq2 = eq[[1]]*sub2/sub1 == eq[[2]]

sol = First@Solve[eq2, sub2]

(*     {sub2 -> ((1 + k^2 La^2) \[Omega])/(k La (-r + k La \[Omega]))}     *)

sub1 == sub2 /. sol // Simplify

(*   (b \[Omega]^2)/(g h k^2 w) == 
-((\[Omega] + k^2 La^2 \[Omega])/(k La r - k^2 La^2 \[Omega]))   *)

sub1 == sub2 /. sol // Simplify[#, eq] &

(*   True   *)

There is no special built-in function doing this. You can use the following customwritten one:

factor[expr_, fact_, funExpr_ : Expand, funFact_ : Identity] := 
 Module[{a = fact, b = expr/fact},

Here expr is the expression to factor, the fact is the factor to take out of the parentheses, funExpris an optional function to apply to the rest of the expression after the factorization. By default, it is Expand. funFact is an optional function to apply to the factor if needed. By default, it is Identity.

Returning to your expression:

 expr = -((b La r \[Omega] - b k La^2 \[Omega]^2)/(g h k w + 
           g h k^3 La^2 w)); 
factor[expr, (\[Omega]^2*b)/(k^2*g*h*w), Simplify, HoldForm]

enter image description here

Have fun!


I guess, the simplest way to make desired is to do it semi-manually:

aaa=-((b La r \[Omega] - b k La^2 \[Omega]^2)/(g h k w + g h k^3 La^2 w));
bbb=\[Omega] b/(k^2 g h w);

All rest, like a creation of superfunctions that refines your equation, is just sophistication..


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.