User:Eml5526.s11.team2/hwk3

=Problem 3.1: Rework Problem 2.9 using the given polynomial basis.=

Given

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

$$  \displaystyle 2\frac{d^2u}{dx^2}+3=0 $$     (3.1)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

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

$$  \displaystyle u(x=1)=0 $$     (3.2)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle -\frac{du}{dx}(x=0)=4 $$     (3.3)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle b_j=(x+1)^j $$     (3.4) The exact solution to Eq.3.1:
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle u(x)=-\frac{3}{4}x^2-4x+\frac{19}{4} $$     (3.5)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Find
We want to find an approximation to Eq.3.5 in the form of
 * {| style="width:100%" border="0"

$$  \displaystyle u^h(x)=\sum_{i=0}^n a_ib_i $$     (3.6) as well as investigate how the accuracy of our approximation changes with n going from 2 to 4 and then 6.
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Case:n=2
First let's expand Eq.3.6 out to n=2 terms.
 * {| style="width:100%" border="0"

$$  \displaystyle u^h(x)=a_0b_0+a_1b_1+a_2b_2 $$     (3.7) Now consider Eq.3.4, and substitute the appropriate terms into Eq.3.7.
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle u^h(x)=a_0(1)+a_1(x+1)+a_2(x+1)^2 $$     (3.8) Let's rewrite this equation in terms of a product between 2 vectors.
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle u^h(x)=\left[1\quad x+1\quad (x+1)^2\right ]\begin{bmatrix} a_0\\a_1\\a_2\end{bmatrix} $$     (3.9) In order for us to solve for the unknown $$a_i's$$ in Eq.3.9, we must have 3 linearly independent equations describing linear combinations of the $$a_i's.$$Two of the equations are easily obtained directly from the given boundary conditions in Eq.3.2 and Eq.3.3. It only makes practical sense that if we want our approximation to closely resemble our exact solution, we must require identical behavior between Eq.3.5 and Eq.3.8 at the boundaries.
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \begin{align} u^h(x=1)=a_0(1)+a_1(1+1)+a_2(1+1)^2&=0\\ a_0(1)+a_1(2)+a_2(2)^2&=0 \end{align} $$     (3.10)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle a_0+2a_1+4a_2=0 $$     (3.11)
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \frac{du}{dx}(x=0)=a_1+a_22(0+1)=-4 $$     (3.12)
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


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

$$  \displaystyle a_1+2a_2=-4 $$     (3.13) Now we just need one more linearly independent equation and we can then readily solve for the $$a_i's.$$ To develop another set of equations which are linearly independent of Eq.3.11 and Eq.3.13, we take the inner product between our approximation of u(x), Eq.3.9 and our basis set of functions Eq.3.4. Before getting to the inner product first, let's define our linear differential operator as the following
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle P(\cdot)=\frac{d^2}{dx^2}+\frac{3}{2}=0 $$     (3.14) Now, using our operator in Eq.3.14, we can now operate on our approximation in Eq.3.9.
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \begin{align} P(u^h)=\frac{d^2}{dx^2}\left[1\quad x+1\quad (x+1)^2\right ]\begin{bmatrix} a_0\\a_1\\a_2\end{bmatrix}+\frac{3}{2}&=0\\ \left[0\quad 0\quad 2\right ]\begin{bmatrix} a_0\\a_1\\a_2\end{bmatrix}+\frac{3}{2}&=0 \end{align} $$     (3.15) Which we can then rewrite Eq.3.15 as
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \left[0\quad 0\quad 2\right ]\begin{bmatrix} a_0\\a_1\\a_2\end{bmatrix}=-\frac{3}{2} $$     (3.16) Now, we are in a position to take the inner product of Eq.3.16(our approximation) with the basis set in Eq.3.4 with $$ n=2.$$
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \left \langle b_j, P(u^h) \right \rangle =\int_0^1b_jP(u^h)=0 $$     (3.17)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \int_0^1\begin{bmatrix} 1\\x+1\\(x+1)^2\end{bmatrix} \left[0\quad 0\quad 2\right ]\,dx\begin{bmatrix} a_0\\a_1\\a_2\end{bmatrix}=-\frac{3}{2}\int_0^1\begin{bmatrix} 1\\x+1\\(x+1)^2\end{bmatrix}\,dx $$     (3.18)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \int_0^1\begin{bmatrix} 0&0&2\\0&0&2(x+1)\\0&0&2(x+1)^2\end{bmatrix}\,dx\begin{bmatrix} a_0\\a_1\\a_2\end{bmatrix}=-\frac{3}{2}\int_0^1\begin{bmatrix} 1\\x+1\\(x+1)^2\end{bmatrix}\,dx $$     (3.19)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \begin{bmatrix} 0&0&2\\0&0&3\\0&0&14/3\end{bmatrix}\begin{bmatrix} a_0\\a_1\\a_2\end{bmatrix}=\begin{bmatrix} -3/2\\-9/4\\-7/2\end{bmatrix} $$     (3.20) We can use any one of the above expressions as our $$3^{rd}$$ equation to solve for our unknown $$ a_i's$$, along with Eq.3.11 and Eq.3.13. Let's randomly just choose the $$3^{rd}$$row in Eq.3.20 as our $$3^{rd}$$ relationship and then, using Eq.3.11 and Eq.3.13, we can form the following matrix equation.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \begin{bmatrix} 1&2&4\\0&1&2\\0&0&14/3\end{bmatrix}\begin{bmatrix} a_0\\a_1\\a_2\end{bmatrix}=\begin{bmatrix}0\\-4\\7/2\end{bmatrix} $$     (3.21) Let's solve for the inverse of the matrix in Eq.3.21 using the Gauss-Jordan Method. Letting the matrix above in Eq.3.21 equal $$\mathbf{K}$$, we can find $$\mathbf{K^{-1}}$$ by
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \begin{align} \mathbf{K}\cdot\mathbf{I}&=\begin{bmatrix} 1&2&4&1&0&0\\0&1&2&0&1&0\\0&0&14/3&0&0&1\end{bmatrix}\\ &=\begin{bmatrix} 1&0&0&1&-2&0\\0&1&2&0&1&0\\0&0&14/3&0&0&1\end{bmatrix}\\ &=\begin{bmatrix} 1&0&0&1&-2&0\\0&1&0&0&1&-6/14\\0&0&14/3&0&0&1\end{bmatrix}\\ &=\begin{bmatrix} 1&0&0&1&-2&0\\0&1&0&0&1&-6/14\\0&0&1&0&0&3/14\end{bmatrix} \end{align} $$     (3.22)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \therefore \mathbf{K^{-1}}=\begin{bmatrix}1&-2&0\\0&1&-6/14\\0&0&3/14\end{bmatrix} $$     (3.23) Now using Eq.3.23, we can solve Eq.3.21 for our unknown $$a_i's.$$
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \mathbf{K^{-1}}\cdot \mathbf{K}\begin{bmatrix} a_0\\a_1\\a_2\end{bmatrix}=\mathbf{K^{-1}}\begin{bmatrix}0\\-4\\-7/2\end{bmatrix} $$     (3.24)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \begin{bmatrix} a_0\\a_1\\a_2\end{bmatrix} = \begin{bmatrix}1&-2&0\\0&1&-6/14\\0&0&3/14\end{bmatrix}\begin{bmatrix}0\\-4\\7/2\end{bmatrix} $$     (3.25)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \begin{bmatrix} a_0\\a_1\\a_2\end{bmatrix}=\begin{bmatrix}8\\-5/2\\-3/4\end{bmatrix} $$     (3.26) Egm5526.s11.team-2.langpm 14:35, 14 February 2011 (UTC)
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }

Solution

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

$$  \displaystyle \therefore u^h(x)=8-\frac{5}{2}(x+1)-\frac{3}{4}(x+1)^2 $$     (3.27) Now. let's check the absolute error between our approximate solution above in Eq. 3.26 and our exact solution in Eq.3.5.
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \begin{align} \Delta \mathbf{E_{abs}}=u^h(x=0.5)-u(x=0.5) \end{align} $$     (3.28)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


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

$$  \displaystyle \begin{align} u^h(x=0.5)&=8-\frac{5}{2}(0.5+1)-\frac{3}{4}(0.5+1)^2\\ &=41/16 \end{align} $$     (3.29)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \begin{align} u(x=0.5)&=-\frac{3}{4}(0.5)^2-4(0.5)+\frac{19}{4}\\ &=41/16 \end{align} $$     (3.30)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \therefore \Delta \mathbf{E_{abs}}=0 $$     (3.31) Therefore, we can see from both the graph and the absolute error that our approximation in Eq.3.26 to the solution of the differential equation (Eq.3.1) gives the same results as our exact solution. Egm5526.s11.team-2.langpm 14:35, 14 February 2011 (UTC)
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }

Graphical Comparison Between Exact and Numerical Approximate Solutions
Egm5526.s11.team-2.langpm 14:37, 14 February 2011 (UTC)

Case:n=4
We will follow exactly the same methodology as we have above, leaving out the explanations for each step.
 * {| style="width:100%" border="0"

$$  \displaystyle u^h(x)=a_0b_0+a_1b_1+a_2b_2+a_3b_3+a_4b_4 $$     (3.32)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle u^h(x)=a_0(1)+a_1(x+1)+a_2(x+1)^2+a_3(x+1)^3+a_4(x+1)^4 $$     (3.33)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle u^h(x)=\begin{bmatrix}1 & x+1 & (x+1)^2 & (x+1)^3 & (x+1)^4 \end{bmatrix}\begin{bmatrix}a_0\\a_1\\a_2\\a_3\\a_4 \end{bmatrix} $$     (3.34) Using our given boundary conditions to obtain our first 2 linearly independent equations.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \begin{align} u^h(x=1)&=a_0(1)+a_1(1+1)+a_2(1+1)^2+a_3(1+1)^3+a_4(1+1)^4\\ &=a_0(1)+2a_1+4a_2+8a_3+16a_4 \end{align} $$     (3.35)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


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

$$  \displaystyle a_0(1)+2a_1+4a_2+8a_3+16a_4=0 $$     (3.36)
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }


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

$$  \displaystyle \frac{du^h}{dx}(x=0)=a_1+2a_2+3a_3+4a_4 $$     (3.37)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


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

$$  \displaystyle a_1+2a_2+3a_3+4a_4 =-4 $$     (3.38) Using our predefined linear differential operator in Eq.3.14.
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle P(u^h)=\frac{d^2}{dx^2}\begin{bmatrix}1 & x+1 & (x+1)^2 & (x+1)^3 & (x+1)^4 \end{bmatrix}\begin{bmatrix}a_0\\a_1\\a_2\\a_3\\a_4 \end{bmatrix} + \frac{3}{2} $$     (3.39) Because this time we have 5 unknown $$a_i's,$$ we will have to choose 3 equations from our inner product operation.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \left \langle b_i,P(u^h) \right \rangle =\int_0^1b_iP(u^h)=0 $$     (3.40)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


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

$$  \displaystyle \int_0^1\begin{bmatrix}1\\x+1\\(x+1)^2\\(x+1)^3\\(x+1)^4\end{bmatrix}\begin{bmatrix}0 & 0 & 2 & 6(x+1) & 12(x+1)^2 \end{bmatrix}\,dx \begin{bmatrix}a_0\\a_1\\a_2\\a_3\\a_4\end{bmatrix}=-\frac{3}{2}\int_0^1\begin{bmatrix}1\\x+1\\(x+1)^2\\(x+1)^3\\(x+1)^4\end{bmatrix}\, dx $$ (3.41)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


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

$$  \displaystyle \int_0^1\begin{bmatrix} 0 & 0 & 2 & 6(x+1) & 12(x+1)^2\\ 0 & 0 & 2(x+1) & 6(x+1)^2 & 12(x+1)^3\\ 0 & 0 & 2(x + 1)^2 & 6(x+1)^3 & 12(x+1)^4\\ 0 & 0 & 2(x+1)^3 & 6(x+1)^4 & 12(x+1)^5\\ 0 & 0 & 2(x+1)^4 & 6(x+1)^5 & 12(x+1)^6 \end{bmatrix}\,dx \begin{bmatrix}a_0\\a_1\\a_2\\a_3\\a_4\end{bmatrix}=-\frac{3}{2}\int_0^1\begin{bmatrix}1\\x+1\\(x+1)^2\\(x+1)^3\\(x+1)^4\end{bmatrix}\, dx $$ (3.42)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


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

$$  \displaystyle \begin{bmatrix} 0 & 0 & 2 & 9 & 28\\ 0 & 0 & 3 & 14 & 45\\                                       0 & 0 & 14/3 & 45/2 & 372/5\\                                         0 & 0 & 15/2 & 186/5 & 126\\                                         0 & 0 & 62/5 & 63 & 1524/7 \end{bmatrix} \begin{bmatrix}a_0\\a_1\\a_2\\a_3\\a_4\end{bmatrix}=-\begin{bmatrix}3/2\\ 9/4 \\ 7/2 \\ 45/8 \\ 93/10 \end{bmatrix} $$     (3.43) Now we can use the bottom three rows of Eq.3.43, along with Eq.3.36 and Eq.3.38 to develop a system of equations
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \begin{bmatrix} 1 & 2 & 4 & 8 & 16\\ 0 & 1 & 2 & 3 & 4\\                                       0 & 0 & 14/3 & 45/2 & 372/5\\                                         0 & 0 & 15/2 & 186/5 & 126\\                                         0 & 0 & 62/5 & 63 & 1524/7 \end{bmatrix} \begin{bmatrix}a_0\\a_1\\a_2\\a_3\\a_4\end{bmatrix}=-\begin{bmatrix} 0 \\ 4 \\ 7/2 \\ 45/8 \\ 93/10 \end{bmatrix} $$     (3.44)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Using a MATLAB script which I wrote (the code is detailed below) to solve for the unknown $$a_i's$$ we can then solve for our approximate expression and see if we get better results than in the $$ n=2$$ case.


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

$$  \displaystyle \begin{bmatrix}a_0\\a_1\\a_2\\a_3\\a_4\end{bmatrix}=\begin{bmatrix} 8 \\ -5/2 \\ -3/4 \\ 0 \\ 0 \end{bmatrix} $$     (3.45) Egm5526.s11.team-2.langpm 14:37, 14 February 2011 (UTC)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Solution

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

$$  \displaystyle \therefore u^h(x)=8-\frac{5}{2}(x+1)-\frac{3}{4}(x+1)^2 $$     (3.46) We can see from above in Eq.3.46 that our solution did not improve at all by an increase in n from 2 to 4. Egm5526.s11.team-2.langpm 14:37, 14 February 2011 (UTC)
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }

Graphical Comparison Between Exact and Numerical Approximate Solutions
Egm5526.s11.team-2.langpm 14:38, 14 February 2011 (UTC)

Case:n=6

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

$$  \displaystyle \begin{align} u^h(x) &= a_0b_0+a_1b_1+a_2b_2+a_3b_3+a_4b_4+a_5b_5+a_6b_6\\ &=a_0+a_1(x+1)+a_2(x+2)^2+a_3(x+1)^3+a_4(x+1)^4+a_5(x+1)^5+a_6(x+1)^6 \end{align} $$     (3.47) Using the given boundary conditions in Eq.3.2 and Eq.3.3 we have the following to restrictions on our approximated solution.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \begin{align} u^h(x=1)=&a_0+a_1(1+1)+a_2(1+1)^2+a_3(1+1)^3+a_4(1+1)^4+a_5(1+1)^5+a_6(1+1)^6=0\\ &a_0+2a_1+4a_2+8a_3+16a_4+32a_5+64a_6=0 \end{align} $$     (3.48)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


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

$$  \displaystyle a_0+2a_1+4a_2+8a_3+16a_4+32a_5+64a_6=0 $$     (3.49)
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }


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

$$  \displaystyle \frac{du^h}{dx}(x=0)=a_1+2a_2+3a_3+4a_4+5a_5+6a_6=-4 $$     (3.50)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


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

$$  \displaystyle a_1+2a_2+3a_3+4a_4+5a_5+6a_6=-4 $$     (3.51) Using the same linear differential operator as we have for the past 2 cases, Eq.3.14 we have the following.
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle P(u^h)=\frac{d^2}{dx^2}\begin{bmatrix} 1 & x+1 & (x+1)^2 & (x+1)^3 & (x+1)^4 & (x+1)^5 & (x+1)^6\end{bmatrix}\begin{bmatrix} a_0 \\ a_1 \\ a_2 \\ a_3 \\ a_4 \\ a_5 \\ a_6 \end{bmatrix} +\frac{3}{2} $$     (3.52) Forming the inner product.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \left \langle b_i,P(u^h) \right \rangle = \int_0^1 b_iP(u^h)\,dx = 0 $$     (3.53)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


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

$$  \displaystyle \int_0^1\begin{bmatrix} 0 & 0 & 2 & 6(x + 1) & 12(x + 1)^2 & 20(x + 1)^3 & 30(x + 1)^4\\ 0 & 0 & 2(x + 1) & 6(x + 1)^2 & 12(x + 1)^3 & 20(x + 1)^4 & 30(x + 1)^5\\ 0 & 0 & 2(x + 1)^2 & 6(x + 1)^3 & 12(x + 1)^4 & 20(x + 1)^5 & 30(x + 1)^6\\ 0 & 0 & 2(x + 1)^3 & 6(x + 1)^4 & 12(x + 1)^5 & 20(x + 1)^6 & 30(x + 1)^7\\ 0 & 0 & 2(x + 1)^4 & 6(x + 1)^5 & 12(x + 1)^6 & 20(x + 1)^7 & 30(x + 1)^8\\ 0 & 0 & 2(x + 1)^5 & 6(x + 1)^6 & 12(x + 1)^7 & 20(x + 1)^8 & 30(x + 1)^9\\ 0 & 0 & 2(x + 1)^6 & 6(x + 1)^7 & 12(x + 1)^8 & 20(x + 1)^9 & 30(x + 1)^{10}\end{bmatrix}\, dx \begin{bmatrix} a_0 \\ a_1 \\ a_2 \\ a_3 \\ a_4 \\ a_5 \\ a_6 \end{bmatrix}=-\frac{3}{2} \int_0^1 \begin{bmatrix} 1 \\ x+1 \\ (x+1)^2 \\ (x+1)^3 \\ (x+1)^4 \\ (x+1)^5 \\ (x+1)^6 \end{bmatrix} $$     (3.54)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }


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

$$  \displaystyle \begin{bmatrix} 0 & 0 & 2 & 9 & 28 & 375/4 & 186\\ 0 & 0 & 3 & 14 & 45 & 155 & 315\\ 0 & 0 & 14/3 &  45/2 & 372/5 &  525/2 &   3810/7\\ 0 & 0 &  15/2  & 186/5 &    126 &  3175/7 &   3825/4\\ 0 & 0 &  62/5 &    63 & 1524/7 &  6375/8 &     5110/3\\ 0 & 0 &    21 & 762/7 &  765/2 & 12775/9 &  3069\\ 0 & 0 & 254/7 & 765/4 & 2044/3 &  5115/2 & 61410/11\end{bmatrix}\begin{bmatrix} a_0\\ a_1\\ a_2\\ a_3\\ a_4\\ a_5\\ a_6\end{bmatrix}=\begin{bmatrix} -3/2\\   -9/4\\    -7/2\\   -45/8\\  -93/10\\   -63/4\\ -381/14\end{bmatrix} $$     (3.55) We take the bottom 5 rows from Eq.3.55 and build a system of equations with Eq.3.49 and Eq.3.51.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \begin{bmatrix} 1 & 2 & 4 & 8 & 16 & 32 & 64\\ 0 & 1 & 2 & 3 & 4 & 5 & 6\\ 0 & 0 & 14/3 &  45/2 & 372/5 &  525/2 &   3810/7\\ 0 & 0 &  15/2  & 186/5 &    126 &  3175/7 &   3825/4\\ 0 & 0 &  62/5 &    63 & 1524/7 &  6375/8 &     5110/3\\ 0 & 0 &    21 & 762/7 &  765/2 & 12775/9 &  3069\\ 0 & 0 & 254/7 & 765/4 & 2044/3 &  5115/2 & 61410/11\end{bmatrix}\begin{bmatrix} a_0\\ a_1\\ a_2\\ a_3\\ a_4\\ a_5\\ a_6\end{bmatrix}=\begin{bmatrix} 0\\   -4\\    -7/2\\   -45/8\\  -93/10\\   -63/4\\ -381/14\end{bmatrix} $$     (3.56) As in the $$n=4$$ case, we use a MATLAB code I wrote to determine the unknown $$ a_i's$$ to determine the final form of our approximation to the solution of the differential equation 3.1.
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$  \displaystyle \begin{bmatrix} a_0 \\ a_1 \\ a_2 \\ a_3 \\ a_4 \\ a_5 \\ a_6 \end{bmatrix}=\begin{bmatrix} 8 \\ -5/2 \\ -3/4 \\ 0 \\ 0 \\ 0 \\ 0 \end{bmatrix} $$     (3.57) Egm5526.s11.team-2.langpm 14:38, 14 February 2011 (UTC)
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Solution

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

$$  \displaystyle \therefore u^h(x)=8-\frac{5}{2}(x+1)-\frac{3}{4}(x+1)^2 $$     (3.58) We can see from above in Eq.3.58 that our solution did not improve at all by an increase in n from 2 to 6. So we can see that indeed, the polynomial basis function converges much quicker to an exact solution than the cosine base functions we used in Problem 2.9. Egm5526.s11.team-2.langpm 14:39, 14 February 2011 (UTC)
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * <p style="text-align:right">
 * }

Graphical Comparison Between the Exact and Numerical Solutions
Egm5526.s11.team-2.langpm 14:39, 14 February 2011 (UTC)

MATLAB Code for n=6 case
=Problem 3.2: ADD TITLE HERE!!!!!!!!!!!!=

Solution
=Problem 3.3: ADD TITLE HERE!!!!!!!!!!!!=

Solution
=Problem 3.4: ADD TITLE HERE!!!!!!!!!!!!=

Solution
=Problem 3.5: ADD TITLE HERE!!!!!!!!!!!!=

Solution
=Problem 3.6: ADD TITLE HERE!!!!!!!!!!!!=

Solution
=Problem 3.7: ADD TITLE HERE!!!!!!!!!!!!=

Solution
=Problem 3.8: ADD TITLE HERE!!!!!!!!!!!!=

Solution
=Problem 3.9: ADD TITLE HERE!!!!!!!!!!!!=

Solution
=Problem 3.10: ADD TITLE HERE!!!!!!!!!!!!=

Solution
=Problem 3.11: ADD TITLE HERE!!!!!!!!!!!!=

Solution
=Contributing Members=

=References=