In the old days, when "making the Numerator rational" was often wanted, I came up with the following set of rules:
EvaluiereAt[pos:(_Integer|{__Integer}),f_:Identity][expr_]:=
ReplacePart[expr,pos->Extract[expr,pos,f]];
EvaluiereAt[pos:{{__Integer}..},f_:Identity][expr_] :=
Fold[ReplacePart[#1, #2 -> Extract[#1, #2, f]] &, expr, Reverse[Sort[pos]]];
$pinkHoldColor = ColorData["HTML"]["HotPink"];
pinkHold[x_] := Style[Tooltip[HoldForm[x], "held"], $pinkHoldColor];
Attributes[rootRational] = {Listable};
rootRational[expr_] :=
Module[{zw, res, pos}, zw = expr /. Sqrt[a_] :> Sqrt[Together[a]];
res = zw /. Sqrt[a_/b_] :> Sqrt[Expand[a b]]/b;
res = res /. {a_./(b_ + d_. Sqrt[c_]) -> (a (b - d Sqrt[c]))/(b^2 -
d^2 c),
a_./(b_ - d_. Sqrt[c_]) -> (a (b + d Sqrt[c]))/(b^2 - d^2 c)};
res = res /. Sqrt[Rational[a_, b_]] :> pinkHold[Sqrt[a b]]/b;
res = res /. (a_/Sqrt[b_]) :> a pinkHold[Sqrt[b]]/b;
res = res /.
b_. Power[a_, Rational[-1, 2]] :> b pinkHold[Sqrt[a]]/a;
pos = Position[res, _?NumberQ];
If[Flatten[pos] =!= {}, res = EvaluiereAt[pos][res]];
res];
Attributes[pinkUnhold] = {Listable};
pinkUnhold[expr_] :=
ReleaseHold[expr /. Style[Tooltip[a_, __], __] -> a];
the function rootRational tries to achieve this. To show, that something is in HoldForm, I marked it with a pink color. To ReleaseHold and take away the color an tooltip there is the function pinkUnhold.
Examples:
w = Sqrt[6]/9
% // rootRational
% // pinkUnhold Clear[a];
w = Sqrt[(1 + a)/(1 - a)] // rootRational
% // FullSimplify
rootRational[Sqrt[b]/b]
rootRational[1/Sqrt[b]]
