2
$\begingroup$

How can I rewrite an expression like $\frac{1}{2\sqrt{3}}$ as $\frac{1}{\sqrt{12}}$?

This works in principle, but gets immediately simplified back to the original expression

1/(2 Sqrt[
  3]) /. {Times[Rational[a_, b_], Power[c_, Rational[x_, y_]]] /; 
    x < 0 :> a Power[b^2 c, Rational[x, y]]}
$\endgroup$
3
  • 3
    $\begingroup$ I think this was talked about before in this forum. I do not think you can (without using Hold and related). Because this is one of those things Mathematica does automatically. i.e. automatic simplification. !Mathematica graphics $\endgroup$
    – Nasser
    Commented Dec 5, 2022 at 14:38
  • $\begingroup$ @Nasser good point, I'll look into another option then $\endgroup$ Commented Dec 5, 2022 at 14:44
  • $\begingroup$ You can also inactivate the Power, e.g. 1/(2 Sqrt[3])/.{c_^Rational[x_,y_] Rational[a_,b_]/;x<0:>a Inactive[Power][b^2 c,Rational[x,y]]} returns 12^(-(1/2)). $\endgroup$
    – Lacia
    Commented Dec 5, 2022 at 21:13

0

Browse other questions tagged or ask your own question.