error in mathematical expression

I type in the code shown below for a displayed formula. However the output is not what it should be. Can you tell me what is the mistake over here?

$$\frac{(1-a)\frac{q_{f}}{{q_{n}}^a}}{p_{n}} \cdot q_{f} \cdot \Delta p$$

-
I removed the thanks (just the style here). Thanks is best expressed by upvoting helpful answers. –  qubyte May 19 '12 at 12:28

First of All, You can't nest $in $$. Therefore your formula should be like $$ \frac{(1-a)\frac{q_{f}}{{q_{n}}^a}}{p_{n}} \cdot q_{f} \cdot \Delta p $$ - Great, thanks!! – Abhimanyu Arora May 19 '12 at 12:41 Building on Hassan Zakeri's answer, you have two potential problems. As Hassan says, you can't nest. But it is also much better not to use $$ to start display maths. Here's a better solution: $\frac{(1-a)\frac{q_{f}}{{q_{n}}^a}}{p_{n}} \cdot q_{f} \cdot \Delta p$  For further explanation, please read this question and its answers: Why is [ … ] preferable to$\$?
{"extraction_info": {"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": 2, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "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, "math_score": 0.9788634777069092, "perplexity": 1786.3027508498017}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-27/segments/1435375098808.88/warc/CC-MAIN-20150627031818-00035-ip-10-179-60-89.ec2.internal.warc.gz"}