Simplify expression

Unclear what do here, can't find a similar example online. I need to simplify down this expression.

$$g(q( (1-g)(1-f) ) ) - q( (1-g)(1-f) )^2$$

I understand you don't need to provide the answer for me. Just a similar example so I can work this one out alone would be sufficient

All g and f are numbers. q is also numbers e.g q=0.5

-
I take it, $f$ and $g$ are numbers? What about $P$ and $q$? They're written as functions. If so, you have to say what functions. Otherwise noting can be done. – Karolis Juodelė May 2 '13 at 6:58
I think it's pretty simple as it stands, I don't see how you could improve this expression. There are maybe a few brackets too many, but that's all I can think of. – Raskolnikov May 2 '13 at 9:53
@raskolnikov sorry there was an error in expression. Sorry thank for your comment – Sorryjustdaft May 2 '13 at 10:39

You have a difference between two terms: $A-B$.

The second term $B$ is $q((1-g)(1-f))^2 = q(1-g)(1-f)(1-g)(1-f)$, so it is a product of 5 factors, among them $(1-f)$. So $B = (...)*(1-f)$.

Write the first term $A$ also as a product of factors, among them again $(1-f)$. $A = (.....)*(1-f)$.

Now apply distributivity: $(.....)*(1-f) - (...)*(1-f) = (.... - ...)*(1-f)$.

(Note that distributivity $ax-bx=(a-b)x$ works even if $x$ is a more complicated expression, such as $(1-f)$.)

Once you have done that, you will see how to simplify further.

-
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}