User:Egm6341.s10.Team4.yunseok/HW5

= Problem 5: Integration of logistic equation with $$h=2^kh $$=

Given
Refer Lecture slide 42-2 for problem statement

The logistic equation


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

\frac{d\overline{x}}{dt} = rx\left(1- \overline{x}\right) $$ where,
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

$$\displaystyle \overline{x} = \frac{x}{x_{max}} $$

Find
Integrate logistic equation already found $$\hat{h}$$ such that Hermit-simpson algorithm yields error($$ 10^{-6}$$)

1) Run Hermit-Simpson with $$\displaystyle h= 2^k \hat{h}$$

2) Develop and Run Forward Euler with $$\displaystyle h= 2^k \hat{h}$$

3) Develop and Run Backward Euler with $$\displaystyle h= 2^k \hat{h}$$

Solution
1) Run Hermit-Simpson algo $$\displaystyle h= 2^k \hat{h}$$

See problem 3

2) Develop and Run Forward Euler with $$\displaystyle h= 2^k \hat{h}$$


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

\begin{align} &\frac{d\overline{x}}{dt} = r\overline{x}\left(1- \overline{x}\right)\\ &\frac{\overline{x}_{i+1}-\overline{x}_i}{h}= r\overline{x_i}\left(1- \overline{x_i}\right)\\ &\overline{x}_{i+1}= hr\overline{x}_i\left(1- \overline{x}_i\right)+\overline{x}_i\\ &\overline{x}_{i+1}= (hr+1)\overline{x}_i-hr\overline{x}^2_i\\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

MATLAB CODE:



3) Develop and Run Backward Euler with $$\displaystyle h= 2^k \hat{h}$$


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

\begin{align} &\frac{d\overline{x}}{dt} = r\overline{x}\left(1- \overline{x}\right)\\ &\frac{\overline{x}_{i+1}-\overline{x}_i}{h}= r\overline{x}_{i+1}\left(1- \overline{x}_{i+1}\right)\\ &-\overline{x}_{i}= hr\overline{x}_{i+1}\left(1- \overline{x}_{i+1}\right)-\overline{x}_{i+1}\\ &=>hr\overline{x}^2_{i+1}+(1-hr)\overline{x}_{i+1}-\overline{x}_{i}= 0\\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.


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

\begin{align} &\overline{x}_{i+1}=\frac{hr-1 + \sqrt{(1-hr)^2+4hrx_i}}{2hr}\\ &\overline{x}_{i+1}=\frac{hr-1 - \sqrt{(1-hr)^2+4hrx_i}}{2hr}\\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.



MATLAB CODE:

Conclusion

As the step size($$ 2^kh$$) increase, the Forwaord Euler method shows the unstable properties.

on the other hands, The Hermit simpson and Backworkd Euler shows the relatively stable properties.

= Problem 11: Circumference of Ellipse =

Given
Lecture notes [[media:Egm6341.s10.mtg42.djvu|p.42-2]]

Arc length
 * {| style="width:100%" border="0" align="left"

dl = [dx+dy]^{1/2}\,dt$$
 * $$\displaystyle
 * $$\displaystyle


 * $$ \displaystyle x = a cost $$


 * $$ \displaystyle y = b sint $$


 * }
 * }

Find

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

$$\displaystyle C = \int dl = a \int_{0}^{2\pi} [1-e^2cos^2t]^{1/2}\,dt$$ where, Eccentricity, $$ \displaystyle e = \Bigg[1-\frac{b^2}{a^2}\Bigg]^{1/2} $$
 * Show that,
 * Show that,
 * }
 * }

Solution

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

$$\displaystyle \frac {dy}{dt} = b cos t $$  and
 * $$\displaystyle \frac {dx}{dt} = -a sin t $$  
 * $$\displaystyle \frac {dx}{dt} = -a sin t $$  
 * }
 * }


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

\begin{align} dl &= [dx^2 + dy^2 ]^{1/2}\\ &= \Bigg[\bigg(\frac{dx}{dt}\bigg)^2 + \bigg(\frac{dy}{dt}\bigg)^2 \Bigg]^{1/2} dt\\ &=\Bigg[(-a sin t)^2 + (b cos t)^2\Bigg]^{1/2} dt\\ &= \Bigg[(a^2 sin^2 t) + (b^2 cos^2 t)\Bigg]^{1/2} dt\\ &= a \Bigg[sin^2 t + \left(\frac{b^2}{a^2} cos^2 t\right)\Bigg]^{1/2} dt\\ &= a \Bigg[sin^2 t + cos^2 t + \frac{b^2}{a^2} cos^2 t- cos^2 t \Bigg]^{1/2} dt\\ &= a \Bigg[1 -\left(1-\frac{b^2}{a^2}\right) cos^2 t \Bigg]^{1/2} dt\\ &= a \Bigg[1 - e^2 cos^2 t \Bigg]^{1/2} dt\\ \end{align} $$ So,
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.
 * {| style="width:100%" border="0" align="left"


 * $$\displaystyle C = \int_{0}^{2\pi} dl = a \int_{0}^{2\pi} [1-e^2cos^2t]^{1/2}\,dt$$
 * }
 * }

= Problem 11: Verification and comaprision of Problem 10 of HW5 =

Given
The given condition of No 10 problem of HW5


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

Refer Lecture slide 30-4 for problem statement
 * style="width:100%; padding:10px; border:2px solid #8888aa" |
 * style="width:100%; padding:10px; border:2px solid #8888aa" |

Polar form relative to focus
 * {| style="width:100%" border="0" align="left"


 * [[Image:Ellipse Polar.svg|200px]]
 * }.
 * }.
 * }.

Eq (3) from Page [[media:Egm6341.s10.mtg30.djvu|30-3]]

$$\displaystyle \ \ r(\theta) = \frac{a(1-e^2)}{1-e \, cos(\theta)} $$

In our problem, a=1

where, eccentricity $$\displaystyle e = \sin(\frac{\pi}{12}) $$

First Method to compute the Arc Length for an elliptical curve is using Eq (4) from Page [[media:Egm6341.s10.mtg30.djvu|30-3]] Since for the Ellipse $$\displaystyle \theta$$ range is from 0 to 2 $$\displaystyle\pi $$

Circumference $$\displaystyle I( \theta) = \int_0^{2\pi} dl$$

Where Eq (1) $$\displaystyle dl= \sqrt{ {r}^{2}+ {\left(  \frac{dr}{d \theta}\right)}^{2}} d\theta $$.

The second method uses the elliptic integral of the second kind which is defined as:

$$E(e^2) = \int_0^{\pi/2}\sqrt {1-e^2 \sin^2\theta}\ d\theta\ $$    Eq(6)    in page     [[media:Egm6341.s10.mtg30.djvu|30-4]]

The circumference of an ellipse is $$\displaystyle C = 4 a E(e^2)$$    Eq(5)   in page   [[media:Egm6341.s10.mtg30.djvu|30-4]],

Giving the integral:


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

$$\displaystyle I= 4 E(e^2) = 4\int_0^{\pi/2}\sqrt {1-e^2 \sin^2\theta}\ d\theta $$
 * }

Find Arc length of ellipse using the two Integrals and the integration methods below.

compute $$\displaystyle I_n$$ to the error $$\displaystyle 10^{-10}$$ ,

compute time using tic/toc matlab command and error estimate

1) Composit Trapozoidal rule

2) Romberg Table

3) Clencurt


 * style= |
 * }.
 * }.

Find
verify the result of pb10 of HW5(Team3) and compare with the own code.

Solution
first method $$\displaystyle I( \theta) = \int_0^{2\pi} \sqrt{ {r}^{2}+ {\left( \frac{dr}{d \theta}\right)}^{2}} d\theta$$



When run the Team 3's clencult code, they does'nt porvide answer(while loop continuously run.) the reason is that they use the I_exact value as Quad's solution(6.17660193898874),

but this value is not correct. when they calculate the Quad solution, they didn't designate the Toll error level(e.g. $$\displaystyle 10^{-10}$$). However their clencult code itself is correct,so when I change the I_exact value correctly, they provide correct answer.



Team3



Own work



Romberg Table is correct.

Second method $$\displaystyle I= 4 E(e^2) = 4\int_0^{\pi/2}\sqrt {1-e^2 \sin^2\theta}\ d\theta $$

Team 3 only calculated the quad method.



 Own work



In conclusion, Team 3's work is almost correct except for

1. quad function -- the error order$$\displaystyle (10^{-8}) $$ was bigger than criterion $$\displaystyle 10^{-10} $$ because of not designating error tolerance level in the function

2. seconde method was not calculated except for quad function.

Also, when compare the result bwtween first and second mehtod, the results were same. and in the Romberg table, the second method was faster than first method.(see the upper table)

Matlab Code: method 1-Quad

Matlab Code: method 1-Composit Trap.Rule

subfunction ff5_10

Matlab Code: method 1 - clencult

Matlab Code: method 1 - Romberg Table

subfuntion ff:

Matlab Code: method 2 - Quad

Matlab Code: method 2 - Compsit Trap. rule

subfunction ff

Matlab Code: method 2 - Clencurt

Matlab Code: method 2 - RombergTable

= Problem 5: Identification of basis function $$\displaystyle \overline{N_i}$$ =

Given
Refer Lecture slide 35-2,4 for problem statement

The relationship between $$\displaystyle Z(s)$$ and $$\displaystyle d_i$$(degree of freedom)


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

Z(s)=\sum_{i=0}^{3}c_i s^i = \sum_{i=1}^{4}N_i(s) d_i = \sum_{i=1}^{4} \overline{N_i}(s) \, \overline{d_i} $$ $$ where,
 * $$\displaystyle
 * $$\displaystyle
 * $$\displaystyle \longrightarrow (1)
 * }.
 * }.
 * $$\displaystyle N_i(s)$$ = basis function
 * $$\displaystyle d_i(s)$$ = degree of freedom

$$\displaystyle d_1=Z_i $$ $$\displaystyle \,\,\,\,\, ,d_2=\dot{Z_i} $$ $$\displaystyle \,\,\,\,\, ,d_3=Z_{i+1} $$ $$\displaystyle \,\,\,\,\, ,d_4=\dot{Z}_{i+1} $$

Find
Identify the the basis function $$\displaystyle \left\{ N_i(s) \right\}\,\,\, ,i=1,2,3,4 $$, and plot $$\displaystyle \overline{N_i}(s)$$'s

Solution
From the equation (1) of 35-4(lecture slide)


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

\begin{Bmatrix} c_0 \\ c _1 \\ c _2 \\ c_3 \end{Bmatrix} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ -3 & -2 & 3 & -1 \\ 2 & 1 & -2 & 1 \end{bmatrix} \begin{Bmatrix} Z_i \\ Z_i^' \\ Z_{i+1} \\ Z_{i+1}^' \end{Bmatrix} =\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ -3 & -2 & 3 & -1 \\ 2 & 1 & -2 & 1 \end{bmatrix} \begin{Bmatrix} \overline{d}_1 \\ \overline{d}_2 \\ \overline{d}_3 \\ \overline{d}_4 \\ \end{Bmatrix} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

where,

$$\displaystyle \overline{d}_2= h \, d_2$$ $$\displaystyle, \,\,\,\,\, \overline{d}_4= h \, d_4$$ $$\displaystyle, \,\,\,\,\, \overline{d}_1=d_1$$ $$\displaystyle, \,\,\,\,\, \overline{d}_3=d_3$$

Expand the matrix equation.


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

\begin{align} &c_0= \overline{d}_1 \\ &c_1= \overline{d}_2 \\ &c_2= -3\overline{d}_1 -2\overline{d}_2+3\overline{d}_3-\overline{d}_4 \\ &c_3= 2\overline{d}_1 +1\overline{d}_2-2\overline{d}_3+\overline{d}_4 \\ \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

plug in $$\displaystyle c_i$$ to equation (1)


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

\begin{align} Z(s)&=\sum_{i=0}^{3}c_i s^i = c_0 + c_1 s^1 + c_2 s^2 + c_3 s^3 \\ &= \overline{d}_1 + \overline{d}_2 s^1 + (-3\overline{d}_1 -2\overline{d}_2+3\overline{d}_3-\overline{d}_4) s^2 + (2\overline{d}_1 +1\overline{d}_2-2\overline{d}_3+\overline{d}_4) s^3 \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

arrange in terms of $$\displaystyle \overline{d}_i $$


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

\begin{align} & = (2s^3-3s^2+1)\overline{d}_1+(s^3-2s^2+s)\overline{d}_2+(-2s^3+3s^2)\overline{d}_3+(s^3-s^2)\overline{d}_4 \\ &=\overline{N}_1(s) \, \overline{d}_1+\overline{N}_2(s) \, \overline{d}_2+\overline{N}_3(s) \, \overline{d}_3+\overline{N}_4(s) \, \overline{d}_4 \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

So,
 * {| style="width:100%" border="0" align="left"

\begin{align} & \overline{N}_1= 2s^3-3s^2+1 \\ & \overline{N}_2= s^3-2s^2+s \Rightarrow N_2= h(s^3-2s^2+s)\\ & \overline{N}_3= -2s^3+3s^2 \\ & \overline{N}_4= s^3-s^2 \Rightarrow N_4= h(s^3-s^2) \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

Plot of $$\displaystyle N_i $$
 * [[File:basis_function.png]]

= Problem 5: Derivation of Compsit Trap. Rule Error =

Given
Refer Lecture slide 28-3 for problem statement

The Error of Composit Trap. Rule


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

E^1_n= \sum_{k=0}^{n-1} \left[  \int_{x_{k}}^{x_{k+1}}f(x)dx-\frac{h}{2} \left\{ f(x_k)+f(x_{k+1}) \right\}  \right] $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

Find
Derive the Compsit Trap.Rule Error equation.
 * {| style="width:100%" border="0" align="left"

E=\sum_{r=1}^{\ell} 2 \, \overline{d}_{2r} \, h^{2r-1}\Bigg[f^{(2r-1)}(b)-f^{(2r-1)}(a)\Bigg]-\frac{h^{2\ell}}{2^{2\ell}} \sum_{k=0}^{n-1} \int_{x_k}^{x_{k+1}} \, p_{2\ell}(t_{k}(x)) \, f^{(2\ell)}(x)dx $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

Solution
The Error of Composit Trap. Rule


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

E^1_n= \sum_{k=0}^{n-1} \left[  \int_{x_{k}}^{x_{k+1}}f(x)dx-\frac{h}{2} \left\{ f(x_k)+f(x_{k+1}) \right\}  \right] $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

Transfer int.$$\displaystyle [x_k, x_{k+1}]$$ to $$\displaystyle [1,+1]$$

where,
 * {| style="width:100%" border="0" align="left"

x(t):=t\frac{h}{2}+\frac{x_k+x_{k+1}}{2}, \, \, \, \, \, \, \, t \in [-1,1]\, \, \,\, \, \,, h:=(b-a)/n $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.


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

g_k(t) = f(x(t)) \,\,\,\,\,\,such \,\,\,that\,\,\,\,\,x \in [x_k, x_{k+1}] $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.


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

E^1_n= \frac{h}{2}\sum_{k=0}^{n-1} \left[  \int_{-1}^{+1}g_k(t)dt- \left\{ g_k(-1)+g_k(+1) \right\}  \right] $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

through the successive integration by parts, the below equation can be obtained21-2,326-3


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

\begin{align} E^1_n & = \frac{h}{2} \left[ \sum_{k=0}^{n-1}\Big[p_2(t)g_k^{(1)}(t)+p_4(t)g_k^{(3)}(t_k)+p_6(t)g_k^{(5)}(t)+......+p_{2\ell}(t)g_k^{(2\ell-1)}(t)\Big]_{-1}^{+1}- \sum_{k=0}^{n-1} \left[ \int_{-1}^{1}p_{2\ell}(t)g_k^{(2\ell)}(t) dt \right]\right]\\ &= \frac{h}{2} \left[ \sum_{r=1}^{\ell}\sum_{k=0}^{n-1}\Big[p_{2r}(t)g_k^{(2r-1)}(t)\Big]_{-1}^{+1} - \sum_{k=0}^{n-1} \left[    \int_{-1}^{1}p_{2\ell}(t)g_k^{(2\ell)}(t) dt \right]\right] \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

Extend the first summation term.


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

\begin{align} E^1_n &= \frac{h}{2} \left[ \sum_{r=1}^{\ell}\sum_{k=0}^{n-1}\Big[p_{2r}(+1)g_k^{(2r-1)}(+1)-p_{2r}(-1)g_k^{(2r-1)}(-1)\Big]- \sum_{k=0}^{n-1} \left[   \int_{-1}^{1}p_{2l}(t)g_k^{(2\ell)}(t) dt \right]\right]\\ & because \,\,\,\,\,\,p_{2r}(+1)=p_{2r}(-1),\\ &= \frac{h}{2} \left[ \sum_{r=1}^{\ell}\sum_{k=0}^{n-1} p_{2r}(+1) \Big[g_k^{(2r-1)}(+1)-g_k^{(2r-1)}(-1)\Big]- \sum_{k=0}^{n-1} \left[   \int_{-1}^{1}p_{2l}(t)g_k^{(2\ell)}(t) dt\right]\right] \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

Using below relationship,


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

g_k^{(i)}(t)=\left(\frac{h}{2}\right)^if^{(i)}(x(t)),,\,\,\,\,\ x \in [x_k,x_{k+1}] $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

$$\displaystyle g_k(t)$$can be changed to $$\displaystyle f_(x_k)$$ and below was obtained.
 * {| style="width:100%" border="0" align="left"

\begin{align} &g_k^{(2r-1)}(+1)=\left(\frac{h}{2}\right)^{2r-1}f^{(2r-1)}(x_{k+1}),\\ &g_k^{(2r-1)}(-1)=\left(\frac{h}{2}\right)^{2r-1}f^{(2r-1)}(x_{k}),\\ &g_k^{(2\ell)}(t)=\left(\frac{h}{2}\right)^{2\ell}f^{(2\ell)}(x_{t}) \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

Plug in thess relationships to the equation $$\displaystyle E_n^1$$
 * {| style="width:100%" border="0" align="left"

\begin{align} E^1_n & = \left(\frac{h}{2}\right) \left[ \sum_{r=1}^{\ell} p_{2r}(+1) \left(\frac{h}{2}\right)^{2r-1} \sum_{k=0}^{n-1} \Big[f^{(2r-1)}(x_{k+1})-f^{(2r-1)}(x_k)\Big]- \sum_{k=0}^{n-1} \left[   \int_{x_k}^{x_{k+1}}p_{2\ell}(t_k(x))\left(\frac{h}{2}\right)^{2\ell}f^{(2\ell)}(x) dx \right] \right]\\ &= \sum_{r=1}^{\ell} h^{2r} \frac{p_{2r}(+1)}{2^{2r}} \Big[f^{(2r-1)}(x_{n})-f^{(2r-1)}(x_0)\Big]-  \left(\frac{h}{2}\right)^{2\ell+1} \sum_{k=0}^{n-1} \left[ \int_{x_k}^{x_{k+1}}p_{2\ell}(t_k(x))f^{(2\ell)}(x) dx \right] \end{align} $$
 * $$\displaystyle
 * $$\displaystyle
 * }.
 * }.

by the definition of $$\displaystyle \overline{d}_{2r}$$
 * $$\displaystyle \overline{d}_{2r} = \frac{p_{2r}(+1)}{2^{2r}} $$
 * $$\displaystyle x_n=b, x_0=a $$


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

E^1_n = \sum_{r=1}^{\ell} h^{2r} \overline{d}_{2r} \Big[f^{(2r-1)}(b)-f^{(2r-1)}(a)\Big]- \underbrace{\left(\frac{h}{2}\right)^{2\ell+1}}_{(?)} \sum_{k=0}^{n-1} \left[ \int_{x_k}^{x_{k+1}}p_{2\ell}(t_k(x))f^{(2\ell)}(x) dx \right] $$
 * $$\displaystyle
 * $$\displaystyle
 * }
 * }

This solution is little bit different from the given solution of the lecture.

the coefficient of second summation term that marked $$\displaystyle (?) $$

we got $$\displaystyle \left(\frac{h}{2}\right)^{2\ell+1} $$ instead of $$\displaystyle \left(\frac{h}{2}\right)^{2\ell} $$

= Problem 11: Derivation of the equation of arclength using the cosine law =

Given
Refer Lecture slide for problem statement



Figure 1


 * $$\displaystyle

r(\theta) = \frac{1-e^2}{1-e \, cos(\theta)} $$

where, eccentricity $$\displaystyle e = \sin(\frac{\pi}{12}) $$

Find
Derive the equation of arclength using triangle OAB and cosine law.


 * $$d\ell=d\theta \left[ r^2+ \left( \frac{dr}{d\theta}\right)^2\right]^{\frac{1}{2}}$$

Solution

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

[reference]
 * style="width:20%; padding:10px; border:2px solid #8888aa" |
 * style="width:20%; padding:10px; border:2px solid #8888aa" |

the law of cosine
 * $$c^2 = a^2 + b^2 - 2ab\cos(\gamma)\,$$


 * style= |
 * }.
 * }.

Apply the cosine law to triabgle OAB in the Figure1 (See Figure 1)


 * $$\displaystyle dl^2=\overline{AB}^2 = \overline{OA}^2 + \overline{OB}^2 - 2\overline{OA}\,\,\, \overline{OB}\cos(d\theta)\, $$
 * $$\displaystyle dl = \sqrt{\overline{OA}^2 + \overline{OB}^2 - 2\overline{OA}\,\,\, \overline{OB}\cos(d\theta)}\, $$
 * $$\displaystyle dl = \sqrt{r(\theta)^2 + r(\theta+d\theta)^2 - 2r(\theta)r(\theta+d\theta)\cos(d\theta)}\, $$
 * $$\displaystyle dl = \sqrt{\underbrace{\Big[r(\theta) - r(\theta+d\theta)\Big]^2}_{(a)} + 2r(\theta)r(\theta+d\theta)\underbrace{(1-\cos(d\theta))}_{(b)}}\, $$

Part$$\displaystyle (a) $$ is approximately
 * $$\displaystyle (r(\theta) - r(\theta+d\theta))^2 \simeq (dr)^2 \, $$

For part$$\displaystyle (b) $$

Using the other cosine summation law


 * $$\displaystyle cos(\alpha + \beta)=cos(\alpha)cos(\beta)-sin(\alpha)sin(\beta) \, $$


 * $$\displaystyle cos(d\theta)=cos\left(\frac{d\theta}{2}+\frac{d\theta}{2}\right) =cos\left(\frac{d\theta}{2}\right)cos\left(\frac{d\theta}{2}\right)-sin\left(\frac{d\theta}{2}\right)sin\left(\frac{d\theta}{2}\right)= cos^2\left(\frac{d\theta}{2}\right)-sin^2\left(\frac{d\theta}{2}\right) \, $$

because, $$\displaystyle cos^2\left(\frac{d\theta}{2}\right)= 1-sin^2\left(\frac{d\theta}{2}\right)\, $$


 * $$\displaystyle = \left(1-sin^2\left(\frac{d\theta}{2}\right)\right)-sin^2\left(\frac{d\theta}{2}\right) = 1-2sin^2\left(\frac{d\theta}{2}\right)\ \, $$

In small $$\displaystyle d\theta$$ approximately,
 * $$\displaystyle sin(\frac{d\theta}{2}) \simeq \frac{d\theta}{2} \, $$

using this fact,


 * $$\displaystyle 1-cos(d\theta)= 1-\left(1-2sin^2\left(\frac{d\theta}{2}\right)\right) = 2\left(\frac{d\theta}{2}\right)^2 =\frac{(d\theta)^2}{2} $$

So, Plug in part(a) and Part(b)


 * $$\displaystyle dl = \sqrt{(r(\theta) - r(\theta+d\theta))^2 + 2r(\theta)r(\theta+d\theta)(1-\cos(d\theta))}\, $$
 * $$\displaystyle = \sqrt{(dr)^2 + 2r(\theta)r(\theta+d\theta)(\frac{(d\theta)^2}{2})} = \sqrt{(dr)^2 + r(\theta)r(\theta+d\theta)(d\theta)^2} \, $$
 * $$\displaystyle = d\theta \sqrt{\left(\frac{dr}{d\theta}\right)^2 + r(\theta)r(\theta+d\theta)} \, $$

when $$\displaystyle d\theta$$ is very small, approximately, $$\displaystyle r(\theta)r(\theta+d\theta) \simeq r(\theta)^2 \, $$


 * $$\displaystyle \simeq d\theta \sqrt{\left(\frac{dr}{d\theta}\right)^2 + r(\theta)^2} \, $$