User:Egm6321.f10.team3.Sudheesh/Homeworks/Homework7

= Problem 1 - Plot Legendre functions=

Given
Legendre polynomials (functions /first homogeneous solutions)


 * $$\begin{align}

& {{P}_{0}}(x)=1 \\ & {{P}_{1}}(x)=x \\ & {{P}_{2}}(x)=\frac{1}{2}(3{{x}^{2}}-1) \\ & {{P}_{3}}(x)=\frac{1}{2}(5{{x}^{3}}-3x) \\ & {{P}_{4}}(x)=\frac{1}{8}(35{{x}^{4}}-30{{x}^{2}}+3) \\ \end{align}$$

Legendre functions (second homogeneous solutions)


 * $$\begin{align}

& {{Q}_{0}}(x)=\frac{1}{2}\log \left( \frac{1+x}{1-x} \right) \\ & {{Q}_{1}}(x)=\frac{1}{2}x\log \left( \frac{1+x}{1-x} \right)-1 \\ & {{Q}_{2}}(x)=\frac{1}{4}(3{{x}^{2}}-1)\log \left( \frac{1+x}{1-x} \right)-\frac{3}{2}x \\ & {{Q}_{3}}(x)=\frac{1}{4}(5{{x}^{3}}-3x)\log \left( \frac{1+x}{1-x} \right)-\frac{5}{2}{{x}^{2}}+\frac{2}{3} \\ & {{Q}_{4}}(x)=\frac{1}{16}(35{{x}^{4}}-30{{x}^{2}}+3)\log \left( \frac{1+x}{1-x} \right)-\frac{35}{8}{{x}^{3}}+\frac{55}{24}x \end{align}$$

Find

 * (1) Plot $$\displaystyle \left\{ {{P}_{0}}(x),{{P}_{1}}(x),{{P}_{2}}(x),{{P}_{3}}(x) \right\}$$ and observe $$\displaystyle {{P}_{n}}(x)$$ as $$\displaystyle x\to \pm 1$$


 * (2) Plot $$\displaystyle\left\{ {{Q}_{0}}(x),{{Q}_{1}}(x),{{Q}_{2}}(x),{{Q}_{3}}(x) \right\}$$ and observe $$\displaystyle {{Q}_{n}}(x)$$ as $$\displaystyle x\to \pm 1$$


 * (3) Plot $$\displaystyle \left\{ {{P}_{0}}(x),{{Q}_{0}}(x) \right\}$$, $$\displaystyle \left\{ {{P}_{1}}(x),{{Q}_{1}}(x) \right\}$$, $$\displaystyle \left\{ {{P}_{2}}(x),{{Q}_{2}}(x) \right\}$$, $$\displaystyle \left\{ {{P}_{3}}(x),{{Q}_{3}}(x) \right\}$$, $$\displaystyle \left\{ {{P}_{4}}(x),{{Q}_{4}}(x) \right\}$$


 * (4) Observe even-ness and odd-ness of $$\displaystyle \left\{ {{P}_{i}}(x),{{Q}_{i}}(x) \right\}$$, $$\displaystyle i=0,1,2,3,4$$ and guess


 * $$\displaystyle \int\limits_{-1}^{+1}{{{P}_{i}}(x){{Q}_{i}}(x)dx=}?$$

(1) Plot $$\displaystyle \left\{ {{P}_{0}}(x),{{P}_{1}}(x),{{P}_{2}}(x),{{P}_{3}}(x) \right\}$$

 * [[Image:Sudheesh HW7 1 fig1.jpg|center|650px]]


 * As $$\displaystyle x\to \pm 1$$, $$\displaystyle {{P}_{n}}(x)\to \pm 1$$. When n is even (0,2..), $$\displaystyle {{P}_{n}}(\pm 1)=1$$ and when n is odd (1,3,...), $$\displaystyle {{P}_{n}}(\pm 1)=\pm 1$$. It can also be seen that $$\displaystyle {{P}_{n}}(x)$$ have steepest slope as $$\displaystyle x\to \pm 1$$.

(2) Plot $$\displaystyle\left\{ {{Q}_{0}}(x),{{Q}_{1}}(x),{{Q}_{2}}(x),{{Q}_{3}}(x) \right\}$$

 * [[Image:Sudheesh HW7 1 fig2.jpg|center|650px]]


 * As $$\displaystyle x\to \pm 1$$, $$\displaystyle {{Q}_{n}}(x)$$ also have steepest slope like $$\displaystyle {{P}_{n}}(x)$$.

(3a) Plot $$\displaystyle \left\{ {{P}_{0}}(x),{{Q}_{0}}(x) \right\}$$

 * [[Image:Sudheesh HW7 1 fig3.jpg|center|650px]]

(3b) Plot $$\displaystyle \left\{ {{P}_{1}}(x),{{Q}_{1}}(x) \right\}$$

 * [[Image:Sudheesh HW7 1 fig4.jpg|center|650px]]

(3c) Plot $$\displaystyle \left\{ {{P}_{2}}(x),{{Q}_{2}}(x) \right\}$$

 * [[Image:Sudheesh HW7 1 fig5.jpg|center|650px]]

(3d) Plot $$\displaystyle \left\{ {{P}_{3}}(x),{{Q}_{3}}(x) \right\}$$

 * [[Image:Sudheesh HW7 1 fig6.jpg|center|650px]]

(3e) Plot $$\displaystyle \left\{ {{P}_{4}}(x),{{Q}_{4}}(x) \right\}$$

 * [[Image:Sudheesh HW7 1 fig7.jpg|center|650px]]


 * When $$\displaystyle n$$ is 'even' (0,2,4), $$\displaystyle {{P}_{n}}(x)$$ is 'even' and $$\displaystyle {{Q}_{n}}(x)$$ is 'odd'


 * When $$\displaystyle n$$ is 'odd' (1,3), $$\displaystyle {{P}_{n}}(x)$$ is 'odd' and $$\displaystyle {{Q}_{n}}(x)$$ is 'even'


 * As a result, in each $$\displaystyle \left\{ {{P}_{n}}(x),{{Q}_{n}}(x) \right\}$$ combination, one is odd and the other is even.


 * So Guess:


 * $$\displaystyle \int\limits_{-1}^{+1}{{{P}_{i}}(x){{Q}_{i}}(x)dx=}0$$

Contributing members
= Problem 5 - Relations Between Inverse Hyperbolic Tangent Function And Legendre Functions $$\displaystyle {{Q}_{0}}(x),{{Q}_{1}}(x)$$=

Given

 * Legendre functions:


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


 * $${{Q}_{0}}(x)=\frac{1}{2}\log \left( \frac{1+x}{1-x} \right)$$
 * $$\displaystyle (Eq. 5.1)$$
 * }
 * }
 * }


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


 * $${{Q}_{1}}(x)=\frac{x}{2}\log \left( \frac{1+x}{1-x} \right)-1$$
 * $$\displaystyle (Eq. 5.2)$$
 * }
 * }
 * }

Find

 * Show that:


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


 * $$\displaystyle{{Q}_{0}}(x)={{\tanh }^{-1}}(x)$$
 * }
 * }
 * }


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


 * $$\displaystyle{{Q}_{1}}(x)=x\cdot {{\tanh }^{-1}}(x)-1$$
 * }
 * }
 * }

Solution

 * We know that:


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


 * $$\tanh (\alpha )=\frac{{{e}^{\alpha }}-{{e}^{-\alpha }}}{{{e}^{\alpha }}+{{e}^{-\alpha }}}$$
 * $$\displaystyle (Eq. 5.3)$$
 * }
 * }
 * }


 * Substitute $$\displaystyle \alpha =\frac{1}{2}\log \left( \frac{1+x}{1-x} \right)$$ in $$\displaystyle Eq. 5.3$$ implies:


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


 * $$\tanh \left( \frac{1}{2}\log \left( \frac{1+x}{1-x} \right) \right)=\tanh \left( \log \sqrt{\frac{1+x}{1-x}} \right)=\frac{{{e}^{\log \sqrt{\frac{1+x}{1-x}}}}-{{e}^{-\log \sqrt{\frac{1+x}{1-x}}}}}{{{e}^{\log \sqrt{\frac{1+x}{1-x}}}}-{{e}^{-\log \sqrt{\frac{1+x}{1-x}}}}}$$
 * }
 * }
 * }


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


 * $$=\frac{{{e}^{\log \sqrt{\frac{1+x}{1-x}}}}-{{e}^{\log \sqrt{\frac{1-x}{1+x}}}}}{{{e}^{\log \sqrt{\frac{1+x}{1-x}}}}-{{e}^{\log \sqrt{\frac{1-x}{1+x}}}}}=\frac{\sqrt{\frac{1+x}{1-x}}-\sqrt{\frac{1-x}{1+x}}}{\sqrt{\frac{1+x}{1-x}}+\sqrt{\frac{1-x}{1+x}}}=\frac{(1+x)-(1-x)}{(1+x)+(1-x)}=\frac{2x}{2}$$
 * }
 * }
 * }


 * That is,


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


 * $$\tanh \left( \frac{1}{2}\log \left( \frac{1+x}{1-x} \right) \right)=x$$
 * }
 * }
 * }


 * Therefore,


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

$${{\tanh }^{-1}}(x)=\frac{1}{2}\log \left( \frac{1+x}{1-x} \right)={{Q}_{0}}(x)$$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * $$\displaystyle (Eq. 5.4)$$
 * }
 * }


 * Now substitute $$\displaystyle Eq. 5.4$$ in $$\displaystyle (Eq. 5.2)$$ yields


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

$${{Q}_{1}}(x)=x\cdot {{\tanh }^{-1}}(x)-1$$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * $$\displaystyle (Eq. 5.5)$$
 * }
 * }

.

 Author solved this problem without referring to the $$\displaystyle F\phi 9$$

Contributing Members
= Problem 9 - Generate Legendre Polynomials Using Second Reccurence Relation=

Given
Second reccurence relation of Legendre polynomials:


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


 * $$\left( n+1 \right){{P}_{n+1}}-\left( 2n+1 \right)x{{P}_{n}}+n{{P}_{n-1}}=0$$
 * $$\displaystyle (Eq. 9.1)$$
 * }
 * }
 * }

Legendre polynomials for n=0,1:


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


 * $$\displaystyle {{P}_{0}}(x)=1$$
 * }
 * }
 * }


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


 * $$\displaystyle {{P}_{1}}(x)=x$$
 * }
 * }
 * }

Find
Generate $$\displaystyle \left\{ {{P}_{2}},{{P}_{3}},{{P}_{4}},{{P}_{5}},{{P}_{6}} \right\}$$ using second reccurence relation starting from $$\displaystyle {{P}_{0}}$$ and $$\displaystyle {{P}_{1}}$$ and compare with [[media:2010_11_09_15_00_14.djvu|Eq.4-6 in page-2 Mtg-36]]

Solution

 * $$\displaystyle Eq. 9.1$$ can be written as:


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


 * $${{P}_{n+1}}=\frac{\left( 2n+1 \right)x{{P}_{n}}-n{{P}_{n-1}}}{\left( n+1 \right)}$$
 * $$\displaystyle (Eq. 9.2)$$
 * }
 * }
 * }

Generate $$\displaystyle {{P}_{2}}$$

 * Substitute $$\displaystyle n=1$$ in $$\displaystyle Eq. 9.2$$ implies:


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


 * $${{P}_{2}}=\frac{\left( 2\times 1+1 \right)x{{P}_{1}}-1\times {{P}_{0}}}{\left( 1+1 \right)}$$
 * }
 * }
 * }


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


 * $${{P}_{2}}=\frac{3x\cdot x-1\times 1}{2}$$
 * }
 * }
 * }


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

$${{P}_{2}}=\frac{1}{2}\left( 3{{x}^{2}}-1 \right)$$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * $$\displaystyle (Eq. 9.3)$$
 * }
 * }

Generate $$\displaystyle {{P}_{3}}$$

 * Plugg in $$\displaystyle n=2$$ in $$\displaystyle Eq. 9.2$$ implies:


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


 * $${{P}_{3}}=\frac{\left( 2\times 2+1 \right)x{{P}_{2}}-2{{P}_{1}}}{\left( 2+1 \right)}$$
 * }
 * }
 * }


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


 * $${{P}_{3}}=\frac{5x\cdot \frac{1}{2}\left( 3{{x}^{2}}-1 \right)-2x}{3}$$
 * }
 * }
 * }


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

$${{P}_{3}}=\frac{1}{2}\left( 5{{x}^{3}}-3x \right)$$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * $$\displaystyle (Eq. 9.4)$$
 * }
 * }

Generate $$\displaystyle {{P}_{4}}$$

 * Put $$\displaystyle n=3$$ in $$\displaystyle Eq. 9.2$$ implies:


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


 * $${{P}_{4}}=\frac{\left( 2\times 3+1 \right)x{{P}_{3}}-3{{P}_{2}}}{\left( 3+1 \right)}$$
 * }
 * }
 * }


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


 * $${{P}_{4}}=\frac{7x\cdot \frac{1}{2}\left( 5{{x}^{3}}-3x \right)-3\times \frac{1}{2}\left( 3{{x}^{2}}-1 \right)}{4}$$
 * }
 * }
 * }


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


 * $${{P}_{4}}=\frac{35{{x}^{4}}-21{{x}^{2}}-9{{x}^{2}}+3}{8}$$
 * }
 * }
 * }


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

$${{P}_{4}}=\frac{1}{8}\left( 35{{x}^{4}}-30{{x}^{2}}+3 \right)$$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * $$\displaystyle (Eq. 9.5)$$
 * }
 * }

Generate $$\displaystyle {{P}_{5}}$$

 * Put $$\displaystyle n=4$$ in $$\displaystyle Eq. 9.2$$ implies:


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


 * $${{P}_{5}}=\frac{\left( 2\times 4+1 \right)x{{P}_{4}}-4{{P}_{3}}}{\left( 4+1 \right)}$$
 * }
 * }
 * }


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


 * $${{P}_{5}}=\frac{9x\cdot \frac{1}{8}\left( 35{{x}^{4}}-30{{x}^{2}}+3 \right)-4\times \frac{1}{2}\left( 5{{x}^{3}}-3x \right)}{5}$$
 * }
 * }
 * }


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


 * $${{P}_{5}}=\frac{63{{x}^{5}}}{8}-\frac{54{{x}^{3}}}{8}+\frac{27x}{8\times 5}-2{{x}^{3}}+\frac{6x}{5}$$
 * }
 * }
 * }


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

$${{P}_{5}}=\frac{1}{8}\left( 63{{x}^{5}}-70{{x}^{3}}+15x \right)$$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * $$\displaystyle (Eq. 9.6)$$
 * }
 * }

Generate $$\displaystyle {{P}_{6}}$$

 * substitute $$\displaystyle n=5$$ in $$\displaystyle Eq. 9.2$$ yields:


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


 * $${{P}_{6}}=\frac{\left( 2\times 5+1 \right)x{{P}_{5}}-5{{P}_{4}}}{\left( 5+1 \right)}$$
 * }
 * }
 * }


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


 * $${{P}_{6}}=\frac{11x\cdot \frac{1}{8}\left( 63{{x}^{5}}-70{{x}^{3}}+15x \right)-5\times \frac{1}{8}\left( 35{{x}^{4}}-30{{x}^{2}}+3 \right)}{6}$$
 * }
 * }
 * }


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


 * $${{P}_{6}}=\frac{231{{x}^{6}}}{16}-\frac{770{{x}^{4}}}{48}+\frac{55{{x}^{2}}}{16}-\frac{175{{x}^{4}}}{48}+\frac{50{{x}^{2}}}{16}-\frac{5}{16}$$
 * }
 * }
 * }


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

$${{P}_{6}}=\frac{1}{16}\left( 231{{x}^{6}}-315{{x}^{4}}+105{{x}^{2}}-5 \right)$$
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * style="width:2%; padding:1px; border:2px solid #FF0000" |
 * $$\displaystyle (Eq. 9.7)$$
 * }
 * }

$$\displaystyle Eq. 9.3 - Eq. 9.5$$ are same as the[[media:2010_11_09_15_00_14.djvu|Eqs.4-6 in page-2 Mtg-36]] respectively.