The <la-tex> tag is a container for LaTeX
expressions. The source is automatically converted into MathML
using TeXZilla and
the mathematical formula is displayed by your rendering engine. In
particular, you need a standard-compliant HTML5 rendering engine as
well as appropriate math fonts in order to get a good rendering.
You can use the <la-tex> tag to write inline
mathematical expressions such as
\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1. The
<la-tex> tag accepts the display and
dir attributes of the
math
element. For instance you can write
<la-tex display="block">
to insert display mathematical expressions such as
or <la-tex display="rtl"> to write right-to-left
mathematical expressions such as
س = \frac{-ب\pm\sqrt{ب^٢-٤اج}}{٢ا}. Note
that the previous expression uses Arabic characters. In general you
can use any Unicode characters in the LaTeX source: for example
<la-tex>∑_{n=1}^{+∞} \frac{1}{n^2} = \frac{π^2}{6}</la-tex> will render as
∑_{n=1}^{+∞} \frac{1}{n^2} = \frac{π^2}{6}. If a parsing
error occurs, then the original LaTeX source is displayed:
\gamma + \frac{x}.
Just like the <math> tag, the <la-tex> tag can
be used in other languages from the HTML5 family as shown below.
Note that clicking on the HTML button below
will retrieve the original LaTeX source, via the .textContent
property of the <la-tex> element.
Finally, the <la-tex> tag will react to dynamic changes, as shown
in the following example where we use Javascript to modify the
display and
dir attributes of the <la-tex> tag or
to set its .textContent property.
;
;
\sqrt 2
Sample Document using <la-tex>
Copyright
Copyright (C) 2013 Frédéric Wang
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
Basic Integration
Ideas
If F is a primitive of f then \int_{a}^b f(x) d x = F(b) - F(a),
provided the integrand and integral have no singularities on the path of
integration. As a consequence, we can use a table of derivatives:
\int_{\frac{\pi}{6}}^{\frac{\pi}{3}}
\tan\left(\frac{\theta}{2}\right) \frac{{(1 + \cos \theta)}^2}{\sin^3 \theta} d \theta
We do the substitution t = \tan\left(\frac{\theta}{2}\right). We have
d \theta = \frac{2 dt}{1+t^2}, \cos \theta = \frac{1-t^2}{1+t^2} and
\sin \theta = \frac{2t}{1+t^2}. Also, we have
We consider f(x) = x^2 + x + 1 and g(x) = \frac{e^{-3x}}{-3} that is
f'(x) = 2x+1 and g'(x) = e^{-3x}. The integral
can be written \int f g' dx and hence we get
\left[(x^2 + x + 1) \frac{e^{-3x}}{-3}\right]_{0}^{+\infty} -
\int_{0}^{+\infty}
(2x+1) \frac{e^{-3x}}{-3}
d x = \frac{1}{3} + \frac{1}{3}
\int_{0}^{+\infty}
(2x+1) e^{-3x}
d x
We now consider h(x) = 2x+1, h'(x)=2 the second integral can be written
\int h g' dx and hence
\int_{0}^{+\infty}
(2x+1) e^{-3x}
d x
= \left[(2x + 1) \frac{e^{-3x}}{-3}\right]_{0}^{+\infty} -
\int_{0}^{+\infty}
2 \frac{e^{-3x}}{-3}
d x = \frac{1}{3} + \frac{2}{3}
\int_{0}^{+\infty} e^{-3x} d x
We now recognize g' in the last integral and so
\int_{0}^{+\infty} e^{-3x} d x =
\left[ \frac{e^{-3x}}{-3}\right]_{0}^{+\infty} = \frac{1}{3}
Finally,
\int_{0}^{+\infty} (x^2 + x + 1) e^{-3x} d x =
\frac{1}{3} + \frac{1}{3} \times \left(
\frac{1}{3} + \frac{2}{3} \times \frac{1}{3}
\right) = \frac{14}{27}
Example 2
\int_1^2
x^3 (2\ln x + 7\arctan x) d x
We let f(x) = 2\ln x + 7\arctan x and g(x) = \frac{x^3}{3}. Hence
f'(x) = \frac{2}{x} + \frac{7}{1+x^2} and g'(x) = x^3. The integration
by parts gives:
\left[\frac{x^3}{3} \left(2\ln x + 7\arctan x\right) \right]_1^2 -
\int_1^2
\frac{x^3}{3} \left(\frac{2}{x} + \frac{7}{1+x^2}\right) d x
\int_{u=1}^{5} \frac{2u^4-5u^3+24u^2-26u+50}{u^5-4u^4+14u^3-20u^2+25u} d u
The denominator can be written
u^5-4u^4+14u^3-20u^2+25u = u(u^4-4u^3+14u^2-20u+25). Evaluating the
second factor at 0, \pm1, \pm2 we don't find any trivial roots. Hence we try
to convert it to a depressed quartic by setting u = v - \frac{-4}{4} = v + 1.
We find (u^4-4u^3+14u^2-20u+25) = v^4 + 8v^2 + 16 = (v^2 + 4)^2 = (u^2-2u+5)^2.
The discriminant of u^2-2u+5 is 4(1-5) < 0 so we have the decomposition
in irreducible factors:
u^5-4u^4+14u^3-20u^2+25u = u (u^2-2u+5)^2
We now try to find A, B, C, D, E \in \mathbb{R} such that
\int_{t=2}^{17} t^2-4t+5 d t =
{\left[\frac{t^3}{3} - 2t^2 + 5t\right]}_{t=2}^{17} = 1140
First we search trivial roots for the denominator.
If we evaluate t^4+2t^3-t-2 at t=0,-1,1,-2,2 we find respectively
-2, -2, 0, 0, 28. So we can factor X^4+2X^4-X-2 by (X - 1)(X + 2). We get
X^4+2X^3-X-2 = (X - 1)(X + 2)(X^2+X+1)
The polynomial X^2+X+1 is irreducible on \mathbb{R} because its
discrimant is 1 - 4 = -3 < 0. Hence we search a decomposition of
Write z = e^{i \theta}, d z = i z d \theta. The integral becomes
\oint_{\gamma} \frac{3 (z^2 + z^{-2})}{-2 i (z - z^{-1}) - 5} \frac{d z}{i z} =
\oint_{\gamma} \frac{3(z^4+1)}{2 z^2 (z - 2 i)\left(z - \frac{i}{2}\right)} d z
where \gamma is the unit circle traversed counterclockwise.
f : z \mapsto \frac{3(z^4+1)}{2 z^2 (z - 2 i)\left(z - \frac{i}{2}\right)}
has two
singularities inside that circle: 0 and \frac{i}{2}.
Hence the integral is the 2 \pi i times the sum
of the residues of f at these points:
We note that x \mapsto \Im(f(x)) is the integrand above. We also note that
the
poles of f are z^\pm = -1 \pm 2 i. By choosing the right contour, one can
show that