Examples for Section 8.11
Applications of Power Series

p. 697

Binomial Series

7.

Find the first four terms of the binomial series for f(x)  =  (((1 + (x^3)))^(-1/2)).

Solution. The binomial formula is: 
(((1 + u))^m)=1+m u + (({{m}, {2}}))(u^2)+ (({{m}, {3}}))(u^3)+...
When m = -1/2 and u = (x^3) we get: 
(((1 + (x^3)))^(-1/2))=1+(-(1/2)) (x^3)+(({{-1/2}, {2}}))((((x^3)))^2)+(({{-1/2}, {3}}))((((x^3)))^3)+... =1 - (1/2) (x^3) + 
                  (( (-1/2) (-3/2))/2) (x^6) + 
                  (( (-1/2) (-3/2) (-5/2))/(3*2
                          )) (x^9) +  ...  = 
              1 - (1/2) (x^3) + (( 3)/8) (x^6) - (5/16) (x^9) +  ...

Series[(((1 + (x^3)))^(-1/2)), {x, 0, 9}]

8.

Find the first four terms of the binomial series for f(x)  =  (((1 + (x^2)))^(-1/3)).

Solution.  Let's let Mathematica do more of the work.

binom[m_, k_]  :=  
      (((∏_(i = 0)^(k - 1))(m - i))/(k!))

bseries[u_, m_]  := 
      (∑_(k = 0)^∞)(binom[m, k] (u^k))

bpoly[u_, m_, N_]  := (∑_(k = 0)^N)(binom[m, k] (u^k))

bseries[(x^2), -1/3]

bpoly[(x^2), -1/3, 5]

10.

Find the first four terms of the binomial series for f(x)  =  (((1 - (2/x)))^(1/3)).

bseries[-(2/x), 1/3]

bpoly[-(2/x), 1/3, 5]

Initial Value Problems

24.

Find a power series solution for the initial value problem (1 + (x^2)) y'  +  2  x y  =  0, y(0)  =  3

DSolve[{(1 + (x^2)) y'[x]  +  2 x y[x] == 0,  y[0] == 3}, 
      y[x], x]

Series[(3/(1 + (x^2))), {x, 0, 8}]

To get a power series solution we write
y = (Subscript[c, 0]) + (Subscript[c, 1]) x + (Subscript[c, 2]) (x^2) +   ... 
Note that the initial condition gives: 3  =  y(0)  =  (Subscript[c, 0]). The derivative is 
y' = (Subscript[c, 1]) + 2  (Subscript[c, 2]) x+3  (Subscript[c, 3]) (x^2)+...
so
(1 + (x^2)) y' + 2 x y = ((Subscript[c, 1]) + 2  (Subscript[c, 2]) x+3  (Subscript[c, 3]) (x^2)+...) + (x^2) ((Subscript[c, 1]) + 2  (Subscript[c, 2]) x+3  (Subscript[c, 3]) (x^2)+...) +2 x  
                ((Subscript[c, 0]) + (Subscript[c, 1]) x + (Subscript[c, 2]) (x^2) +   ... )=  (Subscript[c, 1]) + (2  (Subscript[c, 2]) + 2  (Subscript[c, 0])) x+(3  (Subscript[c, 3]) + (Subscript[c, 1]) + 2  (Subscript[c, 1])) (x^2)+(4  (Subscript[c, 4]) + 2  (Subscript[c, 2]) + 2  (Subscript[c, 2])) (x^3)+...+((n + 1) (Subscript[c, n + 1]) + (n - 1) (Subscript[c, n - 1]) + 
                      2  (Subscript[c, n - 1])) (x^n)+ ...
This series must equal 0, so we get:
  (Subscript[c, 1]) = 0
  2  (Subscript[c, 2]) + 2  (Subscript[c, 0]) = 0 or (Subscript[c, 2]) = -(Subscript[c, 0]) = -3
  3  (Subscript[c, 3]) + 3  (Subscript[c, 1]) =  0 or (Subscript[c, 3]) = -(Subscript[c, 1]) =  0
  4  (Subscript[c, 4]) +  4  (Subscript[c, 2]) =  0 or (Subscript[c, 4]) =  -(Subscript[c, 2]) =  3
The general term is:
 n (Subscript[c, n]) + n (Subscript[c, n - 2])=0 or \(TraditionalForm
      \`c\_n = \ 
        \(\(-c\_\(n - 2\)\) = 
          \(\(c\_\(n - 4\) =. \) ..  = 
            \(\(\((\(-1\))\)\^\(n/2\)\) c\_0 = \ 
              \(\((\(-1\))\)\^\(n/2\)\) 3\)\)\)\) if n is even and (Subscript[c, n]) = 0 if n is odd. The solution is thus \(TraditionalForm
      \`y\  = \ \(3\  - \ 3  x\^2 + \ 3  x\^4 - \  ...  = \ 
          \(3 \((1 - x\^2 + x\^4 -  ... )\)\  = \ 3\/\(1 + x\^2\)\)\)\)

31.

Find a power series solution for the initial value problem y''  +  (x^2) y  =  x, y' (0) = b, y(0) = a.

Solution. We look for a solution of the form \(TraditionalForm
      \`y = \(a\_0 + \ \(a\_1\) x + \(a\_2\) x\^2 +  ... \) + 
            \(a\_n\) x\^n +  ... \).
Taking derivatives:
\(TraditionalForm
      \`y'\  = \ 
        \(a\_1 + 2 \( a\_2\) x\  + 3 \( a\_3\) x\^2 +  ... \) + 
            n\ \(a\_n\) x\^\(n - 1\) +  ... \)
y'' = 2  (Subscript[a, 2])+6  (Subscript[a, 3]) x + 12  (Subscript[a, 4]) (x^2)+...+n(n - 1) (Subscript[a, n]) (x^(n - 2))+....
Plug these into the equation y''  +  (x^2) y  =  x gives: 
(2  (Subscript[a, 2])+6  (Subscript[a, 3]) x +  12  (Subscript[a, 4]) (x^2)+...+(n + 2) (n + 1) (Subscript[a, n + 2]) (x^n)+...)+(x^2)(
              (Subscript[a, 0]) +  (Subscript[a, 1]) x + (Subscript[a, 2]) (x^2) +  ...  + 
                  (Subscript[a, n - 2]) (x^(n - 2)) +  ... )=x 
Collecting terms: 
2  (Subscript[a, 2]) + 3*2  (Subscript[a, 3]) x + 
                                  ((Subscript[a, 0]) +  4*3(Subscript[a, 4]))(x^2)+...+(
                      (n + 2) (n + 1) (Subscript[a, n + 2]) + (Subscript[a, n - 2]))
                      (x^(n + 2))+...=x 
Along with y(0) = (Subscript[a, 0]) = a and y'(0)= (Subscript[a, 1]) = b, this implies that (Subscript[a, 2]) = 0, 3*2  (Subscript[a, 3]) = 1, (Subscript[a, 0]) + 4*3  (Subscript[a, 4]) = 0, ... , \(TraditionalForm
      \`\((n + 2)\) \((n + 1)\) a\_\(n + 2\) + a\_\(n - 2\)\  = \ 0\), ... . Therefore, \(TraditionalForm
      \`a\_4 = \ \(\(-\(1\/\(4*3\)\)\) a\_0 = \(-\(1\/\(4*3\)\)\) a\)\),  \(TraditionalForm
      \`a\_5 = \ 
        \(\(-\ \(1\/\(5*4\)\)\) a\_1 = \ \(-\ \(1\/\(5*4\)\)\) b\)\), (Subscript[a, 6]) = -(1/(6*5)) (Subscript[a, 2]) = 0, \(TraditionalForm
      \`a\_7 = \(\(-\(1\/\(7*6\)\)\) a\_3 = 
          \(-\(1\/\(7*6\)\)\) \((1\/6)\)\)\), \(TraditionalForm
      \`a\_8 = \(\(-\ \(1\/\(8*7\)\)\) a\_4 = 
          \(\(-\(1\/\(8*7\)\)\) \((\(-\(1\/\(4*3\)\)\) a)\) = 
            \(1\/\(8*7*4*3\ \)\) a\)\)\), \(TraditionalForm
      \`a\_9 = \(\(-\ \(1\/\(9*8\)\)\) a\_5 = 
          \(\(-\(1\/\(9*8\)\)\) \((\(-\(1\/\(5*4\)\)\) a\_1)\) = 
            \(1\/\(9*8*5*4\ \)\) b\)\)\), etc. The solution then looks like 
\(TraditionalForm
      \`y\  = \ a\  + \ b\ x\  + \ \(1\/6\) x\^3 - \ \((a\/\(4*3\))\) x\^4 - 
            \ \((b\/\(5*4\))\) x\^5 - \((1\/\(7*6*6\))\) x\^7 + \ 
            \(a\/\(8*7*4*3\)\) x\^8 + \(b\/\(9*9*5*4\ \)\) x\^9 +  ... \)

Approximating Integrals

34.

The series for (((e^(-x)) - 1)/x) is \(TraditionalForm
      \`\(\((1 - x + \(1\/\(2!\)\) x\^2 - \(1\/\(3!\)\) x\^3 + \  ... )\)\  - 
            1\)\/x = 
        \(-1\) + \(1\/\(2!\)\) x - \(1\/\(3!\)\) x\^2 + \  ... \)

Series[(((E^(-x)) - 1)/x), {x, 0, 5}]

Integrating from 0 to 0.2 gives:
\(TraditionalForm
      \`\(-\((0.2)\)\)\  + \ \(1\/\(2*\(2!\)\)\) \((0.2)\)\^2 - \ 
          \(1\/\(3*\(3!\)\)\) \((0.2)\)\^3 + \ 
          \(1\/\(4*\(4!\)\)\) \((0.2)\)\^4 - \  ... \) 
This is an alternating series, so the error in using the first n terms is less than the absolute value ofthe n + 1term: 
\(TraditionalForm
      \`error\  < \ 
        \(1\/\(\((n + 1)\)*\(\((n + 1)\)!\)\)\) \((0.2)\)\^\(n + 1\)\). A table of these values is:

\(\(Table[\ 
      \(1\/\(\((n + 1)\)*\(\((n + 1)\)!\)\)\) \((0.2)\)\^\(n + 1\), {n, 1, 5}]
      
\)\)

Thus, for n = 2, the approimation \(TraditionalForm
      \`\(-\((0.2)\)\)\  + \ \(1\/\(2*\(2!\)\)\) \((0.2)\)\^2\) has an error is less than (10^(-3)).

-(0.2)  +  (1/(2*2!)) (((0.2))^2)

(∫_0^0.2)(( (E^(-x)) - 1)/x) \[DifferentialD]x

46.

Find a polynomial that approximates \(TraditionalForm
      \`F(x)\  = \ 
        ∫\_0\%x\(\( ln(1 + t)\)\/t\) dt\) for x in [0, 1] with error less than (10^(-3)).
Solution.  The power series for ((ln(1 + t))/t) is \(TraditionalForm
      \`\(t - \(1\/2\) t\^2 + \(1\/3\) t\^3 - \  ... \)\/t = 
        1 - \(1\/2\) t + \(1\/3\) t\^2 -  ... \)

Series[Log[1 + t]/t, {t, 0, 5}]

Integrating from 0 to x gives: \(TraditionalForm
      \`x\  - \ \(1\/2\^2\) x\^2 + \ \(1\/3\^2\) x\^3 - \ \(1\/4\^2\) x\^4 + 
          \  ... \) 
Since 0  ≤  x  ≤  1, this series is alternating and the error of using the first n terms to approximate the series is less than the absolute value of the n + 1 term: \(TraditionalForm
      \`error\  < \ 1\/\(\((n + 1)\)\^2\ \) | x
        \( | \^\(n + 1\)\)\( ≤ 1\/\((n + 1)\)\^2\)\). the last inequality uses the given restriction that 0  ≤  x  ≤  1. To get the error  <  (10^(-3))we should choose n such that (((n + 1))^2) > (10^3), or n > (Sqrt[(10^3)]) - 1 = 30.6228. Thus, n = 31 is sufficient.

N[(Sqrt[(10^3)]) - 1]

The approximating polynomial is

approx = 
      (∑_(n = 1)^31)((((-1))^(n + 1))/(n^2)) (x^n)

F[x_]  :=  (∫_0^x) Log[1 + t]/t \[DifferentialD]t

Plot[{F[x], approx}, {x, 0, 1}, 
      PlotStyle -> {RGBColor[1, 0, 0], RGBColor[0, 0, 1]}]

There is no apparent difference between the function and the approximation. We must plot the difference with a very small scale on the y-axis to see a difference appear near x = 1:

Plot[F[x] - approx,  {x, 0, 1}, PlotRange -> {- .001,  .001}]