I would like to avoid multiplying explicitely by the denominator, because I'm working with huge fractions.
Consider
f[x_,y_] := Cos[x - y]/(Sin[x] Cos[y])+ 1/Sin[x];
Mathematica transforms this into Csc[x] + Cos[x - y] Csc[x] Sec[y]
which I'd like to avoid: my goal is precisely to get rid of the singularities. So I used
$PrePrint = # /. {Csc[z_] :> 1/Defer@Sin[z], Sec[z_] :> 1/Defer@Cos[z]} &;
but then Together[f[x,y]]
does not put f
with a common denominator, and Numerator
just returns f[x,y]
.
So how can I get the numerator of f[x,y]
? It should be Cos[x - y] + Cos[y]
.