# How to represent $a^2/b^2$ to $(a/b)^2$ and to $c^2$?

I am a newby on Mathematica, and trying to organize my equations in forms of I am intending.

It looks my question is so simple, so I have tried to look for possible command, and articles, but yet couldn't figure out how to do..

What I want to do is..

$a^2/b^2$ $\rightarrow$ $(a/b)^2$

so to be able to treat $a/b$ as an additional variable $c$ (kind of substitution), so finally to organize my equation as

$c^2$

also, is it possible to represent like,

$\frac{a}{bc}$ as $\frac{a/b}{c}$ ?

I think it is sort of same as the first question, which trying to treat $a/b$ as one variable. $b$ keeps going to the denominator..

I'm keeping failing to treat the rational form $a/b$ as one variable..

** Added *** The example I am trying to do is, I got the following output from my kernel $(\frac{m}{M \omega^2} + \frac{1}{(-k v + \omega)^2})\omega_p^2$

and want to express it as,

$\frac{m/M}{ \omega^2 /\omega_p^2 } + \frac{1}{(-k v /\omega_p + \omega/ \omega_p)^2}$

so as to replace

$\omega / \omega_p=x$ and $k v/ \omega_p=y$

to finally get

$\frac{m/M}{x^2 } + \frac{1}{(x-y)^2}$

.

• Since (a/b)^2 immediately evaluates to a^2/b^2, it is not possible to do what you want without using Hold/Inactive or something like that. It would be better to provide a MWE of the issue your are trying to solve so that an alternate method can be provided. – Carl Woll Sep 8 '17 at 8:07
• You can make a replacement a->b*c. – corey979 Sep 8 '17 at 8:15
• @CarlWoll Thank you for your reply! I add the example that I was trying to solve.. Would you be able to look into? – Hwi Sep 8 '17 at 8:29
• I think that with the replacements you suggest, you cannot reach your desired result. Please, note that setting $kv/ω_p=y$ will not produce $(x-y)^2$ at the denominator of the second fraction – user42582 Sep 8 '17 at 10:59
• As @user42582 says. Try FullSimplify[((m/M)/x^2 + 1/(x - y)^2 /. {x -> ω/ωp, y -> k v/ωp}) == (m/(M ω^2) + 1/(-k vω^2)) ωp^2]. It would return True if the two expressions were the same. You would need an x y cross term in there somewhere. – aardvark2012 Sep 8 '17 at 11:06

Here are two possible approaches:

FullSimplify + ReplaceAll

FullSimplify[
(m/(M ω^2)+1/(-k v+ω^2))ωp^2,
TransformationFunctions->{Automatic,Simplify@ReplaceAll[#,{ω -> x ωp,v->y ωp^2/k}]&}
]


m/(M x^2) + 1/(x^2 - y)

Solve

Apart @ Solve[
r == (m/(M ω^2)+1/(-k v+ω^2))ωp^2 && ω == x ωp && k v == y ωp^2,
r,
{ω, ωp}
]


{{r -> m/(M x^2) - 1/(-x^2 + y)}}