1
$\begingroup$

I am quite new to Mathematica, so please be patient ;)

I have a very long equation that I have to sort for powers of a variable called e and that I want to simplify. So I call

Collect[equation,e,Simplify]

But in the factors of e^k there are a lot of square roots and powers of variables, terms like $\frac{1}{\sqrt{g}} g^{\frac{1}{2}}$, that don't get simplified unless I pass the assumption g > 0 to Simplify. But how can I pass this assumption if Simplify is called from within Collect? Or is there a totally different way to achieve this?

Thx

Stefan

$\endgroup$
  • $\begingroup$ Try: Simplify[Collect[equation, e], Assumptions -> g > 0] $\endgroup$ – David G. Stork Dec 21 '14 at 10:50
  • 1
    $\begingroup$ You can replace Simplify with Simplify[#, Assumptions -> g > 0] & or use $Assumptions. $\endgroup$ – Karsten 7. Dec 21 '14 at 10:54
  • 1
    $\begingroup$ @Karsten7. I tried that out but aborted the evaluation after one hour. When I runned Collect with Simplify before it took around 10 minutes. I solved the problem now with Assuming[g>0,Collect[equation,e,Simplify]]. Thanks for the fast answers!!! $\endgroup$ – Stefan Dec 21 '14 at 13:38
  • $\begingroup$ You could post a part of your equation together with your solution to this problem and a comparison with the other approaches suggested as a self answer. You can use AbsoluteTiming to quantify the computation time. $\endgroup$ – Karsten 7. Dec 22 '14 at 0:05

Your Answer

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

Browse other questions tagged or ask your own question.