User:Egm4313.s12.team17/Report 4

=Problem R4.1 - General Formulation for Polynomial Excitation=

Given
Given the equation:
 * {| style="width:100%" border="0"

$$  \displaystyle y''+ay'+by= \sum_{j=0}^{n}k_jx^j $$     (Eq.1.1)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

The equation for the coefficients of x^0 \,:
 * {| style="width:100%" border="0"

$$  \displaystyle 2c_2+ac_1+bc_0=k_0 $$     (Eq.1.2)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Problem Statement
Obtain equations for x^1 \,, x^2 \,, x^3 \,, x^{n-1} \,, x^{n-2} \,, and x^n \, and insert those equations as well as the given equation for x^0 \, into a tri-diagonal matrix.

Solution
The order of the given equation is defined as the highest power of $$ x $$ in Eq. 1.1 below:
 * {| style="width:100%" border="0"

$$  \displaystyle y''+ay'+by=\sum_{j=0}^{n}k_jx^j $$     (Eq.1.3) Therefore, the order of Eq. 1.3 is $$n$$ and the coefficients of the solution may be found using the below sum rule:
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y(x)=\sum_{j=0}^s c_j x^j $$     (Eq.1.4) Where $$ s $$ in Eq. 1.4 is equal to the order of the Eq. 1.3 which was defined above to be $$n$$:
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y(x)=\sum_{j=0}^n c_j x^j $$     (Eq.1.5) Eq. 1.5 may be substituted into Eq. 1.3 for y \, and below are the corresponding substitutions for y^\prime \, and :
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y'(x)=\sum_{j=0}^n j c_j x^{(j-1)}=\sum_{j=1}^n j c_j x^{(j-1)} $$     (Eq.1.6)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y''(x)=\sum_{j=0}^n j(j-1) c_j x^{(j-2)}=\sum_{j=2}^n j(j-1) c_j x^{(j-2)} $$     (Eq.1.7) Substituting Eq. 1.5, Eq. 1.6, and Eq. 1.7 into Eq. 1.3 yields the below equation:
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle ( \sum_{j=2}^n j(j-1) c_j x^{(j-2)} ) +a( \sum_{j=1}^n j c_j x^{(j-1)} )+b( \sum_{j=0}^n c_j x^j )=\sum_{j=0}^n k_jx^j $$     (Eq.1.8) To obtain equation for the coefficients of x^1 \,. The $$ j \,$$ values of Eq. 1.8 are adjusted for each summation such that the exponent of x \, will be equal to 1:
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle ( \sum_{j=3}^3 j(j-1) c_j x^{(j-2)} ) +a( \sum_{j=2}^2 j c_j x^{(j-1)} )+b( \sum_{j=1}^1 c_j x^j )=\sum_{j=1}^1k_jx^j $$     (Eq.1.9) Which is further simplified below:
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle (3(3-1) c_3 x^{(3-2)} ) +a( 2 c_2 x^{(2-1)} )+b(c_1 x^1 )=k_1x^1 $$     (Eq.1.10)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle (3)2c_3x^1+a(2c_2x^1)+bc_1x^1=k_1x $$     (Eq.1.11)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 6c_3x^1+2ac_2x^1+bc_1x^1=k_1x $$     (Eq.1.12)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2(3c_3+ac_2+\frac{1}{2}bc_1)x^1=k_1x^1 $$     (Eq.1.13) And therefore the coefficients of x^1 \, are:
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2(3c_3+ac_2+\frac{1}{2}bc_1)=k_1 $$     (Eq.1.14) To obtain equation for the coefficients of x^2 \,. The $$ j \,$$ values of Eq. 1.8 are adjusted for each summation such that the exponent of x \, will be equal to 2:
 * style="width:5%; padding:10px; border:2px solid #8888aa" |
 * style="width:5%; padding:10px; border:2px solid #8888aa" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle ( \sum_{j=4}^4 j(j-1) c_j x^{(j-2)} ) +a( \sum_{j=3}^3 j c_j x^{(j-1)} )+b( \sum_{j=2}^2 c_j x^j )=\sum_{j=2}^2 k_2x^2 $$     (Eq.1.15) Which is further simplified below:
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle ( 4(4-1) c_4 x^{(4-2)} ) +a( 3 c_3 x^{(3-1)} )+b(c_2 x^2 )=k_2x^2 $$     (Eq.1.16)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle ( (4)3 c_4 x^{(4-2)} ) +a( 3 c_3 x^{(2)} )+bc_2 x^2=k_2x^2 $$     (Eq.1.17)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 12c_4 x^{(2)} +3a c_3 x^{(2)} +bc_2 x^2 =k_2x^2 $$     (Eq.1.18)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle (12c_4 +3a c_3 +bc_2 )x^2 =k_2x^2 $$     (Eq.1.19) And therefore the coefficients of x^2 \, are:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 12c_4 +3a c_3 +bc_2=k_2 $$     (Eq.1.20) To obtain equation for the coefficients of x^3 \,. The $$ j \,$$ values of Eq. 1.8 are adjusted for each summation such that the exponent of x \, will be equal to 3:
 * style="width:5%; padding:10px; border:2px solid #8888aa" |
 * style="width:5%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle ( \sum_{j=5}^{5} j(j-1) c_j x^{(j-2)} ) +a( \sum_{j=4}^{4} j c_j x^{(j-1)} )+b( \sum_{j=3}^{3} c_j x^j )=\sum_{j=3}^{3} k_{n-2}x^{n-2} $$     (Eq.1.21) Which is further simplified below:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle ( 5(5-1) c_{5} x^{(5-2)} ) +a( 4 c_{4} x^{(4-1)} )+b( c_{3} x^{3} )= k_{3}x^{3} $$     (Eq.1.22)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle ( 5(4) c_{5} x^{(3)} ) +a( 4 c_{4} x^{3} )+b( c_{3} x^{3} )= k_{3}x^{3} $$     (Eq.1.23)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle (20c_{5} +4ac_{4} +bc_{3} )x^{3}= k_{3}x^{3} $$     (Eq.1.24) And therefore the coefficients of x^3 \, are:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 20 c_{5} +4ac_{4} +bc_{3} = k_{3} $$     (Eq.1.25) To obtain equation for the coefficients of x^{n-2} \,. The $$ j \,$$ values of Eq. 1.8 are adjusted for each summation such that the exponent of x \, will be equal to n-2 \,:
 * style="width:5%; padding:10px; border:2px solid #8888aa" |
 * style="width:5%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle ( \sum_{j=n}^{n} j(j-1) c_j x^{(j-2)} ) +a( \sum_{j=n-1}^{n-1} j c_j x^{(j-1)} )+b( \sum_{j=n-2}^{n-2} c_j x^j )=\sum_{j=n-2}^{n-2} k_{n-2}x^{n-2} $$     (Eq.1.26) Which is further simplified below:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle ( n(n-1) c_{n} x^{(n-2)} ) +a( (n-1) c_{n-1} x^{(n-1-1)} )+b( c_{n-2} x^{n-2} )= k_{n-2}x^{n-2} $$     (Eq.1.27)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle ( n(n-1) c_{n} x^{(n-2)} ) +a( (n-1) c_{n-1} x^{(n-2)} )+b( c_{n-2} x^{n-2} )= k_{n-2}x^{n-2} $$     (Eq.1.28)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle ((n-1)( n c_{n} +ac_{n-1} )+bc_{n-2} )x^{n-2}= k_{n-2}x^{n-2} $$     (Eq.1.29) And therefore the coefficients of x^{n-2} \, are:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle ((n-1)( n c_{n} +ac_{n-1} )+bc_{n-2} )= k_{n-2} $$     (Eq.1.30) To obtain equation for the coefficients of x^{n-1} \,. The $$ j \,$$ values of Eq. 1.8 are adjusted for each summation such that the exponent of x \, will be equal to n-1 \,:
 * style="width:5%; padding:10px; border:2px solid #8888aa" |
 * style="width:5%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle ( \sum_{j=n+1}^{n} j(j-1) c_j x^{(j-2)} ) +a( \sum_{j=n}^{n} j c_j x^{(j-1)} )+b( \sum_{j=n-1}^{n-1} c_j x^j )=\sum_{j=n-1}^{n-1} k_j x^j $$     (Eq.1.31) Since, the bounds of a summation in Eq. 1.31 is exceeded in one case that summation is simplified to zero as shown below:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle a( n c_n x^{(n-1)} )+b(c_{n-1} x^{n-1} )=k_{n-1} x^{n-1} $$     (Eq.1.32) Which is further simplified below:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle (an c_n +bc_{n-1}) x^{n-1} =k_{n-1} x^{n-1} $$     (Eq.1.33) And therefore the coefficients of x^{n-1} \, are:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle (an c_n +bc_{n-1}) =k_{n-1} $$     (Eq.1.34)
 * style="width:5%; padding:10px; border:2px solid #8888aa" |
 * style="width:5%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }

To obtain equation for the coefficients of x^n \,. The $$ j \,$$ values of Eq. 1.8 are adjusted for each summation such that the exponent of x \, will be equal to n \,:
 * {| style="width:100%" border="0"

$$  \displaystyle ( \sum_{j=n+2}^{n} j(j-1) c_j x^{(j-2)} ) +a( \sum_{j=n+1}^{n} j c_j x^{(j-1)} )+b( \sum_{j=n}^{n} c_j x^j )=\sum_{j=n}^{n} k_j x^j $$     (Eq.1.35) Since, the bounds of the summations in Eq. 1.35 are exceeded in two cases those summation are simplified to zero as shown below:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle b(c_n x^n) =k_n x^n $$     (Eq.1.36) Which is further simplified below:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle (bc_n) x^n =k_n x^n $$     (Eq.1.37) And therefore the coefficients of x^n \, are:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle bc_n=k_n $$     (Eq.1.38) The following equations Eq. 1.14, Eq. 1.20, Eq. 1.25, Eq. 1.30, Eq. 1.34, abd Eq. 1.38 as well as the given equation for the coefficients of x^0 \, can have the left hand side of the equations inserted into a tri-diagonal matrix as shown below:
 * style="width:5%; padding:10px; border:2px solid #8888aa" |
 * style="width:5%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \begin{bmatrix} b & a & 2 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & b & a & 6 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & b & 3a & 12 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & b & 4a & 20 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & b & a(n-1) & n(n-1)\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & b & an\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & b\\ \end{bmatrix} $$     (Eq.1.39)
 * style="width:5%; padding:10px; border:2px solid #8888aa" |
 * style="width:5%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }

Author & Proofreaders
Author: Egm4313.s12.team17.axelrod.a 08:51, 11 March 2012 (UTC)

Proofreader 1: Egm4313.s12.team17.hintz 21:30, 12 March 2012 (UTC)

Proofreader 2: Egm4313.s12.team17.deaver.md 15:36, 14 March 2012 (UTC))

Proofreader 3: Egm4313.s12.team17.ying 10:10, 12 March 2012 (UTC)

Editor: Egm4313.s12.team17.deaver.md 15:36, 14 March 2012 (UTC)

=Problem R4.2 - Taylor Series Expansion for the Excitations=

Part 1 Given
Given the equation:
 * {| style="width:100%" border="0"

$$  \displaystyle y''-3y'+2y=r(x) $$     (Eq.2.1.1)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

And that the following relations are true for this problem:
 * {| style="width:100%" border="0"

$$  \displaystyle r(x)=sin(x) $$     (Eq.2.1.2)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y(0)=1 $$     (Eq.2.1.3)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y'(0)=0 $$     (Eq.2.1.4)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Part 1 Problem Statement
Reproduce the graph shown below where, using the Taylor series expansion for using the Taylor series expansion for r_n(x) \, shown below:


 * {| style="width:100%" border="0"

$$  \displaystyle r_n(x):=\sum_{k=0}^ \frac{(-1)^kx^{2k+1}}{(2k+1)!}=x-\frac{x^3}{3!} +...+ \frac{(-1)^n x^{2n+1}}{(2n+1)!} $$     (Eq.2.1.5)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }



Part 1 Solution
Note: The n \, is for the highest power of x \,.
 * {| style="width:100%" border="0"

$$  \displaystyle r_n(x)=\sum_{k=1}^undefined \frac{(-1)^{k-1}x^{2k-1}}{(2k-1)!} $$     (Eq.2.1.6)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_n(x)=\sum_{k=1}^undefined \frac{(-1)^{k-1}x^{2k-1}}{(2k-1)!}=x-\frac{x^3}{3!} +...+ \frac{(-1)^{t-1} x^{2t-1}}{(2t-1)!} $$     (Eq.2.1.7)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_n(x)=x-\frac{x^3}{3!} +...+ \frac{(-1)^{t-1} x^{2t-1}}{(2t-1)!} $$     (Eq.2.1.8) For n=1 \, :
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_1(x)=\sum_{k=1}^ \frac{(-1)^{k-1}x^{2k-1}}{(2k-1)!}=x-\frac{x^3}{3!} +...+ \frac{(-1)^{t-1} x^{2t-1}}{(2t-1)!} $$     (Eq.2.1.9)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_1(x)=x $$     (Eq.2.1.10) For n=3 \, :
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_3(x)=\sum_{k=1}^ \frac{(-1)^{k-1}x^{2k-1}}{(2k-1)!}=x-\frac{x^3}{3!} +...+ \frac{(-1)^{t-1} x^{2t-1}}{(2t-1)!} $$     (Eq.2.1.11)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_3(x)=x-\frac{x^3}{3!} $$     (Eq.2.1.12) For n=5 \, :
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_5(x)=\sum_{k=1}^ \frac{(-1)^{k-1}x^{2k-1}}{(2k-1)!}=x-\frac{x^3}{3!} +...+ \frac{(-1)^{t-1} x^{2t-1}}{(2t-1)!} $$     (Eq.2.1.13)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_5(x)=x-\frac{x^3}{3!}+\frac{x^5}{5!} $$     (Eq.2.1.14) For n=7 \, :
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_7(x)=\sum_{k=1}^ \frac{(-1)^{k-1}x^{2k-1}}{(2k-1)!}=x-\frac{x^3}{3!} +...+ \frac{(-1)^{t-1} x^{2t-1}}{(2t-1)!} $$     (Eq.2.1.15)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_7(x)=x-\frac{x^3}{3!}+\frac{x^5}{5!}-\frac{x^7}{7!} $$     (Eq.2.1.16) For n=9 \, :
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_9(x)=\sum_{k=1}^ \frac{(-1)^{k-1}x^{2k-1}}{(2k-1)!}=x-\frac{x^3}{3!} +...+ \frac{(-1)^{t-1} x^{2t-1}}{(2t-1)!} $$     (Eq.2.1.17)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_9(x)=x-\frac{x^3}{3!}+\frac{x^5}{5!}-\frac{x^7}{7!}+\frac{x^9}{9!} $$     (Eq.2.1.18) For n=11 \, :
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_{11}(x)=\sum_{k=1}^ \frac{(-1)^{k-1}x^{2k-1}}{(2k-1)!}=x-\frac{x^3}{3!} +...+ \frac{(-1)^{t-1} x^{2t-1}}{(2t-1)!} $$     (Eq.2.1.19)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_{11}(x)=x-\frac{x^3}{3!}+\frac{x^5}{5!}-\frac{x^7}{7!}+\frac{x^9}{9!}-\frac{x^{11}}{11!} $$     (Eq.2.1.20) For n=13 \, :
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_{13}(x)=\sum_{k=1}^ \frac{(-1)^{k-1}x^{2k-1}}{(2k-1)!}=x-\frac{x^3}{3!} +...+ \frac{(-1)^{t-1} x^{2t-1}}{(2t-1)!} $$     (Eq.2.1.21)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_{13}(x)=x-\frac{x^3}{3!}+\frac{x^5}{5!}-\frac{x^7}{7!}+\frac{x^9}{9!}-\frac{x^{11}}{11!}+\frac{x^{13}}{13!} $$     (Eq.2.1.22) The following are represented in the below graph using MatLab: Eq. 2.1.10, Eq. 2.1.12, Eq. 2.1.14, Eq. 2.1.16, Eq. 2.1.18, Eq. 2.1.20, Eq. 2.1.22.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

MATLAB code is shown below:

Part 2 Given

 * {| style="width:100%" border="0"

$$  \displaystyle \sum_{k=0}^undefined \frac{(-1)^kx^{2k+1}}{(2k+1)!}=x-\frac{x^3}{3!} +...+ \frac{(-1)^t x^{2t+1}}{(2t+1)!} $$     (Eq.2.2.1)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_{p,n}''+ay'_{p,n}+by_{p,n}=r_n(x) $$     (Eq.2.2.2)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y(0)=1 $$     (Eq.2.2.3)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y'(0)=0 $$     (Eq.2.2.4)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Part 2 Problem Statement
Find y_n \, for n=3,5,9 \, and plot the solutions for.

Part 2 Problem Solution
From Part 1 we know that:
 * {| style="width:100%" border="0"

$$  \displaystyle r_{3}(x)=x-\frac{x^3}{3!} $$     (Eq.2.1.12) Setting up the method of undetermined coefficients:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y''-3y'+2y=x-\frac{x^3}{3!} $$     (Eq.2.2.5) The particular solution will take the general form shown below:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_{p}(x)= \sum_{j=0}^n c_{j}x^j $$     (Eq.2.2.6) This was solved in | Problem R3.4
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Solving for the particular solution of Eq. 2.2.5:
 * {| style="width:100%" border="0"

$$  \displaystyle y_p=Ax^3+Bx^2+Cx+D $$     (Eq.2.2.7)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_p'=3Ax^2+2Bx+C $$     (Eq.2.2.8)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_p''=6Ax+2B $$     (Eq.2.2.9) For the x^3 \, terms:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2A=-\frac{1}{6} $$     (Eq.2.2.10)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle A=-\frac{1}{12} $$     (Eq.2.2.11) For the x^2 \, terms:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle -9A+2B=0 $$     (Eq.2.2.12)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle -9(-\frac{1}{12})+2B=0 $$     (Eq.2.2.13)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \frac{3}{4}+2B=0 $$     (Eq.2.2.14)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2B=-\frac{3}{4} $$     (Eq.2.2.15)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle B=-\frac{3}{8} $$     (Eq.2.2.16) For the x^1 \, terms:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 6A-6B+2C=1 $$     (Eq.2.2.17)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 6(-\frac{1}{12})-6(-\frac{3}{8})+2C=1 $$     (Eq.2.2.18)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle -\frac{1}{2}+\frac{9}{4}+2C=1 $$     (Eq.2.2.19)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2C=-\frac{3}{4} $$     (Eq.2.2.20)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle C=-\frac{3}{8} $$     (Eq.2.2.21) For the x^0 \, terms:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2B-3C+2D=0 $$     (Eq.2.2.22)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2(-\frac{3}{8})-3(-\frac{3}{8})+2D=0 $$     (Eq.2.2.23)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle -\frac{6}{8}+\frac{9}{8}+2D=0 $$     (Eq.2.2.24)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2D=-\frac{3}{8} $$     (Eq.2.2.25)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle D=-\frac{3}{16} $$     (Eq.2.2.26) So the particular solution for n=3 \, is:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_{p,3}=-\frac{1}{12}x^3-\frac{3}{8}x^2-\frac{3}{8}x-\frac{3}{16} $$     (Eq.2.2.27) The homogeneous equation for n=3 \, is also the homogeneous equation for n=5 \, and n=9 \,:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_{h,3}=C_1e^{\lambda_1}+C_2e^{\lambda_2} $$     (Eq.2.2.28) The and  are found using below:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y''-3y'+2y=0 $$     (Eq.2.2.29)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \lambda^2-3\lambda+2=0 $$     (Eq.2.2.30)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle (\lambda-2)(\lambda-1)=0 $$     (Eq.2.2.31)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \lambda_1=2 $$     (Eq.2.2.32)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \lambda_2=1 $$     (Eq.2.2.33) So therefore the homogeneous equation is:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_h=C_1e^{2x}+C_2e^x $$     (Eq.2.2.34) From part 1 we know that:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_{5}(x)=x-\frac{x^3}{3!}+\frac{x^5}{5!} $$     (Eq.2.1.14) Setting up the method of undetermined coefficients:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y''-3y'+2y=x-\frac{x^3}{3!}+\frac{x^5}{5!} $$     (Eq.2.2.35) Solving for the particular solution of Eq.2.2.35:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_p=Ax^5+Bx^4+Cx^3+Dx^2+Ex+F $$     (Eq.2.2.36)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_p'=5Ax^4+4Bx^3+3Cx^2+2Dx+E $$     (Eq.2.2.37)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_p''=20Ax^3+12Bx^2+6Cx+2D $$     (Eq.2.2.38) Which upon inserting Eq.2.2.36, Eq.2.2.37, and Eq.2.2.38 into Eq.2.2.35 yields the following:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

For the x^5 \, terms:
 * {| style="width:100%" border="0"

$$  \displaystyle 2A=1\frac{1}{120} $$     (Eq.2.2.39)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle A=\frac{1}{240} $$     (Eq.2.2.40) For the x^4 \, terms:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle -15A+2B=0 $$     (Eq.2.2.41)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle -15(\frac{1}{240})+2B=0 $$     (Eq.2.2.42)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle -\frac{1}{16}+2B=0 $$     (Eq.2.2.43)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2B=\frac{1}{16} $$     (Eq.2.2.44)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle B=\frac{1}{32} $$     (Eq.2.2.45) For the x^3 \, terms:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 20A-12B+2C=-\frac{1}{6} $$     (Eq.2.2.46)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 20(\frac{1}{240})-6(\frac{1}{32})+2C=-\frac{1}{6} $$     (Eq.2.2.47)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \frac{1}{12}-\frac{3}{8}+2C=-\frac{1}{6} $$     (Eq.2.2.48)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2C=\frac{1}{8} $$     (Eq.2.2.49)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle C=\frac{1}{16} $$     (Eq.2.2.50) For the x^2 \, terms:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 12B-9C+2D=0 $$     (Eq.2.2.51)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 12(\frac{1}{32})-9(\frac{1}{16})+2D=0 $$     (Eq.2.2.52)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \frac{3}{8}-\frac{9}{16}+2D=0 $$     (Eq.2.2.53)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2D=\frac{3}{16} $$     (Eq.2.2.54)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle D=\frac{3}{32} $$     (Eq.2.2.55) For the x^1 \, terms:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 6C-6D+2E=1 $$     (Eq.2.2.56)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 6(\frac{1}{16})-6(\frac{3}{32})+2E=1 $$     (Eq.2.2.57)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \frac{3}{8}-\frac{9}{16}+2E=1 $$     (Eq.2.2.58)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle -\frac{3}{16}+2E=1 $$     (Eq.2.2.59)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2E=1+\frac{3}{16} $$     (Eq.2.2.60)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2E=\frac{19}{16} $$     (Eq.2.2.61)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle E=\frac{19}{32} $$     (Eq.2.2.62) For the x^0 \, terms:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2D-3E+2F=0 $$     (Eq.2.2.63)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2(\frac{3}{32})-3(\frac{19}{32})+2F=0 $$     (Eq.2.2.64)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \frac{3}{16}-\frac{57}{32}+2F=0 $$     (Eq.2.2.65)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2F=\frac{51}{32} $$     (Eq.2.2.66)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle F=\frac{51}{64} $$     (Eq.2.2.67) So the particular solution for n=5 \, is:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_{p,5}=\frac{1}{240}x^5+\frac{1}{32}x^4+\frac{1}{16}x^3+\frac{3}{32}x^2+\frac{19}{32}x+\frac{51}{54} $$     (Eq.2.2.68) From Part 1 we know that:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_{9}(x)=x-\frac{x^3}{3!}+\frac{x^5}{5!}-\frac{x^7}{7!}+\frac{x^9}{9!} $$     (Eq.2.1.18) Setting up the method of undetermined coefficients:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y''-3y'+2y=x-\frac{x^3}{3!}+\frac{x^5}{5!}-\frac{x^7}{7!}+\frac{x^9}{9!} $$     (Eq.2.2.69) Solving for the particular solution for Eq.2.2.69:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_p=Ax^9+Bx^8+Cx^7+Dx^6+Ex^5+Fx^4+Gx^3+Hx^2+Ix+J $$     (Eq.2.2.70)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_p'=9Ax^8+8Bx^7+7Cx^6+6Dx^5+5Ex^4+4Fx^3+3Gx^2+2Hx+I $$     (Eq.2.2.71)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_p''=72Ax^7+56Bx^6+42Cx^5+30Dx^4+20Ex^3+12Fx^2+6Gx+2H $$     (Eq.2.2.72) Inserting Eq. 2.2.70, Eq. 2.2.71, and Eq. 2.2.72 into Eq. 2.2.69 yields:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

For the x^9 \, terms:
 * {| style="width:100%" border="0"

$$  \displaystyle A=1\frac{1}{2(9!)} $$     (Eq.2.2.73) For the x^8 \, terms:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2B-27A=0 $$     (Eq.2.2.74)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2B-\frac{27}{2(9!)}=0 $$     (Eq.2.2.75)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle B=\frac{27}{4(9!)} $$     (Eq.2.2.76) For the x^7 \, terms:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2C-24B+72A=-\frac{1}{7!} $$     (Eq.2.2.77)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2C-24(\frac{27}{4(9!)})+\frac{72}{2(9!)}=-\frac{1}{7!} $$     (Eq.2.2.78)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2C-\frac{1}{2880}=-\frac{1}{7!} $$     (Eq.2.2.79)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle C=\frac{1}{1344} $$     (Eq.2.2.80) For the x^6 \, terms:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2D+56B-21C=0 $$     (Eq.2.2.81)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2D+56(\frac{27}{4(9!)})-\frac{21}{13440}=0 $$     (Eq.2.2.81)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle D=\frac{1}{3840} $$     (Eq.2.2.82) For the x^5 \, terms:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2E-18D+42C=\frac{1}{120} $$     (Eq.2.2.83)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2E-\frac{18}{3840}+\frac{42}{13440}=\frac{1}{120} $$     (Eq.2.2.84)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle E-\frac{1}{640}=\frac{1}{120} $$     (Eq.2.2.85)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle E=\frac{19}{3840} $$     (Eq.2.2.86) For the x^4 \, terms:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2F-15E+30D=0 $$     (Eq.2.2.87)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2F-\frac{15(19)}{3840}\frac{30}{3840}=0 $$     (Eq.2.2.88)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle F=\frac{17}{512} $$     (Eq.2.2.89) For the x^3 \, terms:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2G-12F+20E=\frac{1}{6} $$     (Eq.2.2.90)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2G-\frac{12(17)}{512}+\frac{20(19)}{3840}=-\frac{1}{6} $$     (Eq.2.2.91)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle G=\frac{12}{256} $$     (Eq.2.2.92) For the x^2 \, terms:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2H-9G+12F=0 $$     (Eq.2.2.93)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2H-\frac{9(17)}{256}+\frac{12(17)}{512}=0 $$     (Eq.2.2.94)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle H=\frac{51}{512} $$     (Eq.2.2.95) For the x^1 \, terms:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2I-6H+6G=1 $$     (Eq.2.2.96)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2I-\frac{6(51)}{512}+\frac{6(17)}{256}=1 $$     (Eq.2.2.97)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle I=\frac{307}{512} $$     (Eq.2.2.98) For the x^0 \, terms:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2J-3I+2H=0 $$     (Eq.2.2.99)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2J-\frac{3(307)}{512}+\frac{2(51)}{512}=0 $$     (Eq.2.2.100)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle J=\frac{819}{1024} $$     (Eq.2.2.101) So the particular solution for n=9 \, is:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_{9}=\frac{x^9}{2(9!)}+\frac{27x^8}{4(9!)}+\frac{x^7}{13440}+\frac{x^6}{3840}+\frac{19x^5}{3840}+\frac{17x^4}{512}+\frac{17x^3}{256}+\frac{51x^2}{512}+\frac{307x}{512}+\frac{819}{1024} $$     (Eq.2.2.102) The overall solution for n=3 \, is:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_{3}=C_1e^{2x}+C_2e^x-\frac{x^3}{12}-\frac{3x^2}{8}-\frac{3x}{8}-\frac{3}{16} $$     (Eq.2.2.103) The overall solution for n=5 \, is:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_{5}=C_1e^{2x}+C_2e^x+\frac{x^5}{240}+\frac{x^4}{32}+\frac{x^3}{16}+\frac{3x^2}{32}+\frac{19x}{32}+\frac{51}{64} $$     (Eq.2.2.104) The overall solution for n=9 \, is:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_{9}=C_1e^{2x}+C_2e^x+\frac{x^9}{2(9!)}+\frac{27x^8}{4(9!)}+\frac{x^7}{13440}+\frac{x^6}{3840}+\frac{19x^5}{3840}+\frac{17x^4}{512}+\frac{17x^3}{256}+\frac{51x^2}{512}+\frac{307x}{512}+\frac{819}{1024} $$     (Eq.2.2.105)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Use the initial conditions to solve for the final solutions.

For n=3 \,:
 * {| style="width:100%" border="0"

$$  \displaystyle 1=C_1+C_2-\frac{3}{16} $$     (Eq.2.2.106)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 0=2C_1+C_2-\frac{3}{8} $$     (Eq.2.2.107)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle C_1=-\frac{13}{16} $$     (Eq.2.2.108)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle C_2=2 $$     (Eq.2.2.109) The final solution for n=3 \, is:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_{3}=-\frac{13}{16}e^{2x}+2e^x-\frac{x^3}{12}-\frac{3x^2}{8}-\frac{3x}{8}-\frac{3}{16} $$     (Eq.2.2.110)
 * style="width:25%; padding:10px; border:2px solid #8888aa" |
 * style="width:25%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }



For n=5 \,:
 * {| style="width:100%" border="0"

$$  \displaystyle 1=C_1+C_2+\frac{51}{64} $$     (Eq.2.2.111)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 0=2C_1+C_2+\frac{19}{32} $$     (Eq.2.2.112)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle C_1=-\frac{51}{64} $$     (Eq.2.2.113)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle C_2=1 $$     (Eq.2.2.114) The final solution for n=5 \, is:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_{5}=-\frac{51}{64}e^{2x}+e^x+\frac{x^5}{240}+\frac{x^4}{32}+\frac{x^3}{16}+\frac{3x^2}{32}+\frac{19x}{32}+\frac{51}{64} $$     (Eq.2.2.115)
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * style="width:35%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }



For n=9 \,:
 * {| style="width:100%" border="0"

$$  \displaystyle 1=C_1+C_2+\frac{819}{1024} $$     (Eq.2.2.116)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 0=2C_1+C_2+\frac{307}{512} $$     (Eq.2.2.117)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle C_1=-\frac{819}{1024} $$     (Eq.2.2.118)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle C_2=1 $$     (Eq.2.2.119) The final solution for n=9 \, is:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_{5}=-\frac{819}{1024}e^{2x}+e^{x}+\frac{x^9}{2(9!)}+\frac{27x^8}{4(9!)}+\frac{x^7}{13440}+\frac{x^6}{3840}+\frac{19x^5}{3840}+\frac{17x^4}{512}+\frac{17x^3}{256}+\frac{51x^2}{512}+\frac{307x}{512}+\frac{819}{1024} $$     (Eq.2.2.120)
 * style="width:60%; padding:10px; border:2px solid #8888aa" |
 * style="width:60%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }



Part 3 Given
Refer to Part 1 Given and Part 2 Given.

Part 3 Problem Statement
Find the exact overall solution of $$y(x)$$ and plot it. Then compare that graph to the graphs in Part 2.

Part 3 Solution
The general solution for the particular take the form shown below:
 * {| style="width:100%" border="0"

$$  \displaystyle y_p=K\cos(\omega x)+M\sin(\omega x) $$ (Eq.2.3.1) Therefore, the particular solution is:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_p=K\cos(x)+M\sin(x) $$     (Eq.2.3.2) Take the first and second derivative of Eq. 2.3.2:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_p^\prime=-K\sin(x)+M\cos(x) $$     (Eq.2.3.3)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_p^{\prime\prime}=-K\cos(x)-M\sin(x) $$     (Eq.2.3.4) Then substitute Eq. 2.3.2, 2.3.3, and 2.3.4 into the equation below:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_p^{\prime\prime}-3y_p^\prime+2y_p=\sin(x) $$     (Eq.2.3.5)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle -K\cos(x)-M\sin(x)+3K\sin(x)-3M\cos(x)+2K\cos(x)+2M\sin(x)=\sin(x) $$     (Eq.2.3.6)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle K\cos(x)+M\sin(x)+3K\sin(x)-3M\cos(x)=\sin(x) $$     (Eq.2.3.7) Solve for M and K by like terms (ie. all the \sin(x) terms from each side of Eq. 2.3.7):
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle K-3M=0 $$     (Eq.2.3.8)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle M+3K=1 $$     (Eq.2.3.9)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle K=\frac{3}{10} $$     (Eq.2.3.10)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle M=\frac{1}{10} $$     (Eq.2.3.11) Therefore, the final particular solution is:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_p=\frac{3}{10}\cos(x)+\frac{1}{10}\sin(x) $$     (Eq.2.3.12) The homogeneous solution is Eq. 2.2.34.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Using superimposing the homogeneous and particular solution results in:
 * {| style="width:100%" border="0"

$$  \displaystyle y=\frac{3}{10}\cos(x)+\frac{1}{10}\sin(x)+C_1e^{2x}+C_2e^x $$     (Eq.2.3.13) Now, using the initial conditions from the previous part to find the final solution:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 1=\frac{3}{10}+C_1+C_2 $$     (Eq.2.3.14)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 0=\frac{1}{10}+2C_1+C_2 $$     (Eq.2.3.15)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle C_1=-\frac{8}{10} $$     (Eq.2.3.16)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle C_2=\frac{15}{10} $$     (Eq.2.3.17) Therefore:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y=\frac{3}{10}\cos(x)+\frac{1}{10}\sin(x)-\frac{8}{10}e^{2x}+\frac{15}{10}e^x $$     (Eq.2.3.13)
 * style="width:25%; padding:10px; border:2px solid #8888aa" |
 * style="width:25%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }



The graphs are almost identical to one another.

Author & Proofreaders
Author 1: Egm4313.s12.team17.axelrod.a 20:41, 11 March 2012 (UTC)

Author 2: Egm4313.s12.team17.deaver.md 12:18, 14 March 2012 (UTC))

Proofreader 1: Egm4313.s12.team17.hintz 13:30, 14 March 2012 (UTC)

Proofreader 2: Egm4313.s12.team17.Li 14:12, 14 March 2012 (UTC)

Editor: Egm4313.s12.team17.deaver.md 12:18, 14 March 2012 (UTC)

=Problem R4.3 - Taylor Series Expansion for the Excitations=

Given

 * {| style="width:100%" border="0"

$$  \displaystyle y'' - 3y' + 2y = r(x) $$     (Eq.3.1)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r(x) = log(1+x) $$     (Eq.3.2)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y(-3/4) = 1, y'(-3/4) = 0 $$     (Eq.3.3)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Part 1 Problem Statement
Develop in Taylor series about x=0 \, to reproduce the figure below.



Part 1 Solution
The general function for a Taylor series function about \hat x \,:
 * {| style="width:100%" border="0"

$$  \displaystyle f(x) = \sum_{n=0}^\infty \frac{f^{n} (\hat x)}{n!} (x - \hat x)^n $$     (Eq.3.1.1)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Therefore, the Taylor series for the function can be approximated using equation 3.1.1 about :
 * {| style="width:100%" border="0"

$$  \displaystyle r(x) = \log(1+x) = \sum_{n=0}^\infty \frac{f^{0}(0)}{n!}x^n = \frac{f^{0}(0)}{0!}x^0 + \frac{f^{1}(0)}{1!}x^1 + \frac{f^{2}(0)}{2!}x^2 + \frac{f^{3}(0)}{3!}x^3 + \frac{f^{4}(0)}{4!}x^4 + \frac{f^{5}(0)}{5!}x^5 + \ldots $$     (Eq.3.1.2)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

The derivative of is defined as:
 * {| style="width:100%" border="0"

$$  \displaystyle \frac{d}{dx}\log_b(x) = \frac{1}{x\ln(b)} $$     (Eq.3.1.3)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Therefore the derivative of is:
 * {| style="width:100%" border="0"

$$  \displaystyle \frac{d}{dx}log(1+x) = \frac{1}{(x+1)\ln(10)} $$     (Eq.3.1.4)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Using Eq. 3.1.4 in Eq. 3.1.2 will then give
 * {| style="width:100%" border="0"

$$  \displaystyle r(x) = \log(1+x) = \sum_{n=0}^\infty \frac{f^{0}(0)}{n!}x^0 = \frac{1}{0!}\frac{1}{\ln(10)}x^0 + \frac{1}{1!}\frac{1}{\ln(10)}x^1 - \frac{1}{2!}\frac{1}{\ln(10)}x^2 + \frac{1}{3!}\frac{2}{\ln(10)}x^3 - \frac{1}{4!}\frac{6}{\ln(10)}x^4 + \frac{1}{5!}\frac{24}{\ln(10)}x^5 + \frac{1}{6!}\frac{120}{\ln(10)}x^6 $$     (Eq.3.1.5)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Taking out the common log term (which simplifies to 1) and simplifying Eq. 3.1.5 will give:
 * {| style="width:100%" border="0"

$$  \displaystyle r(x) =\log(1+x) = \frac{1}{\ln(10)} \sum_{n=0}^\infty \frac{f^{0}(0)}{n!}x^n = \frac{1}{\ln10} (0 + \frac{1}{1}x^1 - \frac{1}{2}x^2 + \frac{1}{3}x^3 - \frac{1}{4}x^4 + \frac{1}{5}x^5 - \frac{1}{6}x^6 + \cdots) $$     (Eq.3.1.6)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

The Taylor series equation for the excitation is then:
 * {| style="width:100%" border="0"

$$  \displaystyle r(x) = \log(1+x) = \frac{1}{\ln(10)} \sum_{n=1}^\infty \frac{x^n}{n}(-1)^{n-1} $$     (Eq.3.1.7)
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }

Using the Taylor function in MATLAB, the from above can be reproduced.



Below is the MATLAB code used to generate the above graph:

Part 2 Problem Statement
Let r_n(x) \, be the truncated Taylor series, with n \, terms, which is also the highest degree of the Taylor (power) series, of.

Find y_n(x) \, for that satisfies Eq. 3.1 with the use of Eq. 3.3.

Plot y_n(x) \, for for.

Part 2 Solution
Using Eq.3.1.7, the function r_n(x)\, can be developed for each value of n(4,7,11)\,. We will first solve for y_n(x)\, when n=4\,.


 * {| style="width:100%" border="0"

$$  \displaystyle r_n(x) = \log(1+x) = \frac{1}{\ln(10)} \sum_{n=1}^n \frac{x^n}{n}(-1)^{n-1} $$     (Eq.3.2.1) Where n=4\,:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_4(x) = \frac{1}{\ln(10)} \sum_{n=1}^4 \frac{x^n}{n}(-1)^{n-1} = \frac{1}{\ln(10)}(x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4}) $$     (Eq.3.2.2) Thus, the particular solution to the Eq. 3.2.2 in the Part 2 given is then:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle y_{4,p} = \sum_{i=0}^4 c_i x_i = c_4x^4 + c_3x^3 + c_2x^2 + c_1x + c_0 $$     (Eq.3.2.3)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Deriving Eq. 3.2.3 twice will yield the following:


 * {| style="width:100%" border="0"

$$  \displaystyle y'_{4,p} = 4c_4x^3 + 3c_3x^2 + 2c_2x + c_1 $$     (Eq.3.2.4)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle y''_{4,p} = 12c_4x^2 + 6c_3x + 2c_2 $$     (Eq.3.2.5)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

To solve for the particular solution y_{4,p}\,, Eq. 3.2.4 and Eq. 3.2.5 will be substituted into the following particular equation.


 * {| style="width:100%" border="0"

$$  \displaystyle y''_{4,p} - 3y'_{n,p} + 2y_{4,p} = 12c_4x^2 + 6c_3x + 2c_2 - 3(4c_4x^3 + 3c_3x^2 + 2c_2x + c_1) + 2(c_4x^4 + c_3x^3 + c_2x^2 + c_1x + c_0) $$     (Eq.3.2.6)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Combining like terms, Eq. 3.2.6 simplifies to:
 * {| style="width:100%" border="0"

$$  \displaystyle (2c_4x^4) + (2c_3x^3 - 12c_4x^3) + (-9c_3x^2 + 2c_2x^2 + 12c_4x^2) + (2c_1x - 6c_2x + 6c_3x) + (2c_2 + c_0 - 3c_1) = \frac{1}{\ln(10)} (x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4}) $$     (Eq.3.2.7)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

The coefficients of each corresponding term can be substituted into an upper triangular matrix that can be easily solved by using matrices in MATLAB.

The following is the code which generated the values $$c_0,c_1,c_2,c_3,c_4$$:


 * {| style="width:100%" border="0"

$$  \displaystyle c_0 = -1.7643 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_1 = -1.7915 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_2 = -0.9229 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_3 = -0.2533 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_4 = -0.0543 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Finally the particular solution has been reached. The solution $$y_4(x)\,$$ is then:


 * {| style="width:100%" border="0"

$$  \displaystyle y_{4} = y_{4,h}(x) -0.0543x^4 -0.2533x^3 -0.9229x^2 -1.7915x -1.7643 $$     (Eq.3.2.8)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Where $$y_{n,h}(x)\,$$ is solved by setting Eq. 3.1 to 0 and finding the roots:


 * {| style="width:100%" border="0"

$$  \displaystyle y'' - 3y' + 2y = 0 = \lambda^2 - 3\lambda + 2 = 0 $$     (Eq.3.2.9)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle y'' - 3y' + 2y = 0 = \lambda^2 - 3\lambda + 2 = 0 $$     (Eq.3.2.10)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle (\lambda - 2)(\lambda - 2) = 0 $$     (Eq.3.2.11)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle \lambda = 2,1 $$     (Eq.3.2.12)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Therefore, the homogeneous solution is then:


 * {| style="width:100%" border="0"

$$  \displaystyle y_{n,h}(x) = c_6e^{2x} + c_5e^x $$     (Eq.3.2.13)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Which then generates the final solution $$y_4(x)\,$$:


 * {| style="width:100%" border="0"

$$  \displaystyle y_{4} = c_6e^{2x} + c_5e^x -0.0543x^4 -0.2533x^3 -0.9229x^2 -1.7915x -1.7643 $$     (Eq.3.2.14)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Thus to solve for the final coefficients I used a MATLAB code to generated matrices to solve for the final two unknowns:

The values then come out to be:
 * {| style="width:100%" border="0"

$$  \displaystyle c_6 = -30.511 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_5 = 23.777 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle y_{4} = -30.511e^{2x} + 23.777e^x -0.0543x^4 -0.2533x^3 -0.9229x^2 -1.7915x -1.7643 $$     (Eq.3.2.15)
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle r_n(x) = \log(1+x) = \frac{1}{\ln(10)} \sum_{n=1}^n \frac{x^n}{n}(-1)^{n-1} $$     (Eq.3.2.16) Where n=7 \,:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_7(x) = \frac{1}{\ln(10)} \sum_{n=1}^7 \frac{x^n}{n}(-1)^{n-1} = \frac{1}{10}(x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4} + \frac{x^5}{5} - \frac{x^6}{6} + \frac{x^7}{7}) $$     (Eq.3.2.17)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_{7,p} = \sum_{i=0}^7 c_i x_i = c_7x^7 + c_6x^6 + c_5x^5 + c_4x^4 + c_3x^3 + c_2x^2 + c_1x + c_0 $$     (Eq.3.2.18)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Deriving Eq. 3.2.18 twice will yield the following:


 * {| style="width:100%" border="0"

$$  \displaystyle y'_{7,p} = 7c_7x^6 + 6c_6x^5 + 5c_5x^4 + 4c_4x^3 + 3c_3x^2 + 2c_2x + c_1 $$     (Eq.3.2.19)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle y''_{7,p} = 42c_7x^5 + 30c_6x^4 + 20c_5x^3 + 12c_4x^2 + 6c_3x + 2c_2 $$     (Eq.3.2.20)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

To solve for the particular solution y_7(x) \,, Eq. 3.2.19 and Eq. 3.2.20 will be substituted into the following particular equation:


 * {| style="width:100%" border="0"

$$  \displaystyle y''_{7,p} - 3y'_{7,p} + 2y_{7,p} = $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle 42c_7x^5 + 30c_6x^4 + 20c_5x^3 + 12c_4x^2 + 6c_3x + 2c_2 - 3(7c_7x^6 + 6c_6x^5 + 5c_5x^4 + 4c_4x^3 + 3c_3x^2 + 2c_2x + c_1) + 2(c_7x^7 + c_6x^6 + c_5x^5 + c_4x^4 + c_3x^3 + c_2x^2 + c_1x + c_0) $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle - 3(7c_7x^6 + 6c_6x^5 + 5c_5x^4 + 4c_4x^3 + 3c_3x^2 + 2c_2x + c_1) + 2(c_7x^7 + c_6x^6 + c_5x^5 + c_4x^4 + c_3x^3 + c_2x^2 + c_1x + c_0) $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle + 2(c_7x^7 + c_6x^6 + c_5x^5 + c_4x^4 + c_3x^3 + c_2x^2 + c_1x + c_0) $$ Combining like terms, Eq. 3.2.6 simplifies to:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle 2c_7x^7 + (2c_6x^6 -21c_7x^6) + (2c_5x^5 - 18c_6x^5 + 42c_7x^5) + (2c_4x^4- 15c_5x^4+30c_6x^4 ) + (2c_3x^3 - 12c_4x^3 + 20c_5x^3) + (2c_2x^2 - 9c_3x^2 + 12c_4x^2) $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle + (2c_1x - 6c_2x + 6c_3x) + (2c_0 - 3c_1 + 2c_2) = \frac{1}{\ln(10)}(x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4} + \frac{x^5}{5} - \frac{x^6}{6} + \frac{x^7}{7}) $$     (Eq.3.2.22) The coefficients of each corresponding term can be substituted into an upper triangular matrix that can be easily solved by using matrices in MATLAB.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

The following is the code which generated the values $$c_0,c_1,c_2,c_3,c_4,c_5,c_6,c_7\,$$


 * {| style="width:100%" border="0"

$$  \displaystyle c_0 = 268.25 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_1 = 267.25 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_2 = 132.62 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_3 = 43.610 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_4 = 10.59 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_5 = 1.998 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_6 = 0.2895 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_7 = 0.03102 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Finally the particular solution has been reached. The solution y_7(x) \, is then:


 * {| style="width:100%" border="0"

$$  \displaystyle y_{7} = y_{n,h}(x) + 0.03102x^7 + 0.2895x^6 + 1.998x^5 + 10.59x^4 + 43.610x^3 + 132.62x^2 + 267.25x + 268.25 $$     (Eq.3.2.23)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

The homogeneous solution is the same:
 * {| style="width:100%" border="0"

$$  \displaystyle y_{n,h}(x) = c_9e^{2x} + c_8e^x $$     (Eq.3.2.24)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Which then makes the solution:


 * {| style="width:100%" border="0"

$$  \displaystyle y_{7} = c_9e^{2x} + c_8e^x + 0.03102x^7 + 0.2895x^6 + 1.998x^5 + 10.59x^4 + 43.610x^3 + 132.62x^2 + 267.25x + 268.25 $$     (Eq.3.2.25)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Using the same MATLAB code but adjusting certain formulas, $$c_9,c_8\,$$ can be found:

The following values for $$c_9,c_8\,$$ are obtained:


 * {| style="width:100%" border="0"

$$  \displaystyle c_9 = -4.002 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_8 = -264.73 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

The final solution is then:
 * {| style="width:100%" border="0"

$$  \displaystyle y_{7}(x) = -4.002e^{2x} -264.73e^x + 0.03102x^7 + 0.2895x^6 + 1.998x^5 + 10.59x^4 + 43.610x^3 + 132.62x^2 + 267.25x + 268.25 $$     (Eq.3.2.26)
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle r_{11}(x) = log(1+x) = \frac{1}{\ln(10)}\sum_{n=1}^{11} \frac{x^n}{n}(-1)^{n-1} $$     (Eq.3.2.27) Where n=11 \,:
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle r_{11}(x) = \frac{1}{\ln(10)} \sum_{n=1}^{11} \frac{x^n}{n}(-1)^{n-1} =\frac{1}{\ln(10)}(x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4} + \frac{x^5}{5} - \frac{x^6}{6} + \frac{x^7}{7} - \frac{x^8}{8} + \frac{x^9}{9} - \frac{x^{10}}{10} + \frac{x^{11}}{11}) $$     (Eq.3.2.28)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle y_{11,p} = \sum_{i=0}^{11} c_i x_i = c_{11}x^{11}+c_{10}x^{10}+c_9x^9+c_8x^8 + c_7x^7 + c_6x^6 + c_5x^5 + c_4x^4 + c_3x^3 + c_2x^2 + c_1x + c_0 $$     (Eq.3.2.29)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Deriving Eq.3.2.28 twice will yield the following:


 * {| style="width:100%" border="0"

$$  \displaystyle y'_{11,p} = 11c_{11}x^{10} + 10c_{10}x^9 + 9c_9x^8 + 8c_8x^7 + 7c_7x^6 + 6c_6x^5 + 5c_5x^4 + 4c_4x^3 + 3c_3x^2 + 2c_2x + c_1 $$     (Eq.3.2.30)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle y''_{11,p} = 110c_{11}x^9 + 90c_{10}x^8 + 72c_9x^7 + 56c_8x^6 + 42c_7x^5 + 30c_6x^4 + 20c_5x^3 + 12c_4x^2 + 6c_3x + 2c_2 $$     (Eq.3.2.31)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

To solve for the particular solution, Eq. 3.2.29 and Eq. 3.2.30 will be substituted into the following particular equation.


 * {| style="width:100%" border="0"

$$  \displaystyle y''_{11,p} - 3y'_{11,p} + 2y_{11,p} = $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle 110c_{11}x^9 + 90c_{10}x^8 + 72c_9x^7 + 56c_8x^6+42c_7x^5 + 30c_6x^4 + 20c_5x^3 + 12c_4x^2 + 6c_3x + 2c_2 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle - 3(11c_{11}x^{10} + 10c_{10}x^9 + 9c_9x^8 + 8c_8x^7 + 7c_7x^6 + 6c_6x^5 + 5c_5x^4 + 4c_4x^3 + 3c_3x^2 + 2c_2x + c_1) $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle + 2(c_{11}x^{11}+c_{10}x^{10}+c_9x^9+c_8x^8 + c_7x^7 + c_6x^6 + c_5x^5 + c_4x^4 + c_3x^3 + c_2x^2 + c_1x + c_0) $$     (Eq.3.2.32)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Combining like terms, Eq. 3.2.6 simplifies to:
 * {| style="width:100%" border="0"

$$  \displaystyle 2c_{11}x^{11} + (2c_{10}x^{10}-33c_{11}x^{10}) + (2c_9x^9 - 30c_{10}x^9 + 110c_{11}x^9) + (2c_8x^8 - 27c_9x^8 + 90c_{10}x^8) $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle + (2c_7x^7 - 24c_8x^7 + 72c_9x^7) + (2c_6x^6 -21c_7x^6 + 56c_8x^6) + (2c_5x^5 - 18c_6x^5 + 42c_7x^5) + (2c_4x^4- 15c_5x^4+30c_6x^4) $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle + (2c_3x^3 - 12c_4x^3 + 20c_5x^3) + (2c_2x^2 - 9c_3x^2 + 12c_4x^2) + (2c_1x - 6c_2x + 6c_3x) + (2c_0 - 3c_1 + 2c_2) $$     (Eq.3.2.33) The coefficients of each corresponding term can be substituted into an upper triangular matrix that can be easily solved by using matrices in MATLAB.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

The following is the code which generated the values $$c_0,c_1,c_2,c_3,c_4,c_5,c_6,c_7,c_8,c_9,c_{10},c_{11}\,$$


 * {| style="width:100%" border="0"

$$  \displaystyle c_0 = 1.433640(10^6) $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_1 = 1.433318(10^6) $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_2 = 716337.8315 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_3 = 238564.9257 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_4 = 59534.0376 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_5 = 11863.9372 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_6 = 1963.0291 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_7 = 276.3509 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_8 = 33.5221 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_9 = 3.4985 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_{10} = 0.304006137 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_{11} = 0.019740658 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Finally the particular solution has been reached. The solution y_{11} \, is then:


 * {| style="width:100%" border="0"

$$  \displaystyle y_{11} = y_{11,h}(x) +0.019740658x^{11}+0.304006137x^{10}+3.4985x^9+33.5221x^8+276.3509x^7 + $$ $$  \displaystyle 1963.0291x^6 +11863.9372x^5+59534.0376x^4+238564.9257x^3 +716337.8315x^2 +1433318.934x +1433640.5704 $$     (Eq.3.2.34)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

The homogeneous solution is the same:
 * {| style="width:100%" border="0"

$$  \displaystyle y_{n,h}(x) = c_9e^{2x} + c_8e^x $$     (Eq.3.2.35)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Which then makes the solution simplifies Eq. 3.2.34


 * {| style="width:100%" border="0"

$$  \displaystyle y_{11}= c_{13}e^{2x} + c_{12}e^x +0.019740658x^{11}+0.304006137x^{10}+3.4985x^9+33.5221x^8+276.3509x^7 $$ $$  \displaystyle +1963.0291x^6 +11863.9372x^5+59534.0376x^4+238564.9257x^3 +716337.8315x^2 +1433318.934x +1433640.5704 $$     (Eq.3.2.36)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Using the same matlab code but adjusting certain formulas, $$c_{13},c_{12}\,$$ can be found:

The following values for $$c_{13},c_{12}\,$$ are obtained:


 * {| style="width:100%" border="0"

$$  \displaystyle c_{13} = 315.5842 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle c_{12} = -1433957.1455 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

The final solution is then:
 * {| style="width:100%" border="0"

$$  \displaystyle y_{11}(x) = 315.5842e^{2x} -1433957.1455e^x +0.019740658x^{11}+0.304006137x^{10}+3.4985x^9+33.5221x^8+276.3509x^7 $$
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style="width:15%; padding:10px; border:2px solid #8888aa" |

$$  \displaystyle +1963.0291x^6 +11863.9372x^5+59534.0376x^4+238564.9257x^3 +716337.8315x^2 +1433318.934x +1433640.5704 $$     (Eq.3.2.37)
 * <p style="text-align:right">
 * }

Below are the three corresponding graphs to the n=4,7,11



Part 3 Problem Statement
3. Use the matlab code ode45 to integrate numerically (5) p.7b-7 with (1)-(2) p.7-28 to obtain the numerical soln for y(x). Plot $$y_n(x)$$ in the same plot as y(x)

Part 3 Solution
M-file code used to set up the ODE

Command Window code to use the ode45 function and to plot the results

This is the graph from the above matlab code (ode45 function is green line)



The picture shows us that the solution using ode45 is exactly the same as the taylor series of log(1+x) where n = 7

Author & Proofreaders
Author:Egm4313.s12.team17.ying 09:13, 12 March 2012 (UTC)

Proofreader 1: Egm4313.s12.team17.wheeler.tw 23:15, 12 March 2012 (UTC)

Proofreader 2: Egm4313.s12.team17.Li 07:15, 13 March 2012 (UTC)

Editor: Egm4313.s12.team17.deaver.md 14:05, 14 March 2012 (UTC)

=Problem R4.4 - Extend the Accuracy of the Solution beyond the Initial Point=

Given

 * {| style="width:100%" border="0"

$$  \displaystyle \log(1+x) $$     (Eq.4.1)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


 * {| style="width:100%" border="0"

$$  \displaystyle x_1 = 0.9 $$     (Eq.4.1)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Part 1 Statement
Extend the accuracy of the solution beyond \hat x=1 \,.

Consider x_1=0.9 \, and find the value n \, for, so that it doesn't differ from the numerical solution by more than 10^{-5} \,.

Part 2 Statement
2. Develop log(1+x) in taylor series about x^hat = 1 for n = 4,7,11 and plot these truncated series vs the exact function.

What is now the domain convergence? (by observation of you results.)

Part 2 Solution
The general function for a Taylor series function about
 * {| style="width:100%" border="0"

$$  \displaystyle f(x) = \sum_{n=0}^\infty \frac{f^{n} (\hat x)}{n!} (x - \hat x)^n $$     (Eq.4.4.1)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Therefore, the Taylor series for the function r(x) = log(1+x) can be approximated using equation 3.1.1 about $$\hat x = 1$$
 * {| style="width:100%" border="0"

$$  \displaystyle r(x) = \log(1+x) = \sum_{n=0}^\infty \frac{f^{n}(1)}{n!}(x-1)^n = \frac{f^{0}(1)}{0!}(x-1)^0 + \frac{f^{1}(1)}{1!}(x-1)^1 + \frac{f^{2}(1)}{2!}(x-1)^2 + \frac{f^{3}(1)}{3!}(x-1)^3 + \frac{f^{4}(1)}{4!}(x-1)^4 + \frac{f^{5}(1)}{5!}(x-1)^5 + \ldots $$     (Eq.4.4.2)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

The derivative of $$\log_b(x)$$ is defined as
 * {| style="width:100%" border="0"

$$  \displaystyle \frac{d}{dx}\log_b(x) = \frac{1}{(x)\ln(b)} $$     (Eq.4.4.3)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Therefore the derivative of $$\log(1+x)$$ is


 * {| style="width:100%" border="0"

$$  \displaystyle \frac{d}{dx}\log(1+x) = \frac{1}{(1+x)\ln(10)} $$     (Eq.4.4.4)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Using Eq.4.4.4 in Eq.4.4.2 will then give
 * {| style="width:100%" border="0"

$$  \displaystyle r(x) = \sum_{n=0}^\infty \frac{f^{n}(1)}{n!}(x-1)^n = \frac{1}{(2)\ln(10)}\frac{1}{0!}(x-1)^0 + \frac{1}{(2)\ln(10)}\frac{1}{1!}(x-1)^1 - \frac{1}{(2)\ln(10)}\frac{1}{2!}(x-1)^2 + \frac{1}{(2)\ln(10)}\frac{1}{3!}(x-1)^3 - \frac{1}{(2)\ln(10)}\frac{1}{4!}(x-1)^4 + \cdots $$     (Eq.4.4.5)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Simplifying Eq. 4.4.5 will give:
 * {| style="width:100%" border="0"

$$  \displaystyle r(x) = \frac{1}{2\ln(10)} \sum_{n=0}^\infty \frac{f^{0}(0)}{n!}(x-1)^n = \frac{1}{2\ln(10)}\Bigg(0 + \frac{1}{1!}(x-1)^1 - \frac{1}{2}(x-1)^2 + \frac{1}{3}(x-1)^3 - \frac{1}{4}(x-1)^4 + \frac{1}{5}(x-1)^5 + \cdots\Bigg) $$     (Eq.4.4.6)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

The Taylor series equation for the excitation is then:
 * {| style="width:100%" border="0"

$$  \displaystyle r(x) = \log(1+x) = \frac{1}{2\ln(10)} \sum_{n=0}^n \frac{(x-1)^n}{n!}(-1)^{n-1} $$     (Eq.4.4.7)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

For n = 4 the Taylor Series has already been solved above in Eq.4.4.6
 * {| style="width:100%" border="0"

$$  \displaystyle \sum_{n=0}^4 \frac{(x-1)^n}{n!}(-1)^{n-1}= \frac{1}{2\ln(10)}\Bigg(\frac{1}{1!}(x-1)^1 - \frac{1}{2}(x-1)^2 + \frac{1}{3}(x-1)^3 - \frac{1}{4}(x-1)^4\Bigg) $$     (Eq.4.4.8.a)
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }

For n = 7 the Taylor Series Expansion is
 * {| style="width:100%" border="0"

$$  \displaystyle \sum_{n=0}^4 \frac{(x-1)^n}{n!}(-1)^{n-1}= \frac{1}{2\ln(10)}\Bigg(\frac{1}{1!}(x-1)^1 - \frac{1}{2}(x-1)^2 + \frac{1}{3}(x-1)^3 - \frac{1}{4}(x-1)^4 + \frac{1}{5}(x-1)^5 -\frac{1}{6}(x-1)^6+ \frac{1}{7}(x-1)^7\Bigg) $$     (Eq.4.4.8.b)
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }

And Finally for n=11 the Taylor Series Expansion is
 * {| style="width:100%" border="0"

$$  \displaystyle \sum_{n=0}^4 \frac{(x-1)^n}{n!}(-1)^{n-1} = \frac{1}{2\ln(10)}\Bigg(\frac{1}{1!}(x-1)^1 - \frac{1}{2}(x-1)^2 + \frac{1}{3}(x-1)^3 - \frac{1}{4}(x-1)^4 + \frac{1}{5}(x-1)^5 $$ $$  \displaystyle    -\frac{1}{6}(x-1)^6+ \frac{1}{7}(x-1)^7 - \frac{1}{8}(x-1)^8 + \frac{1}{9}(x-1)^9 -\frac{1}{10}(x-1)^{10} + \frac{1}{11}(x-1)^{11}\Bigg) $$     (Eq.4.4.8.c)
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * style="width:15%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }

Here is the graph of the taylor series of log(1+x) about center point 1 compared to the exact function:

The domain of convergence based on observation is [-0.5 1.5]

Part 3 Statement
Find $$y_n(x)$$, for n = 4,7,11 such that:

$$y''_{n} + ay'_{n} + by_{n} = r_n(x)$$

for x in [0.9,3] with the initial conditions found i.e

$$y_n(x_1), y'_n(x_1)$$

plot $$y_n(x)$$ for n = 4,7,11 for x in [0.9,3]

Part 4 Statement
4. Use the matlab command ode45 to integrate numerically (5) p.7b-7 ($$ y'' - 3y' + 2y$$) with (1) p.7-28 ($$log(1+x)$$) and the initial conditions $$y_n(x_1), y'_n(x_1)$$ to obtain the numerical soln for $$y(x)$$.

plot $$y_n(x)$$ in the same figure $$y_n(x)$$

Part 4 Solution
M-file code used to set up the ODE

Command Window code to use the ode45 function and to plot the results

Author & Proofreaders
Author :Egm4313.s12.team17.ying 14:10, 14 March 2012 (UTC)

Proofreader: Egm4313.s12.team17.wheeler.tw 14:12, 14 March 2012 (UTC)

Editor: Egm4313.s12.team17.deaver.md 15:22, 14 March 2012 (UTC)

= Contributing Team Members =