Skip to content

Commit da0f5c4

Browse files
committed
minor fix
1 parent b5b6027 commit da0f5c4

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

chapters/maths.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ The full list of exponential and logarithmic functions, together with some handy
7070

7171
unction | Explanation
7272
------------ | -------------------------------------------------------
73-
`exp` | exponential $$e^x$
73+
`exp` | exponential $$e^x$$
7474
`exp2` | $$2^x$$
7575
`exp10` | $$10^x$$
7676
`expm1` | returns $$\exp(x) - 1$$ but more accurate for $$x \sim 0$$
@@ -79,7 +79,7 @@ unction | Explanation
7979
`log10` | $$\log_10~x$$
8080
`logn` | $$\log_n~x$$
8181
`log1p` | inverse of `expm1`
82-
`logabs` | $$\log(|x|)$$
82+
`logabs` | $$\log(\|x\|)$$
8383
`xlogy` | $$x \log(y)$$
8484
`xlog1py` | $$x \log(y+1)$$
8585
`logit` | $$\log(p/(1-p))$$
@@ -109,7 +109,7 @@ Function | Explanation | Derivatives | Tayl
109109
`sec` | $$1/\cos(x)$$ | $$\textrm{sec}(x)\tan(x)$$ | $$\sum_{n=0}\frac{2(2^{2n-1})B_n~x^{2n-1}}{(2n)!}$$
110110
`csc` | $$1/\sin(x)$$ | $$-\textrm{csc}(x)\textrm{cot}(x)$$ | $$\frac{1}{x}-\sum_{n=1}\frac{4^n~B_n~x^{2n-1}}{(2n)!}$$
111111

112-
Here the $B_n$ is the $n$th [Bernoulli number](https://en.wikipedia.org/wiki/Bernoulli_number), and $$E_n$$ is the $$n$$-th [Euler number](https://en.wikipedia.org/wiki/Euler_number).
112+
Here the $$B_n$$ is the $$n$$th [Bernoulli number](https://en.wikipedia.org/wiki/Bernoulli_number), and $$E_n$$ is the $$n$$-th [Euler number](https://en.wikipedia.org/wiki/Euler_number).
113113
The figure below shows the relationship between these trigonometric functions. This figure is inspired by a [wiki post](https://zh.wikipedia.org/wiki/%E5%8F%8C%E6%9B%B2%E5%87%BD%E6%95%B0).
114114
These functions also have corresponding inverse functions: `asin`, `acos`, `atan`, `acot`, `asec`, `acsc`. For example, if $$\sin(a) = b$$, then $$\textrm{asin}(b) = a$$.
115115

@@ -205,7 +205,7 @@ Bessel functions, first defined by the mathematician Daniel Bernoulli and then g
205205

206206
$$x^2y''+xy'+(x^2 - \alpha^2)y = 0.$$
207207

208-
The complex number $\alpha$ is called the "order" of the bessel function.
208+
The complex number $$\alpha$$ is called the "order" of the bessel function.
209209
Bessel functions are important for many problems in studying the wave propagation and static potentials, such as electromagnetic waves in a cylindrical waveguide.
210210
In solving cylindrical coordinate systems, Bessel functions of integer order or half integer order are often used.
211211

@@ -263,7 +263,7 @@ There are twelve Jacobi elliptic functions and `ellipj` we include here in Owl r
263263
On the other hand, the *Elliptic integrals* are initially used to find the perimeters of ellipses.
264264
A Elliptic integral function can be expressed in the form of:
265265
$$f(x)=\int_c^xR(t, \sqrt(P(t)))dt,$$
266-
where $R$ is a rational function of its two arguments, $$P$$ is a polynomial of degree 3 or 4 with no repeated roots, and $$c$$ is a constant.
266+
where $$R$$ is a rational function of its two arguments, $$P$$ is a polynomial of degree 3 or 4 with no repeated roots, and $$c$$ is a constant.
267267
An elliptic integral can be categorised as "complete" or "incomplete".
268268
The former one is function of a single argument, while the latter contains two arguments.
269269
Each elliptic integral can be transformed so that it contains integrals of rational functions and the three Legendre canonical forms, according to which the elliptic can be categorised into the first, second, and third kind.
@@ -296,7 +296,7 @@ For a positive integer n, the *Gamma function* is the factorial function:
296296

297297
$$\Gamma(n) = (n-1)!$$
298298

299-
For a complex numbers $z$ with a positive real part, the Gamma function is defined as:
299+
For a complex numbers $$z$$ with a positive real part, the Gamma function is defined as:
300300

301301
$$\Gamma(z) = \int_0^{\infty}x^{z-1}e^{-x}dx.$$
302302

@@ -342,7 +342,7 @@ Beta function is defined as:
342342

343343
$$B(x,y) = \int_0^1t^{x-1}(1-t)^{y-1}dt = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}$$
344344

345-
Here $\Gamma$ is the Gamma function, and similar to it, the Beta function has its "incomplete" version.
345+
Here $$\Gamma$$ is the Gamma function, and similar to it, the Beta function has its "incomplete" version.
346346
The incomplete Beta function extends this definition to:
347347

348348
$$B(x, a, b) = \int_0^xt^{a-1}(1-t)^{b-1}dt.$$
@@ -360,7 +360,7 @@ val x : float = 0.0166666666666666664
360360
val y : float = 0.0166666666666666664
361361
```
362362

363-
Another property is its symmetricity, which means $B(x,y) = B(y, x)$.
363+
Another property is its symmetricity, which means $$B(x,y) = B(y, x)$$.
364364

365365
```ocaml
366366
# let x = Maths.beta 3. 4.
@@ -377,10 +377,10 @@ It is also used in the analysis of the preferential attachment process, a type o
377377
The *Struve function* is defined as:
378378
$$H_v(x) = (z/2)^{v + 1} \sum_{n=0}^\infty \frac{(-1)^n (z/2)^{2n}}{\Gamma(n + \frac{3}{2}) \Gamma(n + v + \frac{3}{2})},$$
379379

380-
where $\Gamma$ is the Gamma function. $x$ must be positive unless $v$ is an integer.
380+
where $$\Gamma$$ is the Gamma function. $$x$$ must be positive unless $$v$$ is an integer.
381381
Struve functions are used across a wide variety of physics applications, such as water-wave problems and calculations in unsteady aerodynamics.
382382

383-
The Owl function `struve v x` returns the value of Struve function. The parameter $v$ is called the *order* of this function.
383+
The Owl function `struve v x` returns the value of Struve function. The parameter $$v$$ is called the *order* of this function.
384384
Here is an example that shows the curves of Struve functions with order from 0 to 4.
385385

386386
```ocaml
@@ -405,7 +405,7 @@ The *Hurwitz zeta function* `zeta x q` is defined as:
405405

406406
$$\zeta(x, q) = \sum_{k=0}^{\infty}\frac{1}{(k+q)^x}.$$
407407

408-
When $q$ is set to 1, this function is reduced to the *Riemann zeta function*.
408+
When $$q$$ is set to 1, this function is reduced to the *Riemann zeta function*.
409409
The function `zetac x` returns Riemann zeta function minus 1.
410410
The zeta function is often used to analyse the dynamic systems.
411411
Besides, the Riemann zeta function plays an important role in number theory and is widely applied in quantum physics, probability theory, and applied statistics, etc.
@@ -502,7 +502,7 @@ The factorial function, together with several of its variants, are contained in
502502

503503
Function |Explanation
504504
----------------- |-----------------------------------------------------------
505-
`fact n` |Factorial function $!n$
505+
`fact n` |Factorial function $$!n$$
506506
`log_fact n` |Logarithm of factorial function
507507
`doublefact n` |Double factorial function calculates $$n!! = n(n-2)(n-4)\dots 2$$ (or 1)
508508
`log_doublefact n` |Logarithm of double factorial function
@@ -517,7 +517,7 @@ The factorial functions accepts integer as input, for example:
517517
The factorials are applied in many areas of mathematics, most notably the combinatorics.
518518
The permutation and combination are both defined in factorials.
519519
The permutation function returns the number $$n!/(n-k)!$$ of ordered subsets of length $$k$$, taken from a set of $$n$$ elements.
520-
The combination function returns the number $${n\choose k} = n!/(k!(n-k)!)$$ of subsets of $$k$$ elements of a set of $n$ elements.
520+
The combination function returns the number $${n\choose k} = n!/(k!(n-k)!)$$ of subsets of $$k$$ elements of a set of $$n$$ elements.
521521
The table below provides the combinatorics functions you can use in the `Math` module.
522522

523523
Function Explanation
@@ -566,7 +566,7 @@ val x : float array = [|2.; 3.; 4.; 5.; 6.|]
566566
```
567567

568568
Now we can define the interpolation function `f` that accepts one float number and returns another float number.
569-
Also we convert the given data $x$ and $y$ into matrix format for plotting purpose.
569+
Also we convert the given data $$x$$ and $$y$$ into matrix format for plotting purpose.
570570

571571
```ocaml
572572
let f a =
@@ -596,7 +596,7 @@ let _ =
596596
## Integration
597597

598598
We have introduced some special integral functions, but we still need general integration methods that work for any input functions.
599-
Given a function $f$ that accepts a real variable and an interval $$[a, b]$$ of the real line, the integral of this function
599+
Given a function $$f$$ that accepts a real variable and an interval $$[a, b]$$ of the real line, the integral of this function
600600

601601
$$\int_a^bf(x)dx$$
602602

@@ -618,11 +618,11 @@ Using numerical methods (or *quadrature*) to do integration dates back to the in
618618
The basic idea is to use summation of small areas to approximate that of an integration.
619619
There exist a lot of algorithms to do numerical integration, and using the trapezoial rule is one of them.
620620

621-
This classical method divides `a` to `b` into $N$ equally spaced abscissas: $$x_0, x_1, \ldots, x_N$$. Each area between $$x_i$$ and $$x_j$$ is seen as an "Trapezoid" and the area formula is computed as:
621+
This classical method divides `a` to `b` into $$N$$ equally spaced abscissas: $$x_0, x_1, \ldots, x_N$$. Each area between $$x_i$$ and $$x_j$$ is seen as an "Trapezoid" and the area formula is computed as:
622622

623623
$$\int_{x_0}^{x_1}f(x)dx = h(\frac{f(x_0)}{2} + \frac{f(x_1)}{2}) + O(h^3f'').$$
624624

625-
Here the error term $O(h^3f'')$ indicated that the error of approximation is related with that of abscissas size $h$ and second order derivative of the original function.
625+
Here the error term $$O(h^3f'')$$ indicated that the error of approximation is related with that of abscissas size $$h$$ and second order derivative of the original function.
626626
The function `trapz` implements this method. It's interface is:
627627

628628
```
@@ -667,7 +667,7 @@ This function is deterministic for all numbers representable by an int. It is im
667667
```
668668

669669
Another number theory related idea is the *Fermat's factorization*, which represents an odd integer as the difference of two squares: $$N = a^2 - b^2$$, and therefore `N` can be factorised as $$(a+b)(a-b)$$.
670-
The function `fermat_fact` performs Fermat factorisation over odd number `N`, i.e. into two roughly equal factors $x$ and $y$ so that $$N=x\times~y$$.
670+
The function `fermat_fact` performs Fermat factorisation over odd number `N`, i.e. into two roughly equal factors $$x$$ and $$y$$ so that $$N=x\times~y$$.
671671

672672
```ocaml
673673
# Maths.fermat_fact 6557

0 commit comments

Comments
 (0)