# Simplify expression after substitution

I tried to substitue variable x of one equation with another variable z (z=nx/(nx+m)). See as follow:

Solve[z == n*x/(n*x + m), x]

x -> -((m z)/(n (-1 + z)))


Then:

PDF[FRatioDistribution[n, m], x] /. x -> -((m z)/(n (-1 + z)))

 (m^(m/2) n^(n/2) (-((m z)/(n (-1 + z))))^(-1 + n/2) (m - (m z)/(-1 + z))^(1/2
(-m - n)))/Beta[n/2, m/2]


How can I collect the term z and 1-z together? Factually, if collecting the results by z and1-z, it can be very simple (that is Beta distribution). Any suggestion will be greatly appreciated.

• Just FullSimplify[..., Assumptions -> {n > 0, m > 0}] Commented Oct 13, 2013 at 22:05
• Thaks your reply. it helps. Commented Oct 14, 2013 at 5:13
• @ybeltukov answer? Commented Oct 14, 2013 at 17:45

## 1 Answer

FullSimplify with Assumptions makes what you want

FullSimplify[PDF[FRatioDistribution[n, m], x] /. x -> -((m z)/(n (-1 + z))),
Assumptions -> {n > 0, m > 0}]

(n (1 - z)^(1 + m/2) z^(-1 + n/2))/(m Beta[n/2, m/2])