What is wrong with LaTeX in these math equations?

chip

Forum Staff
Aug 2013
42
25
Washington
One of the things I'm working on is adding more libraries to MathJax. During my testing, I have found some equations to not render correctly.

Looking for some assistance from those who know LaTeX and what is wrong with the following equations to cause them to not render?

Math Equation A:

Code:
[MATH]\frac{1}{2}\cdot  \frac{\;\dfrac{(1+\sqrt{5})^n}{(1+\sqrt{5})^{n-1}} -\dfrac{1-\sqrt{5})^n}{(1+\sqrt{5})^{n-1}}\;} { \dfrac{(1+\sqrt{5})^{n-1}}{(1+\sqrt{5})^{n-1}} - \dfrac{(1-\sqrt{5})^{n-1}}{(1+\sqrt{5})^{n-1}}} \;=\; \frac{1}{2}\cdot\frac{(1 + \sqrt{5}) - (1-\sqrt{5})\left(\dfrac{1-\sqrt{5}}{1+\sqrt{5}}\right)^{n-1}} {1 - \left(\dfrac{1-\sqrt{5}}{1+\sqrt{5}}\right)^{n-1}}}[/MATH]
Math Equation B:

Code:
[MATH]\lim_{n\to\infty}\frac{F_n}{F_{n-1}} \;=\;\lim_{n\to\infty} \frac{1}{2}\cdot\frac{(1 + \sqrt{5}) - (1-\sqrt{5})\left(\dfrac{1-\sqrt{5}}{1+\sqrt{5}}\right)^{n-1}} {1 - \left(\dfrac{1-\sqrt{5}}{1+\sqrt{5}}\right)^{n-1}}}[/MATH]
Here, you can see the output for the two above equations:

\(\displaystyle \frac{1}{2}\cdot \frac{\;\dfrac{(1+\sqrt{5})^n}{(1+\sqrt{5})^{n-1}} -\dfrac{1-\sqrt{5})^n}{(1+\sqrt{5})^{n-1}}\;} { \dfrac{(1+\sqrt{5})^{n-1}}{(1+\sqrt{5})^{n-1}} - \dfrac{(1-\sqrt{5})^{n-1}}{(1+\sqrt{5})^{n-1}}} \;=\; \frac{1}{2}\cdot\frac{(1 + \sqrt{5}) - (1-\sqrt{5})\left(\dfrac{1-\sqrt{5}}{1+\sqrt{5}}\right)^{n-1}} {1 - \left(\dfrac{1-\sqrt{5}}{1+\sqrt{5}}\right)^{n-1}}}\)

\(\displaystyle \lim_{n\to\infty}\frac{F_n}{F_{n-1}} \;=\;\lim_{n\to\infty} \frac{1}{2}\cdot\frac{(1 + \sqrt{5}) - (1-\sqrt{5})\left(\dfrac{1-\sqrt{5}}{1+\sqrt{5}}\right)^{n-1}} {1 - \left(\dfrac{1-\sqrt{5}}{1+\sqrt{5}}\right)^{n-1}}}\)

Thanks in advance.
 

romsek

MHF Helper
Nov 2013
6,647
2,994
California
A bunch of \dfracs are missing closing }'s
 
  • Like
Reactions: chip

chip

Forum Staff
Aug 2013
42
25
Washington
Ok, that makes sense.

I was trying to debug the dfracs command, and thought it reached some sort of upper limit...

Thank you for the explanation.
 

Plato

MHF Helper
Aug 2006
22,462
8,633
MathType 7 documentation
One of the things I'm working on is adding more libraries to MathJax. During my testing, I have found some equations to not render correctly.

Looking for some assistance from those who know LaTeX and what is wrong with the following equations to cause them to not render?

Math Equation A:

Code:
[MATH]\frac{1}{2}\cdot  \frac{\;\dfrac{(1+\sqrt{5})^n}{(1+\sqrt{5})^{n-1}} -\dfrac{1-\sqrt{5})^n}{(1+\sqrt{5})^{n-1}}\;} { \dfrac{(1+\sqrt{5})^{n-1}}{(1+\sqrt{5})^{n-1}} - \dfrac{(1-\sqrt{5})^{n-1}}{(1+\sqrt{5})^{n-1}}} \;=\; \frac{1}{2}\cdot\frac{(1 + \sqrt{5}) - (1-\sqrt{5})\left(\dfrac{1-\sqrt{5}}{1+\sqrt{5}}\right)^{n-1}} {1 - \left(\dfrac{1-\sqrt{5}}{1+\sqrt{5}}\right)^{n-1}}}[/MATH]
Math Equation B:

Code:
[MATH]\lim_{n\to\infty}\frac{F_n}{F_{n-1}} \;=\;\lim_{n\to\infty} \frac{1}{2}\cdot\frac{(1 + \sqrt{5}) - (1-\sqrt{5})\left(\dfrac{1-\sqrt{5}}{1+\sqrt{5}}\right)^{n-1}} {1 - \left(\dfrac{1-\sqrt{5}}{1+\sqrt{5}}\right)^{n-1}}}[/MATH]
Here, you can see the output for the two above equations:

\(\displaystyle \frac{1}{2}\cdot \frac{\;\dfrac{(1+\sqrt{5})^n}{(1+\sqrt{5})^{n-1}} -\dfrac{1-\sqrt{5})^n}{(1+\sqrt{5})^{n-1}}\;} { \dfrac{(1+\sqrt{5})^{n-1}}{(1+\sqrt{5})^{n-1}} - \dfrac{(1-\sqrt{5})^{n-1}}{(1+\sqrt{5})^{n-1}}} \;=\; \frac{1}{2}\cdot\frac{(1 + \sqrt{5}) - (1-\sqrt{5})\left(\dfrac{1-\sqrt{5}}{1+\sqrt{5}}\right)^{n-1}} {1 - \left(\dfrac{1-\sqrt{5}}{1+\sqrt{5}}\right)^{n-1}}}\)

\(\displaystyle \lim_{n\to\infty}\frac{F_n}{F_{n-1}} \;=\;\lim_{n\to\infty} \frac{1}{2}\cdot\frac{(1 + \sqrt{5}) - (1-\sqrt{5})\left(\dfrac{1-\sqrt{5}}{1+\sqrt{5}}\right)^{n-1}} {1 - \left(\dfrac{1-\sqrt{5}}{1+\sqrt{5}}\right)^{n-1}}}\)
Comment 1. those are just too damn long.
Whenever I use \dfrac{}{}. I always type an complete empty form then go back and fill it in. For every left{ there must be a right}.
If you need long strings I strongly suggest spring for a copy of MathType. I have used it for twenty years. It even has a translator for this forum.
 
  • Like
Reactions: topsquark and chip

topsquark

Forum Staff
Jan 2006
11,552
3,443
Wellsville, NY
I agree with Plato. Code that long requires some kind of assistance. I've never used Math Type (though I've heard good things about it)... I use CodeCogs. It will even save a gif of the equation that you can download. (Not just link to the site.)

-Dan
 
  • Like
Reactions: chip

romsek

MHF Helper
Nov 2013
6,647
2,994
California
I can't say I agree that assistance is needed. I do agree with Plato's second statement that empty forms should be typed out first then filled in.
It took me some months of debugging to come to this conclusion and now I just live by it.

If I was going to LaTeX an entire thesis or even just a paper for publication yes, I'd probably use some sort of software but for just answering questions here
plain old typing and being careful seems more than enough.
 
  • Like
Reactions: topsquark and chip