I have some function:


Is there a way that I can factor out parameter (variable) b like this:

f[a_,b_,c_]:=b Sqrt[(a/b)^2+1+(c/a)^2]

in Mathematica, and call these new factored variables (a/b) and (c/b) as p and q respectively?


What about

Simplify[ Sqrt[a^2 + b^2 + c^2] /. {a -> p b, c -> q b}, b > 0]
(*b Sqrt[1 + p^2 + q^2]*)


| improve this answer | |
  • $\begingroup$ It works! Thanks! $\endgroup$ – Theorist Oct 10 '18 at 10:38

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.