Matrix Factorization Jacobi Romberg
1. **Problem 1: Factor matrix $A$ into $LL^T$ form with $L_{11} = 1$, where $L$ is lower triangular with ones on the diagonal, and $U$ is upper triangular.**
Given:
$$A = \begin{bmatrix} 2 & 1 & 1 \\ 3 & 3 & 9 \\ 3 & 3 & 5 \end{bmatrix}$$
We want to find $L$ and $U$ such that $A = LU$, with $L$ lower triangular with ones on the diagonal.
**Step 1:** Write $L$ and $U$ as:
$$L = \begin{bmatrix} 1 & 0 & 0 \\ l_{21} & 1 & 0 \\ l_{31} & l_{32} & 1 \end{bmatrix}, \quad U = \begin{bmatrix} u_{11} & u_{12} & u_{13} \\ 0 & u_{22} & u_{23} \\ 0 & 0 & u_{33} \end{bmatrix}$$
**Step 2:** From $A = LU$, equate entries:
- $u_{11} = 2$
- $u_{12} = 1$
- $u_{13} = 1$
- $l_{21} u_{11} = 3 \Rightarrow l_{21} = \frac{3}{2} = 1.5$
- $l_{31} u_{11} = 3 \Rightarrow l_{31} = \frac{3}{2} = 1.5$
- $l_{21} u_{12} + u_{22} = 3 \Rightarrow 1.5 \times 1 + u_{22} = 3 \Rightarrow u_{22} = 1.5$
- $l_{21} u_{13} + u_{23} = 9 \Rightarrow 1.5 \times 1 + u_{23} = 9 \Rightarrow u_{23} = 7.5$
- $l_{31} u_{12} + l_{32} u_{22} = 3 \Rightarrow 1.5 \times 1 + l_{32} \times 1.5 = 3 \Rightarrow l_{32} = 1$
- $l_{31} u_{13} + l_{32} u_{23} + u_{33} = 5 \Rightarrow 1.5 \times 1 + 1 \times 7.5 + u_{33} = 5 \Rightarrow u_{33} = 5 - 1.5 - 7.5 = -4$
**Step 3:** Final matrices:
$$L = \begin{bmatrix} 1 & 0 & 0 \\ 1.5 & 1 & 0 \\ 1.5 & 1 & 1 \end{bmatrix}, \quad U = \begin{bmatrix} 2 & 1 & 1 \\ 0 & 1.5 & 7.5 \\ 0 & 0 & -4 \end{bmatrix}$$
---
2. **Problem 2: Find first two iterations of Jacobi and Gauss-Seidel methods for system:**
$$\begin{cases} 3x_1 - x_2 + x_3 = 1 \\ 3x_1 + 6x_2 + 2x_3 = 0 \\ 3x_1 + 3x_2 + 7x_3 = 4 \end{cases}$$
with initial guess $x^{(0)} = (0,0,0)$.
**Jacobi method formulas:**
$$x_1^{(k+1)} = \frac{1 + x_2^{(k)} - x_3^{(k)}}{3}$$
$$x_2^{(k+1)} = \frac{-3x_1^{(k)} - 2x_3^{(k)}}{6}$$
$$x_3^{(k+1)} = \frac{4 - 3x_1^{(k)} - 3x_2^{(k)}}{7}$$
**Iteration 1:**
$$x_1^{(1)} = \frac{1 + 0 - 0}{3} = \frac{1}{3} \approx 0.3333$$
$$x_2^{(1)} = \frac{-3 \times 0 - 2 \times 0}{6} = 0$$
$$x_3^{(1)} = \frac{4 - 0 - 0}{7} = \frac{4}{7} \approx 0.5714$$
**Iteration 2:**
$$x_1^{(2)} = \frac{1 + 0 - 0.5714}{3} = \frac{0.4286}{3} \approx 0.1429$$
$$x_2^{(2)} = \frac{-3 \times 0.3333 - 2 \times 0.5714}{6} = \frac{-1 - 1.1428}{6} = \frac{-2.1428}{6} \approx -0.3571$$
$$x_3^{(2)} = \frac{4 - 3 \times 0.3333 - 3 \times 0}{7} = \frac{4 - 1}{7} = \frac{3}{7} \approx 0.4286$$
**Gauss-Seidel method uses updated values immediately:**
**Iteration 1:**
$$x_1^{(1)} = \frac{1 + 0 - 0}{3} = 0.3333$$
$$x_2^{(1)} = \frac{-3 \times 0.3333 - 2 \times 0}{6} = \frac{-1}{6} = -0.1667$$
$$x_3^{(1)} = \frac{4 - 3 \times 0.3333 - 3 \times (-0.1667)}{7} = \frac{4 - 1 + 0.5}{7} = \frac{3.5}{7} = 0.5$$
**Iteration 2:**
$$x_1^{(2)} = \frac{1 + 0.1667 - 0.5}{3} = \frac{0.6667}{3} = 0.2222$$
$$x_2^{(2)} = \frac{-3 \times 0.2222 - 2 \times 0.5}{6} = \frac{-0.6666 - 1}{6} = \frac{-1.6666}{6} = -0.2778$$
$$x_3^{(2)} = \frac{4 - 3 \times 0.2222 - 3 \times (-0.2778)}{7} = \frac{4 - 0.6666 + 0.8334}{7} = \frac{4.1668}{7} \approx 0.5953$$
---
3. **Problem 3: Use Romberg integration to compute $R_{33}$ for**
$$\int_0^4 e^{-x} \sin(2x) \, dx$$
**Step 1:** Define $h = b - a = 4$, and compute trapezoidal approximations $T(h), T(h/2), T(h/4)$.
**Step 2:** Calculate $T(h)$:
$$T(h) = \frac{h}{2} [f(0) + f(4)] = 2 [0 + e^{-4} \sin(8)] \approx 2 \times (0 + 0.0183 \times 0.9894) = 0.0362$$
**Step 3:** Calculate $T(h/2)$ with points $x=0,2,4$:
$$T(h/2) = \frac{2}{2} [f(0) + 2f(2) + f(4)] = 1 [0 + 2 \times e^{-2} \sin(4) + 0.0183 \times 0.9894]$$
Calculate $f(2) = e^{-2} \sin(4) \approx 0.1353 \times (-0.7568) = -0.1023$
So,
$$T(h/2) = 1 [0 + 2 \times (-0.1023) + 0.0181] = 1 [-0.2046 + 0.0181] = -0.1865$$
**Step 4:** Calculate $T(h/4)$ with points $x=0,1,2,3,4$:
$$T(h/4) = \frac{1}{2} [f(0) + 2(f(1)+f(2)+f(3)) + f(4)]$$
Calculate:
$f(1) = e^{-1} \sin(2) \approx 0.3679 \times 0.9093 = 0.3345$
$f(3) = e^{-3} \sin(6) \approx 0.0498 \times -0.2794 = -0.0139$
Sum inside:
$$2(0.3345 - 0.1023 - 0.0139) = 2(0.2183) = 0.4366$$
So,
$$T(h/4) = 0.5 [0 + 0.4366 + 0.0181] = 0.5 \times 0.4547 = 0.2274$$
**Step 5:** Romberg table:
$$R_{1,1} = T(h) = 0.0362$$
$$R_{2,1} = T(h/2) = -0.1865$$
$$R_{3,1} = T(h/4) = 0.2274$$
Calculate $R_{2,2}$:
$$R_{2,2} = R_{2,1} + \frac{R_{2,1} - R_{1,1}}{4^1 - 1} = -0.1865 + \frac{-0.1865 - 0.0362}{3} = -0.1865 - 0.0742 = -0.2607$$
Calculate $R_{3,2}$:
$$R_{3,2} = R_{3,1} + \frac{R_{3,1} - R_{2,1}}{3} = 0.2274 + \frac{0.2274 + 0.1865}{3} = 0.2274 + 0.1379 = 0.3653$$
Calculate $R_{3,3}$:
$$R_{3,3} = R_{3,2} + \frac{R_{3,2} - R_{2,2}}{4^2 - 1} = 0.3653 + \frac{0.3653 + 0.2607}{15} = 0.3653 + 0.0417 = 0.4070$$
**Final answer:**
$$\boxed{R_{3,3} \approx 0.4070}$$
---
4. **Problem 4: Use Bisection Method to find roots of**
$$x^4 - 2x^2 + 14x - 6 = 0$$
**Intervals:** $[0,1], [1,3.2], [3.2,4]$ with tolerance $10^{-2}$.
**Step 1:** Evaluate $f(x)$ at interval endpoints and bisect until interval length $< 0.01$.
Example for $[0,1]$:
- $f(0) = -6$
- $f(1) = 1 - 2 + 14 - 6 = 7 > 0$
Midpoint $0.5$:
- $f(0.5) = 0.5^4 - 2(0.5)^2 + 14(0.5) - 6 = 0.0625 - 0.5 + 7 - 6 = 0.5625 > 0$
Since $f(0)<0$ and $f(0.5)>0$, root in $[0,0.5]$.
Continue bisecting until interval length $< 0.01$.
Repeat similarly for other intervals.
---
5. **Problem 5: Use Secant Method to find root of**
$$x^4 - 2x^2 - 5 = 0$$
**Interval:** $[1,4]$, tolerance $10^{-4}$.
**Step 1:** Start with $x_0=1$, $x_1=4$.
**Step 2:** Iterate:
$$x_{n+1} = x_n - f(x_n) \frac{x_n - x_{n-1}}{f(x_n) - f(x_{n-1})}$$
Calculate $f(1) = 1 - 2 - 5 = -6$, $f(4) = 256 - 32 - 5 = 219$.
Calculate $x_2$ and continue until $|x_{n+1} - x_n| < 10^{-4}$.
---
6. **Problem 6: Approximate integral**
$$I = \int_0^1 x^2 e^{-x^2} dx$$
using Composite Trapezoidal Rule with $h=0.25$.
**Step 1:** Points: $x = 0, 0.25, 0.5, 0.75, 1$
Calculate $f(x) = x^2 e^{-x^2}$:
- $f(0) = 0$
- $f(0.25) = 0.0625 e^{-0.0625} \approx 0.0587$
- $f(0.5) = 0.25 e^{-0.25} \approx 0.1947$
- $f(0.75) = 0.5625 e^{-0.5625} \approx 0.3243$
- $f(1) = 1 e^{-1} = 0.3679$
**Step 2:** Apply formula:
$$I \approx \frac{h}{2} [f(0) + 2(f(0.25) + f(0.5) + f(0.75)) + f(1)]$$
$$= 0.125 [0 + 2(0.0587 + 0.1947 + 0.3243) + 0.3679]$$
$$= 0.125 [0 + 2(0.5777) + 0.3679] = 0.125 [1.1554 + 0.3679] = 0.125 \times 1.5233 = 0.1904$$
**Final answer:**
$$\boxed{I \approx 0.1904}$$