1Math::Symbolic::MiscCalUcsuelrusC(o3n)tributed Perl DocuMmaetnht:a:tSiyomnbolic::MiscCalculus(3)
2
3
4
6 Math::Symbolic::MiscCalculus - Miscellaneous calculus routines (eg Tay‐
7 lor poly)
8
10 use Math::Symbolic qw/:all/;
11 use Math::Symbolic::MiscCalculus qw/:all/; # not loaded by Math::Symbolic
12
13 $taylor_poly = TaylorPolynomial $function, $degree, $variable;
14 # or:
15 $taylor_poly = TaylorPolynomial $function, $degree, $variable, $pos;
16
17 $lagrange_error = TaylorErrorLagrange $function, $degree, $variable;
18 # or:
19 $lagrange_error = TaylorErrorLagrange $function, $degree, $variable, $pos;
20 # or:
21 $lagrange_error = TaylorErrorLagrange $function, $degree, $variable, $pos,
22 $name_for_range_variable;
23
24 # This has the same syntax variations as the Lagrange error:
25 $cauchy_error = TaylorErrorLagrange $function, $degree, $variable;
26
28 This module provides several subroutines related to calculus such as
29 computing Taylor polynomials and errors the associated errors from
30 Math::Symbolic trees.
31
32 Please note that the code herein may or may not be refactored into the
33 OO-interface of the Math::Symbolic module in the future.
34
35 EXPORT
36
37 None by default.
38
39 You may choose to have any of the following routines exported to the
40 calling namespace. ':all' tag exports all of the following:
41
42 TaylorPolynomial
43 TaylorErrorLagrange
44 TaylorErrorCauchy
45
47 TaylorPolynomial
48
49 This function (symbolically) computes the nth-degree Taylor Polynomial
50 of a given function. Generally speaking, the Taylor Polynomial is an
51 n-th degree polynomial that approximates the original function. It does
52 so particularily well in the proximity of a certain point x0. (Since
53 my mathematical English jargon is lacking, I strongly suggest you read
54 up on what this is in a book.)
55
56 Mathematically speaking, the Taylor Polynomial of the function f(x)
57 looks like this:
58
59 Tn(f, x, x0) =
60 sum_from_k=0_to_n(
61 n-th_total_derivative(f)(x0) / k! * (x-x0)^k
62 )
63
64 First argument to the subroutine must be the function to approximate.
65 It may be given either as a string to be parsed or as a valid
66 Math::Symbolic tree. Second argument must be an integer indicating to
67 which degree to approximate. The third argument is the last required
68 argument and denotes the variable to use for approximation either as a
69 string (name) or as a Math::Symbolic::Variable object. That's the 'x'
70 above. The fourth argument is optional and specifies the name of the
71 variable to introduce as the point of approximation. May also be a
72 variable object. It's the 'x0' above. If not specified, the name of
73 this variable will be assumed to be the name of the function variable
74 (the 'x') with '_0' appended.
75
76 This routine is for functions of one variable only. There is an equiva‐
77 lent for functions of two variables in the Math::Symbolic::VectorCalcu‐
78 lus package.
79
80 TaylorErrorLagrange
81
82 TaylorErrorLagrange computes and returns the formula for the Taylor
83 Polynomial's approximation error after Lagrange. (Again, my English
84 terminology is lacking.) It looks similar to this:
85
86 Rn(f, x, x0) =
87 n+1-th_total_derivative(f)( x0 + theta * (x-x0) ) / (n+1)! * (x-x0)^(n+1)
88
89 Please refer to your favourite book on the topic. 'theta' may be any
90 number between 0 and 1.
91
92 The calling conventions for TaylorErrorLagrange are similar to those of
93 TaylorPolynomial, but TaylorErrorLagrange takes an extra optional argu‐
94 ment specifying the name of 'theta'. If it isn't specified explicitly,
95 the variable will be named 'theta' as in the formula above.
96
97 TaylorErrorCauchy
98
99 TaylorErrorCauchy computes and returns the formula for the Taylor Poly‐
100 nomial's approximation error after (guess who!) Cauchy. (Again, my
101 English terminology is lacking.) It looks similar to this:
102
103 Rn(f, x, x0) = TaylorErrorLagrange(...) * (1 - theta)^n
104
105 Please refer to your favourite book on the topic and the documentation
106 for TaylorErrorLagrange. 'theta' may be any number between 0 and 1.
107
108 The calling conventions for TaylorErrorCauchy are identical to those of
109 TaylorErrorLagrange.
110
112 Please send feedback, bug reports, and support requests to the
113 Math::Symbolic support mailing list: math-symbolic-support at lists dot
114 sourceforge dot net. Please consider letting us know how you use
115 Math::Symbolic. Thank you.
116
117 If you're interested in helping with the development or extending the
118 module's functionality, please contact the developers' mailing list:
119 math-symbolic-develop at lists dot sourceforge dot net.
120
121 List of contributors:
122
123 Steffen Müller, symbolic-module at steffen-mueller dot net
124 Stray Toaster, mwk at users dot sourceforge dot net
125 Oliver Ebenhöh
126
128 New versions of this module can be found on http://steffen-mueller.net
129 or CPAN. The module development takes place on Sourceforge at
130 http://sourceforge.net/projects/math-symbolic/
131
132 Math::Symbolic
133
134
135
136perl v5.8.8 2008-02-22 Math::Symbolic::MiscCalculus(3)