make f the subject of the formula:

D=square root p/f-p

Please use the subject title so that the right teacher can help you.