Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Solve an equation with variable under square-root

I want to solve $p=h+\sqrt{\dfrac{p\cdot\left(1-p\right)}{n}}$ for $p$.

This works with
In:

eqn = (p-h)^2==p*(1-p)/n
solve(eqn, p)

Out:

[p == 1/2*(2*h*n - sqrt(-4*(h^2 - h)*n + 1) + 1)/(n + 1), p == 1/2*(2*h*n + sqrt(-4*(h^2 - h)*n + 1) + 1)/(n + 1)]

But this works not with

In:

eqn1 = p-h==sqrt(p*(1-p)/n)
solve(eqn1, p)

Out:

[p == h + sqrt(-(p^2 - p)/n)]

How can I solve the root-equation directly?