Tool to calculate series expansions (Taylor, etc.) allowing an approximation of a mathematical function or expression.
Series Expansion - dCode
Tag(s) : Functions
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
In mathematics, a series expansion of a function in the vicinity of a defined point is a polynomial expression allowing an approximation of this function. The limited expansion is therefore composed of a polynomial function (sum of polynomials) and a remainder which is small (or negligible) around the point.
To compute a (limited) series expansion of order $ n $ of a function $ f(x) $ in the neighborhood of a value $ a $, if the function is differentiable in $ a $, then it is possible to use the Taylor-Young formula which decomposes any function into:
$$ f(x) = f(a) + \frac{f'(a)}{1!}(x-a) + \frac{f^{(2)}(a)}{2!}(x-a)^2 + \cdots + \frac{f^{(n)}(a)}{n!}(x-a)^{n} + O(x^{n+1}) \\ = \sum_{k=0}^{n} \frac{f^{(k)}(a)}{k!}(x-a)^{k} + O(x^{n+1}) $$
with $ O(x^n) $ the Big O (Landau's asymptotic notation) indicating precision, a value tending to be negligible with respect to $ (x-a)^n $ in the neighborhood of $ a $.
Example: The exponential function (having an nth derivative easy to calculate) has a limited series expansion in $ 0 $: $ \exp(x) = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots + \frac{x^n}{n!} + O(x^n) $$
Here is a form of the usual Taylor/Maclaurin series to know:
— Exponential function (exp) and logarithm functions (ln or log):
$$ \begin{aligned} \exp(x) &= \sum_{n=0}^{\infty} \frac{x^n}{n!} \\ &= 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots + \frac{x^n}{n!} + O(x^n+1) \\ \ln(1-x) &= -\sum_{n=1}^{\infty} \frac{x^n}{n} \\ &= -x- \frac{x^2}{2} - \frac{x^3}{3} - \cdots - \frac{x^n}{n} + O(x^n+1) \\ \ln(1+x) &= \sum_{n=1}^{\infty} (-1)^{n+1} \frac{x^n}{n} \\ &= x - \frac{x^2}{2} + \frac{x^3}{3} - \cdots + (-1)^{n+1} \frac{x^n}{n} + O(x^n+1) \end{aligned} $$
— Power and root functions (sqrt):
$$ \begin{aligned} (1+x)^a &= \sum_{n=0}^{\infty}\binom{a}{n} x^n \\ &= \sum_{n=0}^{\infty} x^n \prod _{k=1}^{n}{\frac {\alpha -k+1}{k}} \\ &= 1 + ax + \frac{a(a-1)}{2!}x^2 + \frac{a(a-1)(a-2)}{3!}x^3 + \cdots + \frac{a(a-1)(a-2)\cdots(a-n+1)}{n!}x^n + O(x^n+1) \\ (1+x)^{1/2} &= \sqrt{1+x} \\ &= 1 + \frac{1}{2}x - \frac{1}{8}x^2 + \frac{1}{16}x^3 - \frac{5}{128}x^4 + \frac{7}{256}x^5 + \cdots \\ (1+x)^{-1/2} &= \frac{1}{\sqrt{1+x}} \\ &= 1 -\frac{1}{2}x + \frac{3}{8}x^2 - \frac{5}{16}x^3 + \frac{35}{128}x^4 - \frac{63}{256}x^5 + \cdots \end{aligned} $$
$$ \begin{aligned} \frac{1}{1+x} &= \sum_{n=0}^{\infty} (-1)^n x^n \\ &= 1 - x + x^2 - x^3 + \cdots + (-1)^n x^n + O(x^n) \\ \frac{1}{(1+x)^2} &= \sum_{n=0}^{\infty} (-1)^n nx^{n-1} \\ &= 1 - 2x + 3x^2 - \cdots + (-1)^n nx^{n-1} + O(x^n) \\ \frac{1}{1-x} &= \sum_{n=0}^{\infty} x^{n} \\ &= 1 + x + x^2 + \cdots + x^n + O(x^n) \\ \frac{1}{(1-x)^2} &= \sum_{n=1}^{\infty} nx^{n-1} \\ &= 1 + 2x + 3x^2 + \cdots + nx^{n-1} + O(x^n) \end{aligned} $$
— Trigonometric functions (cosine, sine, tangent)
$$ \begin{aligned} \cos(x) &= \sum^{\infty}_{n=0} \frac{(-1)^n}{(2n)!} x^{2n} \\ &= 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots + \frac{(-1)^n}{(2n)!} x^{2n} + O(x^{2n+1}) \\ \sin(x) &= \sum^{\infty}_{n=0} \frac{(-1)^n}{(2n+1)!} x^{2n+1} \\ &= x - \frac{x^3}{3!} + \frac{x^{5}}{5!} - \cdots + \frac{(-1)^n}{(2n+1)!} x^{2n+1} + O(x^{2n+2}) \\ \tan(x) &= \sum^{\infty}_{n=1} \frac{B_{2n} (-4)^n (1-4^n)}{(2n)!} x^{2n-1} \\ &= x + \frac{x^3}{3} + \frac{2x^5}{15} + \frac{17x^7}{315} + \cdots + \frac{B_{2n}(-4)^n(1-4^n)}{(2n)!} x^{2n-1} + O(x^{2n}) \\ \sec(x) &= \sum^{\infty}_{n=0} \frac{(-1)^n E_{2n}}{(2n)!} x^{2n} \\ &= 1 + \frac{x^2}{2} + \frac{5x^4}{24} + \cdots + \frac{(-1)^n E_{2n}}{(2n)!} x^{2n} + O(x^{2n+1}) \end{aligned} $$
with $ E_n $ the Euler numbers.
— Complementary and reciprocal trigonometric functions
$$ \begin{aligned} \arccos(x) &= \frac{\pi}{2} - \sum^{\infty}_{n=0} \frac{(2n)!}{4^n (n!)^2 (2n+1)} x^{2n+1} \\ &= \frac{\pi}{2} - x - \frac{x^3}{2 imes 3} - \frac{1 \times 3 \times x^5}{2 \times 4 \times 5} - \cdots - \frac{1 \times 3 \times 5 \cdots (2n-1)x^{2n+1}}{2 \times 4 \times 6 \cdots (2n) \times (2n+1)} + O(x^{2n+2}) \\ \arcsin(x) &= \sum^{\infty}_{n=0} \frac{(2n)!}{4^n (n!)^2 (2n+1)} x^{2n+1} \\ &= x + \frac{x^3}{2 \times 3} + \frac{1 \times 3 \times x^5}{2 \times 4 \times 5} + \cdots + \frac{1 \times 3 imes 5 \cdots (2n-1)x^{2n+1}}{2 \times 4 \times 6 \cdots (2n) \times (2n+1)} + O(x^{2n+2}) \\ \arctan(x) &= \sum^{\infty}_{n=0} (-1)^{n}\frac{x^{2n+1}}{2n+1} \\ &= x - \frac{x^3}{3} + \frac{x^5}{5} - \cdots + (-1)^{n}\frac{x^{2n+1}}{2n+1} + O(x^{2n+2}) \end{aligned} $$
— Hyperbolic and reciprocal trigonometric functions
$$ \begin{aligned} \cosh(x) &= \sum^{\infty}_{n=0} \frac{x^{2n}}{(2n)!} \\ &= 1 + \frac{x^2}{2!} + \frac{x^4}{4!} + \cdots + \frac{x^{2n}}{(2n)!} + O(x^{2n+1}) \\ \sinh(x) &= \sum^{\infty}_{n=0} \frac{x^{2n+1}}{(2n+1)!} \\ &= x + \frac{x^3}{3!} + \frac{x^5}{5!} + \cdots + \frac{x^{2n+1}}{(2n+1)!} + O(x^{2n+2}) \\ \tanh(x) &= \sum^{\infty}_{n=1} \frac{B_{2n} 4^n \left(4^n-1\right)}{(2n)!} x^{2n-1} \\ &= x - \frac{x^3}{3} + \frac{2x^5}{15} - \frac{17x^7}{315} + \cdots + \frac{B_{2n} 4^n (4^{n}-1)}{(2n)!} x^{2n-1} + O(x^{2n}) \\ \operatorname{asinh}(x) &= \sum^{\infty}_{n=0} \frac{(-1)^n (2n)!}{4^n (n!)^2 (2n+1)} x^{2n+1} \\ &= x - \frac{x^3}{2 \times 3} + \cdots +(-1)^{n} \frac{1 \times 3 \times 5 \cdots (2n-1)x^{2n+1}}{2 \times 4 \times 6 \cdots (2n) \times (2n+1)} + O(x^{2n+2}) \\ \operatorname{atanh}(x) &= \sum^{\infty}_{n=0} \frac{x^{2n+1}}{2n+1} \\ &= x + \frac{x^3}{3} + \cdots + \frac{x^{2n+1}}{2n+1} + O(x^{2n+2}) \end{aligned} $$
with $ B_n $ the Bernoulli numbers
dCode retains ownership of the "Series Expansion" source code. Except explicit open source licence (indicated Creative Commons / free), the "Series Expansion" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or the "Series Expansion" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Series Expansion" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!
Reminder : dCode is free to use.
The copy-paste of the page "Series Expansion" or any of its results, is allowed (even for commercial purposes) as long as you credit dCode!
Exporting results as a .csv or .txt file is free by clicking on the export icon
Cite as source (bibliography):
Series Expansion on dCode.fr [online website], retrieved on 2024-11-21,