LaTeX code for the most common formulas

From GeoGebra Manual
Revision as of 20:59, 25 December 2019 by Liliana M CB (talk | contribs)
Jump to: navigation, search

If you have somewhere a very long formula, please share it with us. This will save time for everybody! Just edit this page and paste you code at inside the input-box, if you don't know how to use the wiki-code correctly.

How to use the formulas

Just copy the text from the column LaTex Input into your text-object input-box. If the formula should be dynamic you need to insert the object instead of the variables that are used here.

Preview

Check how they look in Java in Java and HTML5

Useful Formulas

Usage LaTex Input LaTex Output
Square-root symbol \sqrt{x} \mathrm{\mathsf{ \sqrt{x} }}
Fractions \frac{a}{b+c} \mathrm{\mathsf{ \frac{a}{b+c} }}
\left( and \right) for large brackets \left( \frac{a}{b} \right) ^{2} \mathrm{\mathsf{ \left( \frac{a}{b} \right) ^{2} }}
Use \textcolor for color x^{\textcolor{#FF00FF}{2}}
Use \cr for a line break x=3 \cr y=2 \mathrm{\mathsf{ \begin{array} x=3 \\ y=2 \end{array} }}
Use \text{ } to mix text and expressions \text{Roots of }ax^2 + bx + c= 0\text{ are }x = \frac {-b \pm \sqrt {b^2 - 4ac}}{2a} \mathrm{\mathsf{ \text{Roots of }ax^2 + bx + c= 0 \text{ are } }}
\mathrm{\mathsf{ x = \frac {-b \pm \sqrt {b^2 - 4ac}}{2a} }}
Slope for a straight line m=\frac{y_2-y_1}{x_2-x_1} \mathrm{\mathsf{ m=\frac{y_2-y_1}{x_2-x_1} }}
Slope for a straight line (2) m= \frac{Δy}{Δx}=\frac{y_A-y_B}{x_A-x_B} \mathrm{\mathsf{ m= \frac{Δy}{Δx}=\frac{y_A-y_B}{x_A-x_B} }}
Compound Interest Amount = Principal \cdot \left( 1 + \frac {rate}{periods} \right) ^ {time \cdot periods} \mathrm{\mathsf{ Amount = Principal \cdot \left( 1 + \frac {rate}{periods} \right) ^ {time \cdot periods} }}
Quadratic Equation a x^2 + b x + c = 0 \mathrm{\mathsf{ a x^2 + b x + c = 0 }}
Simplified Quadratic Equation x^2 + p x + q = 0 \mathrm{\mathsf{ x^2 + p x + q = 0 }}
Vertex Form f(x) = a(x - h)^2 + k \mathrm{\mathsf{ f(x) = a(x - h)^2 + k }}
Factored Form f(x) = (x + a)(x + b) \mathrm{\mathsf{ f(x) = (x + a)(x + b) }}
Quadratic Formula x = \frac {-b \pm \sqrt {b^2 - 4ac}}{2a} \mathrm{\mathsf{ x = \frac {-b \pm \sqrt {b^2 - 4ac}}{2a} }}
Quadratic Formula x_{1/2} = \frac {-b \pm \sqrt {b^2 - 4ac}}{2a} \mathrm{\mathsf{ x_{1/2} = \frac {-b \pm \sqrt {b^2 - 4ac}}{2a} }}
Quadratic Formula for Simplified Quadratic Equation x_{1/2} = - \frac{p}{2}{ \pm \sqrt {\left( \frac{p}{2} \right)^2 - q}} \mathrm{\mathsf{ x_{1/2} = - \frac{p}{2}{ \pm \sqrt {\left( \frac{p}{2} \right)^2 - q}} }}
Quadratic Formula for Simplified Quadratic Equation x_{1/2} = - \frac{p}{2}{ \pm \sqrt {\left( \frac{p}{2} \right)^2 - q}} \mathrm{\mathsf{ x_{1/2} = - \frac{p}{2}{ \pm \sqrt { \frac{p^2}{4} - q}} }}
Cubic Equation a x^3 + b x^2 + c x + d = 0 \mathrm{\mathsf{ a x^3 + b x^2 + c x + d = 0 }}
Basic Trigonometry Forms \sin A = \frac {opp}{hyp} = \frac {a}{c} = (a/c) \mathrm{\mathsf{ \sin A = \frac {opp}{hyp} = \frac {a}{c} = (a/c) }}
f(x) = a \sin b (x - h) + k \mathrm{\mathsf{ f(x) = a \sin b (x - h) + k }}
f(x) = a sin (B x + C) + k \mathrm{\mathsf{ f(x) = a \sin (B x + C) + k }}
b (x - h) = B \left( x - \frac {-C}{B} \right) \mathrm{\mathsf{ b (x - h) = B \left( x - \frac {-C}{B} \right) }}
h = \frac {-C}{B} \mathrm{\mathsf{ h = \frac {-C}{B} }}
Limit (corrected to work in HTML5 as well as Java) \lim_{x \to \infty} \left( \frac{1}{x} \right) \mathrm{\mathsf{ \lim_{x \to \infty} \left( \frac{1}{x} \right) }}
Distance Formula \sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2} \mathrm{\mathsf{ \sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2} }}

Text formatting

Usage LaTex Input LaTex Output
Text with spacing \text{some words with spaces} \mathrm{\mathsf{ \text{some words with spaces} }}
Italic text \mathit{italic text} \mathrm{\mathsf{ \mathit{italic text} }}
Bold text \mathbf{bold text} \mathrm{\mathsf{ \mathbf{bold text} }}
© 2020 International GeoGebra Institute