User:EGM6341.s10.Team1.Kumanchik/HW5

=Problem 10: Decipher the MATLAB code by Kessler=

Statement
Review the MATLAB code written by Kessler. Comment on what each line does.

Solution
The code computes the Trapezoidal error polynomials evaluated at t=1. The polynomial equation is,
 * $$p_{2k}(t)=c_1\frac{t^{2k}}{(2k)!}+c_3\frac{t^{2k-2}}{(2k-2)!}+c_5\frac{t^{2k-4}}{(2k-4)!}+...+c_{2k-3}\frac{t^4}{4!}+c_{2k-1}\frac{t^2}{2!}+c_{2k+1}\frac{t^0}{0!}$$

When evaluated at t=1, the equation is,
 * $$p_{2k}(1)=\frac{c_1}{(2k)!}+\frac{c_3}{(2k-2)!}+\frac{c_5}{(2k-4)!}+...+\frac{c_{2k-3}}{4!}+\frac{c_{2k-1}}{2!}+\frac{c_{2k+1}}{0!}$$

The coefficients, $$c$$, are computed by solving the below equation using $$c_1=-1$$ as a starting point,
 * $$\frac{c_1}{(2k-1)!}+\frac{c_3}{(2k-3)!}+\frac{c_5}{(2k-5)!}+...+\frac{c_{2k-5}}{5!}+\frac{c_{2k-3}}{3!}+\frac{c_{2k-1}}{1!}=0$$

For illustration, the first few coefficients and polynomial equations are shown below.

Notice that the factorials in the denominators of the polynomials differ by 1 from those in the coefficients. Also, to solve for the next coefficient, the preceding coefficients only need to be summed and then moved to the other side of the equal sign, i.e $$c_7=-(\frac{c_1}{7!}+\frac{c_3}{5!}+\frac{c_5}{3!})$$.

The following code will be commented line-by-line to explain the algorithm of Kessler:

Solved by: EGM6341.s10.Team1.Kumanchik 19:43, 24 March 2010 (UTC)

=Problem 12: Derive the arc length of a curve using the law of cosines=

Find
The arc length of a curve in space using the Law of Cosines

Given
The law of cosines:
 * $$c^2=a^2+b^2-2abcos(\gamma) \,$$

Solution
The law of cosines can be directly applied to the triangle with sides $$r$$, $$r+dr$$, and inner angle $$d\theta$$ to determine the differential line segment AB=$$dl$$.
 * $$dl^2=r^2+(r+dr)^2-2r(r+dr)cos(d\theta)=2r^2+2rdr+dr^2-(2r^2+2rdr)cos(d\theta) \,$$

The Taylor series expansion of $$cos(x)$$ is,
 * $$cos(x)=1-\frac{x^2}{2!}+\frac{x^4}{4!}-...$$

Taking the first two terms of the expansion and applying them to the differential length equation yields,
 * $$dl^2=2r^2+2rdr+dr^2-(2r^2+2rdr)(1-\frac{d\theta^2}{2})=dr^2+r^2d\theta^2+r\cancel{drd\theta^2}^{\approx 0}$$

Since the triple differential element $$drd\theta^2$$ shrinks faster than the double elements $$dr^2$$ and $$d\theta^2$$, it is set to zero. The remainder is,
 * $$dl^2=d\theta^2(\frac{dr^2}{d\theta^2}+r^2)$$

Integrating from $$\theta_1$$ to $$\theta_2$$ yields,
 * $$l=\int_{\theta_1}^{\theta_2}d\theta\sqrt{(\frac{dr}{d\theta})^2+r^2}$$

This is identical to the expression derived from geometry.

Solved by: EGM6341.s10.Team1.Kumanchik 19:44, 24 March 2010 (UTC)