User:Egm6322.s12.TEAM1..HW/HW2

Problem 1: Pose Question to be solved
 Solved without assistance 

Find:
1. Without calculation, find the properties of $$ \left \{ A_j \right \} \ $$ 2. Compute the first 5 non-zero coefficients 3. Plot 3 curves on the same figure (i) the exact function (ii) Fourier-Legendre series with 3 terms (iii) Fourier-Legendre Series with 5 terms.

Solution:
1. Properties are $$ \left \{ A_j \right \} = \frac{\left \langle P_j,f \right \rangle}{\left \langle P_j,P_j \right \rangle} = \frac{2j+1}{2} \int_{ \mu = -1}^{ \mu = +1} P_j( \mu ) f ( \mu )\, d \mu \ $$

2. Start with function: $$ f( \mu )=T_0 \sinh(1- \mu^2) \ $$ For simplicity let $$ \mu = x \ $$, then we have $$ f( x )= T_0 \sinh(1- x^2) \ $$, which we apply Eq 1.2 to. Values for $$ P_0, P_2, P_4, P_6, P_8 \ $$ from F10 class lecture 36, page2 For $$ j=0 \ $$

For $$ j=2 \ $$

For $$ j=4 \ $$

For $$ j=6 \ $$

For $$ j=8 \ $$ 3.

Problem 2: show equality
 Solved without assistance 

Find:
Show (1)P43-8, i.e.,show that

Solution:
Begin with $$\sum\limits_{j=0}^{\infty }{{P}_{j}}(\mu )=\sum\limits_{j=0}^{\infty }{{P}_{j}}(\mu )$$ then, we have: Further, because $$ {{P}_{j}}(\mu )$$ is not always be zero, we can obtain: $$\begin{align} & {{{\bar{A}}}_{j}}-{{A}_{j}}=0,\forall j \\ & {{{\bar{A}}}_{j}}={{A}_{j}},\forall j \end{align}$$

Problem 3: Legendre homogeneous solution
 Solved without assistance 

Given
$$\displaystyle {{Q}_{0}}(x)=\frac{1}{2}\log \left( \frac{1+x}{1-x} \right)={{\tanh }^{-1}}x $$ (3.1) $$\displaystyle {{Q}_{1}}(x)=\frac{x}{2}\log \left( \frac{1+x}{1-x} \right)-1=x{{\tanh }^{-1}}x-1 $$ (3.2)

Find
Show Eq (3.1) and Eq (3.2)

Solution
Order 0 Legendre equation is that $$\displaystyle(1-{{x}^{2}}){y}''-2x{y}'=0$$ Let z = y' $$\displaystyle {z}'+\frac{2x}{{{x}^{2}}-1}z=0$$ To know the solution, I use integrating factor method. $$\displaystyle h(x) =\exp \left[ \int_ – ^{x}{\frac{2x}{{{x}^{2}}-1}dx} \right] =\exp \left[ \int_ – ^{x}{\frac{1}{1-{{x}^{2}}}d(1-{{x}^{2}})} \right] =\exp [\log (1-{{x}^{2}})] =1-{{x}^{2}}$$  From the previous lecture (PEA1), $$\displaystyle z ={{h}^{-1}}(x)\int_ – ^{x}{h(x)*0dx} =\frac{1-{{x}^{2}}}$$  $$ y =\int{zdx}+{{k}_{1}} ={{k}_{1}}+\int_ – ^{}{\frac{1-{{x}^{2}}}dx} ={{k}_{1}}+\frac{2}\int_ – ^{}{\left( \frac{1}{1+x}+\frac{1}{1-x} \right)dx} ={{k}_{1}}+{{k}_{2}}\frac{1}{2}\log \left( \frac{1+x}{1-x} \right) $$ $$\displaystyle Q_0$$ is one of homogeneous solutions. $$\displaystyle {{Q}_{0}}(x)=\frac{1}{2}\log \left( \frac{1+x}{1-x} \right)$$  Now, We have to find what tanhx is. $$\displaystyle \tanh x = \frac{\sinh x}{\cosh x} = \frac {e^x - e^{-x}} {e^x + e^{-x}} = \frac{e^{2x} - 1} {e^{2x} + 1}$$ $$ x=\frac{1}{2}\log \left( \frac{1+\tanh x}{1-\tanh x} \right)$$ $$ {{\tanh }^{-1}}x=\frac{1}{2}\log \left( \frac{1+x}{1-x} \right) $$ These show that $$\displaystyle {{Q}_{0}}(x)=\frac{1}{2}\log \left( \frac{1+x}{1-x} \right)={{\tanh }^{-1}}x$$

Order 1 Legendre equation is that $$\displaystyle (1-{{x}^{2}}){y}''-2x{y}'+2y=0$$ $$\displaystyle {y}''+\frac{2x}{({{x}^{2}}-1)}{y}'+\frac{2}{(1-{{x}^{2}})}y=0$$  using Integrating Factor Method, $$\displaystyle h(x)={{u}_{1}}^{2}(x)\exp \left[ \int_ – ^ – {{{a}_{1}}(x)dx} \right] ={{[{{P}_{1}}(x)]}^{2}}\exp \left[ \int_ – ^ – {\frac{2x}{{{x}^{2}}-1}dx} \right] ={{x}^{2}}\exp \left[ \int_ – ^ – {\frac{1}{1-{{x}^{2}}}d(1-{{x}^{2}})} \right] ={{x}^{2}}(1-{{x}^{2}})$$ $$\displaystyle {{Q}_{1}}(x) ={{u}_{2}}(x) ={{u}_{1}}(x)\int_ – ^ – {\frac{1}{h(x)}dx} =x\int{\frac{1}{{{x}^{2}}(1-{{x}^{2}})}dx} =x\int{\frac{1}+\frac{1}{(1-{{x}^{2}})}dx} =x\int{\frac{1}{(1-{{x}^{2}})}dx+}x\int{\frac{1}dx} =\frac{x}{2}\log \left( \frac{1+x}{1-x} \right)-1 $$ These show that $$\displaystyle {{Q}_{1}}(x)=\frac{x}{2}\log \left( \frac{1+x}{1-x} \right)-1=x{{\tanh }^{-1}}x-1$$

Given
$$Q_n(x) = P_n(x) tanh^{-1}(x) - 2 \sum_{j=1,3, 5,...}^J \frac {2n-2j+1} {(2n-j+1)j} P_{n-j}(x)$$ $$\displaystyle J = 1+2[\frac {n-1}{2}]$$ $$\displaystyle P_0(x) = 1$$ $$\displaystyle P_1(x) = x$$ $$\displaystyle P_2(x) = \frac {1} {2} (3x^2-1)$$ $$\displaystyle P_3(x) = \frac {1} {2} (5x^3-3x)$$ $$\displaystyle P_4(x) = \frac {1} {8} (35x^4 - 30x^2 + 3)$$

Find
Verify $$\displaystyle Q_0, \,\, Q_1, \,\, Q_2 $$ using above equation.

Solution
When n = 0, $$\displaystyle J = 1+2[\frac {0-1}{2}] = 0$$ $$\displaystyle Q_0(x) = P_0(x) tanh^{-1}(x) = tanh^{-1}(x) $$ When n = 1, $$\displaystyle J = 1+2[\frac {1-1}{2}] = 1$$ $$\displaystyle Q_1(x) = P_1(x) tanh^{-1}(x) - 2 \sum_{j=1,3, 5,...}^1 \frac {2-2+1} {(2-1+1)1} P_{1-1}(x)$$ $$\displaystyle Q_1(x) = P_1(x) tanh^{-1}(x) - 1 = xtanh^{-1}(x) - 1$$ When n = 2, $$\displaystyle J = 1+2[\frac {2-1}{2}] = 2$$ $$\displaystyle Q_2(x) = P_2(x) tanh^{-1}(x) - 2 \sum_{j=1,3, 5,...}^2 \frac {2n-2j+1} {(2n-j+1)j} P_{n-j}(x)$$ $$\displaystyle Q_2(x) = (\frac 1 2 (3x^2-1)) tanh^{-1}(x) - 2 \sum_{j=1,3,5,...}^2 \frac {2(2)-2(j)+1} {(2(2)-(j)+1)(j)} P_{2-j}(x)$$ $$\displaystyle Q_2(x) = (\frac 1 2 (3x^2-1)) tanh^{-1}(x) - (\frac 3 2) (x) $$

Given
$$Q_n(x) = P_n(x) tanh^{-1}(x) - 2 \sum_{j=1,3, 5,...}^J \frac {2n-2j+1} {(2n-j+1)j} P_{n-j}(x)$$ $$\displaystyle J = 1+2[\frac {n-1}{2}]$$

Find
Show that Qn is odd or even depending on the index n.

Solution
$$\displaystyle P_2k(x) $$ is even $$\displaystyle P_{2k+1}(x)$$ is odd

Hence, Let 2k = n = even number k = 1,2,3......  $$Q_2k(x) = P_{2k}(x) tanh^{-1}(x) - 2 \sum_{j=1,3, 5,...}^J \frac {4k-2j+1} {(4k-j+1)j} P_{2k-j}(x)$$ $$\displaystyle tanh^{-1}(x)$$ is always odd. $$\displaystyle P_{2k-j}(x) $$ is odd.

$$\displaystyle Q_2k(x) = (even)(odd) - (odd) $$ When n = even, Q(x) is odd.

Let 2k+1 = n = odd number k = 1,2,3......  $$Q_{2k+1}(x) = P_{2k+1}(x) tanh^{-1}(x) - 2 \sum_{j=1,3, 5,...}^J \frac {2(2k+1)-2j+1} {(2(2k+1)-j+1)j} P_{2(2k+1)-j}(x)$$ $$\displaystyle tanh^{-1}(x)$$ is always odd. $$\displaystyle P_{2(2k+1)-j}(x) $$ is even. $$\displaystyle Q_{2k+1}(x) = (odd)(odd) - (even) $$ When n = odd, Q(x) is even.

Problem 6: Orthogonality of legendre fuctions
 Solved without assistance 

Given:
$$\displaystyle {{L}_{n}}:={{P}_{n}}$$, or, $$\displaystyle {{Q}_{n}}$$ For $$\displaystyle n\ne m$$ $$\begin{align} & <{{L}_{n}},{{L}_{m}}>=0 \\ & <{{L}_{n}},{{L}_{n}}>=<{{P}_{n}},{{P}_{n}}>=\frac{2}{2n+1} \\ \end{align}$$

Find:
1): $$\displaystyle <{{L}_{n}},{{L}_{n}}>=<{{P}_{n}},{{Q}_{n}}>=?$$  2): Show the following equalities:

$$\begin{align} & {{\left( {{r}_{PQ}} \right)}^{2}}={{\left( {{r}_{Q}} \right)}^{2}}[{{\left( \frac \right)}^{2}}+1-2\frac\cos \gamma ] \\ & ={{\left( {{r}_{Q}} \right)}^{2}}[{{\rho }^{2}}+1-2\rho \cos \gamma ] \end{align}$$ $$\displaystyle \cos \gamma =\cos {{\theta }_{Q}}\cos {{\theta }_{P}}\cos \left( {{\varphi }_{Q}}-{{\varphi }_{P}} \right)+\sin {{\theta }_{Q}}sin{{\theta }_{P}}$$ Recall: $$\displaystyle {{\left( {{r}_{PQ}} \right)}^{2}}={{\left( {{r}_{P}} \right)}^{2}}+{{\left( {{r}_{Q}} \right)}^{2}}-2{{r}_{P}}{{r}_{Q}}\cos \gamma $$

Solution:
1): $$\displaystyle <{{P}_{n}},{{Q}_{n}}>=\int\limits_{\mu =-1}^{\mu =+1}{{{P}_{n}}(\mu ){{Q}_{n}}(\mu )}d\mu $$  Then, we will analyze the eveness of these functions: when n is odd, $$\displaystyle {{P}_{n}}$$ is odd, $$\displaystyle {{Q}_{n}}$$ is even, so $$\displaystyle {{P}_{n}}(\mu ){{Q}_{n}}(\mu )$$ is odd. when n is even, $$\displaystyle {{P}_{n}}$$ is even, $$\displaystyle {{Q}_{n}}$$ is odd, so $$\displaystyle {{P}_{n}}(\mu ){{Q}_{n}}(\mu )$$ is odd. So, $$\displaystyle {{P}_{n}}(\mu ){{Q}_{n}}(\mu )$$ is odd whatever n is.  $$\displaystyle <{{P}_{n}},{{Q}_{n}}>=\int\limits_{\mu =-1}^{\mu =+1}{{{P}_{n}}(\mu ){{Q}_{n}}(\mu )}d\mu =0$$  2): According to the definition of spherical coordinates, we have:

$$\begin{align} & {{\left( {{r}_{PQ}} \right)}^{2}}={{\left( {{x}_{P}}-{{x}_{Q}} \right)}^{2}}+{{\left( {{y}_{P}}-{{y}_{Q}} \right)}^{2}}+{{\left( {{z}_{P}}-{{z}_{Q}} \right)}^{2}} \\ & ={{\left( {{r}_{P}}\cos {{\theta }_{P}}\cos {{\varphi }_{P}}-{{r}_{Q}}\cos {{\theta }_{Q}}\cos {{\varphi }_{Q}} \right)}^{2}}+{{\left( {{r}_{P}}\cos {{\theta }_{P}}\sin {{\varphi }_{P}}-{{r}_{Q}}\cos {{\theta }_{Q}}\sin {{\varphi }_{Q}} \right)}^{2}}+{{\left( {{r}_{P}}\sin {{\theta }_{P}}-{{r}_{Q}}\sin {{\theta }_{Q}} \right)}^{2}} \\ & ={{\left( {{r}_{P}} \right)}^{2}}{{\left( {{\cos }^{2}}{{\theta }_{P}}{{\cos }^{2}}{{\varphi }_{P}}+{{\cos }^{2}}{{\theta }_{P}}{{\sin }^{2}}{{\varphi }_{P}}+{{\sin }^{2}}{{\theta }_{P}} \right)}^{2}}+{{\left( {{r}_{Q}} \right)}^{2}}{{\left( {{\cos }^{2}}{{\theta }_{Q}}{{\cos }^{2}}{{\varphi }_{Q}}+{{\cos }^{2}}{{\theta }_{Q}}{{\sin }^{2}}{{\varphi }_{Q}}+{{\sin }^{2}}{{\theta }_{Q}} \right)}^{2}} \\ & -2{{r}_{P}}{{r}_{Q}}(\cos {{\theta }_{P}}\cos {{\varphi }_{P}}\cos {{\theta }_{Q}}\cos {{\varphi }_{Q}}+\cos {{\theta }_{P}}\sin {{\varphi }_{P}}\cos {{\theta }_{Q}}\sin {{\varphi }_{Q}}+\sin {{\theta }_{P}}\sin {{\theta }_{Q}}) \\ & ={{\left( {{r}_{P}} \right)}^{2}}+{{\left( {{r}_{Q}} \right)}^{2}}-2{{r}_{P}}{{r}_{Q}}[\cos {{\theta }_{P}}\cos {{\theta }_{Q}}(\cos {{\varphi }_{P}}\cos {{\varphi }_{Q}}+\sin {{\varphi }_{P}}\sin {{\varphi }_{Q}})+\sin {{\theta }_{P}}\sin {{\theta }_{Q}}] \\ & ={{\left( {{r}_{P}} \right)}^{2}}+{{\left( {{r}_{Q}} \right)}^{2}}-2{{r}_{P}}{{r}_{Q}}[\cos {{\theta }_{P}}\cos {{\theta }_{Q}}\cos ({{\varphi }_{P}}-{{\varphi }_{Q}})+\sin {{\theta }_{P}}\sin {{\theta }_{Q}}] \\ & ={{\left( {{r}_{Q}} \right)}^{2}}[{{\rho }^{2}}+1-2\rho \cos \gamma ] \end{align}$$ Where,

$$\displaystyle\rho =\frac$$ $$\displaystyle \cos \gamma =\cos {{\theta }_{Q}}\cos {{\theta }_{P}}\cos \left( {{\varphi }_{Q}}-{{\varphi }_{P}} \right)+\sin {{\theta }_{Q}}sin{{\theta }_{P}}$$

Problem 7: Verification
 Solved without assistance 

Given:
for $$ \left | x \right \vert <1 \ $$

Find:
Use Equation 7.1 to verify equations 7.2 and 7.3

Problem 8: Generate{P2,...,P6}using RR2 and from generating function expansion
 Solved without assistance 

Given
1.Recurrence relation RR2:
 * {| style="width:100%" border="0"

$$ \displaystyle (n+1)P_{n+1}-(2n+1) x P_n+nP_{n-1}=0 $$
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

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

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

$$ \displaystyle P_1(x)=x $$
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

2.Generating function for Legendre polynomials
 * {| style="width:100%" border="0"

$$ \displaystyle \mathcal G_L(\mu,\rho)=A^{-1/2}(\mu,\rho)=(1-x)^{-1/2} $$
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


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

$$ \displaystyle A(\mu ,\rho):=1-2\mu \rho+\rho^2=:1-x $$
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

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

$$ \displaystyle -x:=-2\mu\rho+\rho^2 $$
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


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

$$ \displaystyle x:=2\mu\rho-\rho^2 $$
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Find

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

$$ \displaystyle {P_0,...,P_6} $$ Using both two methods
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

Solution
Part I

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

$$ \displaystyle (n+1)P_{n+1}-(2n+1)xP_n+nP_{n-1}=0 $$
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }


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

$$ \displaystyle P_0=1, \ P_1=x $$
 * style="width:95%" |
 * style="width:95%" |
 * 
 * }

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

$$ \displaystyle 2P_2-3xP_1+P_0=0 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle 2P_2-3x^2+1=0 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle P_2=\frac{1}{2}(3x^2-1) $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

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

$$ \displaystyle 3P_3-5xP_2+2P_1=0 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle 3P_3-\frac{5x}{2}(3x^2-1)+2x=0 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle P_3=\frac{1}{2}(5x^3-3x) $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

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

$$ \displaystyle 4P_4-7xP_3+3P_2=0 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle 4P_4-\frac{7x}{2}(5x^3-3x)+\frac{3}{2}3x^2-1=0 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle P_4=\frac{1}{8}(35x^4-30x^2+3) $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

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

$$ \displaystyle 5P_5-9xP_4+4P_3=0 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle 5P_5-\frac{9}{8}x(35x^4-30x^2+3)+\frac{4}{2}(5x^3-3x)=0 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle P_5=\frac{1}{8}(63x^5-70x^3+15x) $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

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

$$ \displaystyle 6P_6-11xP_5+5P_4=0 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle 6P_6-\frac{11}{8}x(63x^5-70x^3+15x)+\frac{5}{8}(35x^4-30x^2+3)=0 $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }
 * {| style="width:100%" border="0"

$$ \displaystyle P_6=\frac{1}{16}(231x^6-315x^4+105x^2-5) $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Part II

Using generating function expansion:
 * {| style="width:100%" border="0"

$$ \displaystyle \begin{align} \mathcal G_L(\mu,\rho) &=A^{-1/2}(\mu,\rho)=(1-x)^{-1/2} \\ &=1+(-\frac{1}{2})(-x)+\frac{3}{8}(-x)^2+(-\frac{5}{16})(-x)^3+\frac{35}{128}(-x)^4... \\ &=1+\frac{1}{2}x+\frac{3}{8}x^2+\frac{5}{16}x^3+\frac{35}{128}x^4... \\ &=1+\frac{1}{2}(2\mu \rho-\rho^2)+\frac{3}{8}(4\mu^2\rho^2-4\mu \rho^3+\rho^4)+\frac{5}{16}(8\mu^3\rho^3-12\mu^2\rho^4+6\mu \rho^5-\rho^6) \\ &\ \ \ \ +\frac{35}{128}(16\mu^4\rho^4-32\mu^3\rho^5+24\mu^2\rho^6-6\mu \rho) \\ &=1+\mu \rho \\ &\ \ \ \ +\frac{1}{2}(3\mu^2-1)\rho^2 \\ &\ \ \ \ +\frac{1}{2}(5\mu^3-3\mu)\rho^3 \\ &\ \ \ \ +\frac{1}{8}(35\mu^4-30\mu^2+3)\rho^4 \\ &\ \ \ \ +\frac{1}{8}(63\mu^5-70\mu^3+15\mu)\rho^5 \\ &\ \ \ \ +\frac{1}{16}(231\mu^6-315\mu^4+105\mu^2-5)\rho^6 \end{align} $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

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

$$ \displaystyle \begin{align} P_0 &= 1\\ P_1 &= \mu \\ P_2 &= \frac{1}{2}(3\mu^2-1) \\ P_3 &= \frac{1}{2}(5\mu^3-3\mu) \\ P_4 &= \frac{1}{8}(35\mu^4-30\mu^2+3) \\ P_5 &= \frac{1}{8}(63\mu^5-70\mu^3+15\mu) \\ P_6 &= \frac{1}{16}(231\mu^6-315\mu^4+105\mu^2-5) \end{align} $$
 * style="width:95%" |
 * style="width:95%" |
 * <p style="text-align:right">
 * }

Comparing the two series of results, we can find whatever which method we use, the Legendre polynomials we get are exactly same.(Replace variable $$\mu$$ with x )

=Contributing Members & Referenced Lecture=

=Table of Contributions=