#1: " ----------[ D e r i v e ]---------- " User #2: " ---------- Initialization ---------- " User #3: " ---------- Series ---------- " User User #4: " Taylor series---this first example comes from special relativity " User #5: " => 1 + 1/2 (v/c)^2 + 3/8 (v/c)^4 + 5/16 (v/c)^6 + O((v/c)^8) " 1 q1_ := ------------------ #6: / / v \2\ User SQRT|1 - |---| | \ \ c / / #7: q2_ := TAYLOR(q1_, v, 0, 7) User #8: q2_ User 2 4 6 v 3*v 5*v #9: ------ + ------ + ------- + 1 Simp(#8) 2 4 6 2*c 8*c 16*c / 1 \ TAYLOR|------, v, 0, 7| #10: | 2 | User \ q2_ / 2 v #11: 1 - ---- Simp(#10) 2 c User #12: " Note: sin(x) = x - x^3/6 + x^5/120 - x^7/5040 + O(x^9) " #13: " cos(x) = 1 - x^2/2 + x^4/24 - x^6/720 + O(x^8) "User User #14: " tan(x) = x + x^3/3 + 2/15 x^5 + 17/315 x^7 + O(x^9) " #15: tsin := TAYLOR(SIN(x), x, 0, 7) User #16: tsin User 7 5 3 x x x #17: - ------ + ----- - ---- + x Simp(#16) 5040 120 6 #18: tcos := TAYLOR(COS(x), x, 0, 7) User #19: tcos User 6 4 2 x x x #20: - ----- + ---- - ---- + 1 Simp(#19) 720 24 2 User #21: " Note that additional terms will be computed as needed " / tsin \ #22: TAYLOR|------, x, 0, 7| User \ tcos / 7 5 3 17*x 2*x x #23: ------- + ------ + ---- + x Simp(#22) 315 15 3 #24: TAYLOR(TAN(x), x, 0, 7) User 7 5 3 17*x 2*x x #25: ------- + ------ + ---- + x Simp(#24) 315 15 3 #26: tsin := User #27: tcos := User #28: " => -x^2/6 - x^4/180 - x^6/2835 - O(x^8) " User / / SIN(x) \ \ #29: TAYLOR|LOG|--------|, x, 0, 7| User \ \ x / / 6 4 2 x x x #30: - ------ - ----- - ---- Simp(#29) 2835 180 6 / SIN(x) \ #31: q_ := TAYLOR|--------, x, 0, 7| User \ x / #32: q_ User 6 4 2 x x x #33: - ------ + ----- - ---- + 1 Simp(#32) 5040 120 6 #34: TAYLOR(LOG(q_), x, 0, 7) User 6 4 2 x x x #35: - ------ - ----- - ---- Simp(#34) 2835 180 6 User #36: " => [a f'(a d) + g(b d) + integrate(h(c y), y = 0..d)] " #37: " + [a^2 f''(a d) + b g'(b d) + h(c d)] (x - d) " User #38: F(x) := User #39: G(x) := User #40: H(x) := User x d / #41: q_ := -- F(a*x) + G(b*x) + / H(c*y) dy User dx 0 #42: TAYLOR(q_, x, d, 1) User Simp(#42) d / 2 #43: G(b*d) + (x - d)*H(c*d) + / H(c*y) dy + a *(x - d)*F''(a*d) + 0 a*F'(a*d) + b*(x - d)*G'(b*d) #44: f := User #45: g := User #46: h := User User #47: " Taylor series of nonscalar objects (noncommutative multiplication) " #48: " => (B A - A B) t^2/2 + O(t^3) [Stanly Steinberg] " User #49: a :epsilon Nonscalar User #50: a Simp(#49) #51: b :epsilon Nonscalar User #52: b Simp(#51) (a + b)*t a*t b*t #53: #e - #e *#e User #54: 0 Simp(#53) (a + b)*t a*t b*t #55: TAYLOR(#e - #e *#e , t, 0, 4) User #56: 0 Simp(#55) #57: a := User #58: b := User #59: " Laurent series: " User #60: " => sum( Bernoulli[k]/k! x^(k - 2), k = 1..infinity ) "User User #61: " = 1/x^2 - 1/(2 x) + 1/12 - x^2/720 + x^4/30240 + O(x^6) " #62: " [Levinson and Redheffer, p. 173] " User / 1 \ #63: TAYLOR|----------------, x, 0, 6| User \ x*(EXP(x) - 1) / #64: ? Simp(#63) / / x \ \ | TAYLOR|------------, x, 0, 6| | | \ EXP(x) - 1 / | #65: EXPAND|-------------------------------| User | 2 | \ x / 4 2 x x 1 1 1 #66: ------- - ----- - ----- + ---- + ---- Simp(#65) 30240 720 2*x 2 12 x #67: " Puiseux series (terms with fractional degree): " User User #68: " => 1/sqrt(x - 3/2 pi) + (x - 3/2 pi)^(3/2) / 12 + O([x - 3/2 pi]^(7/2)) " / 3 \ #69: TAYLOR|SQRT(SEC(x)), x, ---*pi, 4| User \ 2 / #70: ? Simp(#69) User #71: " Generalized Taylor series => sum( [x log x]^k/k!, k = 0..infinity ) " x #72: TAYLOR(x , x, 0, 3) User #73: ? Simp(#72) User #74: " Compare the generalized Taylor series of two different formulations of a " User #75: " function => log(z) + log(cosh(w)) + tanh(w) z + O(z^2) " #76: s1 := TAYLOR(LOG(SINH(z)) + LOG(COSH(z + w)), z, 0, 1) User #77: s1 User #78: ? Simp(#77) #79: s2 := TAYLOR(LOG(SINH(z)*COSH(z + w)), z, 0, 1) User #80: s2 User #81: ? Simp(#80) #82: s1 - s2 User #83: ? Simp(#82) #84: s1 := User #85: s2 := User #86: " Look at the generalized Taylor series around x = 1 " User User #87: " => (x - 1)^a/e^b [1 - (a + 2 b) (x - 1) / 2 + O((x - 1)^2)] " a #88: TAYLOR(LOG(x) *EXP(- b*x), x, 1, 1) User #89: ? Simp(#88) #90: " Asymptotic expansions => sqrt(2) x + O(1/x) " User 2 #91: TAYLOR(SQRT(2*x + 1), x, inf, 1) User #92: ? Simp(#91) User #93: " Wallis' product => 1/sqrt(pi n) + ... [Knopp, p. 385] " / 1 \ TAYLOR|------*COMB(2*n, n), n, inf, 1| #94: | 2*n | User \ 2 / #95: ? Simp(#94) User #96: " => 0!/x - 1!/x^2 + 2!/x^3 - 3!/x^4 + O(1/x^5) [Knopp, p. 544] " inf / EXP(-t) #97: q_ := EXP(x)*| --------- dt User / t x #98: TAYLOR(q_, x, inf, 0) User Memory Full User #99: " Multivariate Taylor series expansion => 1 - (x^2 + 2 x y + y^2)/2 + O(x^4) " #100:q_ := TAYLOR(TAYLOR(COS(x + y), x, 0, 2), y, 0, 2) User #101:q_ User 2 2 2 x *(y - 2) - 4*x*y - 2*y + 4 #102:-------------------------------- Simp(#101) 4 #103:EXPAND(q_) User 2 2 2 2 x *y x y #104:------- - ---- - x*y - ---- + 1 Simp(#103) 4 2 2 #105:q_ := TAYLOR(TAYLOR(COS(x + y), y, 0, 2), x, 0, 2) User #106:q_ User 2 2 2 x *(y - 2) y #107:------------- - x*y - ---- + 1 Simp(#106) 4 2 #108:EXPAND(q_) User 2 2 2 2 x *y x y #109:------- - ---- - x*y - ---- + 1 Simp(#108) 4 2 2 #110:" Power series (compute the general formula) " User / SIN(x) \ #111:LOG|--------| User \ x / / SIN(x) \ #112:LN|--------| Simp(#111) \ x / #113:q_ := EXP(-x)*SIN(x) User #114:TAYLOR(q_, x, 0, 7) User 7 6 5 3 x x x x 2 #115:- ----- + ---- - ---- + ---- - x + x Simp(#114) 630 90 30 3 User #116:" Derive an explicit Taylor series solution of y as a function of x from the " #117:" following implicit relation: " User User #118:" y = x - 1 + (x - 1)^2/2 + 2/3 (x - 1)^3 + (x - 1)^4 + 17/10 (x - 1)^5 + ... " #119:q_ := x = SIN(y) + COS(y) User User #120:" Substitute x = z + 1, expand and then substitute z = x - 1 " #121:TAYLOR_INVERSE(RHS(q_), y, x, 0, 5) User 5 4 3 2 51*x - 225*x + 410*x - 375*x + 195*x - 56 #122:----------------------------------------------- Simp(#121) 30 Sub(#122) 5 4 3 2 ~ 51*(z + 1) - 225*(z + 1) + 410*(z + 1) - 375*(z + 1) + 195~ #123:---------------------------------------------------------------~ 30 ~ *(z + 1) - 56 -------------- 5 3 2 17*z 4 2*z z #124:------- + z + ------ + ---- + z Expd(#123) 10 3 2 Sub(#124) 5 3 2 17*(x - 1) 4 2*(x - 1) (x - 1) #125:------------- + (x - 1) + ------------ + ---------- + (x - 1) 10 3 2 User #126:" Pade (rational function) approximation => (2 - x)/(2 + x) " #127:PADE(EXP(-x), x, 0, 1, 1) User 2 - x #128:------- Simp(#127) x + 2 User #129:" Fourier series of f(x) of period 2 p over the interval [-p, p] " User #130:" => - (2 p / pi) sum( (-1)^n sin(n pi x / p) / n, n = 1..infinity ) " #131:FOURIER(x, x, -p, p, 3) User Simp(#131) / 3*pi*x \ / 2*pi*x \ / pi*x \ 2*p*SIN|--------| p*SIN|--------| 2*p*SIN|------| #132: \ p / \ p / \ p / ------------------- - ----------------- + ----------------- 3*pi pi pi #133:" => p / 2 " User User #134:" - (2 p / pi^2) sum( [1 - (-1)^n] cos(n pi x / p) / n^2, n = 1..infinity ) " #135:FOURIER(|x|, x, -p, p, 5) User Simp(#135) / / 5*pi*x \ / 3*pi*x \ / pi*x \ | 4*COS|--------| 4*COS|--------| 4*COS|------| | \ p / \ p / \ p / #136:- |p|*|----------------- + ----------------- + --------------- - | 2 2 2 \ 25*pi 9*pi pi \ | 1 | ---| 2 | / #137:" ---------- Quit ---------- " User