I am still learning how to use Mathematica more efficiently, but something that I keep bumping into is problems with it reducing formulas. Often, I'll ask it to compute a certain formula (take a derivative, Fourier transform, etc.) and the output is sometimes very messy, but could easily be reduced to something much neater.
It's usually not a big deal, because I can carry the simplification on my own, but it would still be convenient to have a systematic way of reducing everything, and not have to little tricks on a case by case basis. In some cases, I have tried, FullSimplify
or TrigReduce
without much success, or even using certain assumptions. For example, this should reduce
Cos[\[Theta]] ((Sqrt[-((g H)/(-1 + Sin[\[Theta]]))]Sqrt[-g H (-1 + Sin[\[Theta]])])/g - (H Sin[\[Theta]])/(-1 + Sin[\[Theta]]))
$\cos (\theta ) \left(\frac{\sqrt{-\frac{g H}{\sin (\theta )-1}} \sqrt{-g H (\sin (\theta )-1)}}{g}-\frac{H \sin (\theta )}{\sin (\theta )-1}\right)$
to this
Cos[\[Theta]] (H-(H Sin[\[Theta]])/(-1+Sin[\[Theta]]))
$\cos (\theta ) \left(H-\frac{H \sin (\theta )}{\sin (\theta )-1}\right)$
But even when doing FullSimplify
on it, it just outputs the same expression. I don't have examples on top of my head, but I have been in similar situations before, where I want to reduce something, but I jut can't seem to do anything to reduce it.
Are there extra ways of forcing it into 'seeing' the possible simplifications? Or is it possible that from its perspective the expression is reduced enough? To be honest, I am not asking for a specific case of simplification, but more on the general approaches one would take to simplify/reduce an expression.
Thanks in advance.
Refine
andSimplify
in tandem seem to manage it then.In[76]:= ee = Cos[\[Theta]] ((Sqrt[-((g H)/(-1 + Sin[\[Theta]]))] Sqrt[-g H (-1 + Sin[\[Theta]])])/ g - (H Sin[\[Theta]])/(-1 + Sin[\[Theta]])); Simplify[Refine[ee, Assumptions -> {g > 0, H > 0, 0 < \[Theta] < Pi/2}], Assumptions -> {g > 0, H > 0, 0 < \[Theta] < Pi/2}] Out[77]= (H Cos[\[Theta]])/(1 - Sin[\[Theta]])
$\endgroup$