User:Egm6321.f09.team3.diggs/HW6

= Circular Cylindrical Coordinates =

Given
$$x_1 = x = r \cos \theta = \xi_1 \cos \xi_2$$

$$x_2 = y = r \sin \theta = \xi_1 \sin \xi_2$$

$$x_3 = z = z = \xi_3$$

Find
a) $${dx_i}$$ in terms of $${\xi_j}$$ and $${d \xi_k}$$

b) Find $$ds^2 = \sum (dx_i)^2 = \sum(h_k)^2(d \xi)^2$$. Identify $${h_i}$$ in terms of $${\xi_i}$$.

c) Find the Laplacian in cylindrical coordinates

d) Obtain separated equations for the Laplace Equation in circular cylindrical coordinates and identify the Bessel differential equation of the form $$x^2 y'' + x y - (x^2 - \nu^2) = 0$$.

Solution
a)

$$dx_1 = d( \xi_1 \cos \xi_2) = d\xi_1 \cdot \cos \xi_2 $$

$$dx_2 = d( \xi_1 \sin \xi_2) = d \xi_2 \cdot \xi_1 \cdot \cos \xi_2$$

$$dx_3 = d(\xi_3) = d\xi_3$$

$${dx_i} = (\cos \xi_2 \cdot d\xi_1, \xi_1 \cdot \cos \xi_2 \cdot d\xi_2, d\xi_3)$$

b)

$$ds^2 = \sum(dx_1)^2 = (\cos \xi_2)^2 (d\xi_1)^2 + (\xi_1)^2(\cos \xi_2)^2 (d\xi_2)^2 + (1)^2 \cdot (d\xi_3)^2$$

where $${h} = (\cos \xi_2, \xi_1 \cdot \cos \xi_2, 1)$$

c)

$$ \Delta \Psi = \frac{1}{h_1 \cdot h_2 \cdot h_3} \sum_{i=1}^3 \frac {\partial}{\partial \xi_i} \left[ \frac{h_1 \cdot h_2 \cdot h_3}{(h_i)^2} \cdot \frac {\partial \psi}{\partial \xi_i}\right] $$

where $$h_1h_2h_3 = \xi_1 \cdot (\cos \xi_2)^2$$

$$ \Delta \Psi = \frac{1}{\xi_1 \cdot (\cos \xi_2)^2} \left[ \frac {\partial}{\partial \xi_1} \left[ \frac{\xi_1 \cdot (\cos \xi_2)^2}{(\cos \xi_2)^2} \cdot \frac {\partial \psi}{\partial \xi_1}\right] + \frac {\partial}{\partial \xi_2} \left[ \frac{\xi_1 \cdot (\cos \xi_2)^2}{(\xi_1 \cdot \cos \xi_2)^2} \cdot \frac {\partial \psi}{\partial \xi_2}\right] + \frac {\partial}{\partial \xi_3} \left[ \frac{\xi_1 \cdot (\cos \xi_2)^2}{(1)^2} \cdot \frac {\partial \psi}{\partial \xi_3}\right] \right] $$

$$ \Delta \Psi = \frac{1}{\xi_1 \cdot (\cos \xi_2)^2} \left[ \frac {\partial}{\partial \xi_1} \left( \xi_1 \frac {\partial \psi}{\partial \xi_1}\right) + \frac{1}{\xi_1} \frac {\partial^2 \psi}{\partial \xi_2^2} + \xi_1 \cos^2 \xi_2 \frac {\partial^2 \psi}{\partial \xi_3^2} \right]$$

$$ \Delta \Psi = \frac{1}{\xi_1 \cdot \left(\cos \xi_2\right)^2} \frac {\partial}{\partial \xi_1} \left( \xi_1 \frac {\partial \psi}{\partial \xi_1}\right) + \frac{1}{\xi_1^2 \cdot (\cos \xi_2)^2} \frac {\partial^2 \psi}{\partial \xi_2^2} + \frac {\partial^2 \psi}{\partial \xi_3^2} $$

d)

Assume axisymmetric, not a function of $$ \xi_3 $$

$$ \Delta \Psi = \frac{1}{\xi_1 \cdot (\cos \xi_2)^2} \frac {\partial}{\partial \xi_1} ( \xi_1 \frac {\partial \psi}{\partial \xi_1}) + \frac{1}{\xi_1^2 \cdot (\cos \xi_2)^2} \frac {\partial^2 \psi}{\partial \xi_2^2} $$

Let $$psi(\xi_1, \xi_2) = \psi(r, \theta) = R(r) \Theta(\theta)$$

$$ \Delta \Psi = \frac{\Theta}{r \cdot (\cos \theta)^2} \frac {d}{dr} ( r \frac {dR}{dr}) + \frac{R}{r^2 \cdot (\cos \theta)^2} \frac {d^2 \Theta}{d\theta^2} = 0 $$

Multiply by $$ r^2 (\cos \theta)^2 $$

$$ 0 = r \Theta \frac{d}{dr} (r \frac{dR}{dr}) + R \frac{d^2 \Theta}{d \theta^2}$$

Divide by $$R\Theta$$

$$ 0 = \frac{r}{R} \frac{d}{dr} (r \frac{dR}{dr}) + \frac{1}{\Theta} \frac{d^2 \Theta}{d \theta^2}$$

Now the equation is of the form $$0 = \alpha(r) + \beta(\theta)$$ which yields $$\alpha(r) = -\beta(\theta) = k$$, where k is constant

the function in terms of r is:

$$\frac{r}{R} \frac{d}{dr} (r \frac{dR}{dr}) = k$$

$$r \frac{d}{dr} (r \frac{dR}{dr}) = kR$$

$$r(r R'' + R') - kR = 0$$

$$r^2R'' + rR' - kR = 0$$

where $$k = (x^2 - \nu^2)$$ to get the form of the Bessel equation

for completeness, the function in terms of $$\theta$$ is:

$$\frac{1}{\Theta} \frac{d^2\Theta}{d\theta^2} = -k$$

$$\Theta'' + k\Theta = 0$$

= Spherical Coordinates in Astronomy Notation=

Given
$$x_1 = x = r \cos \theta \cos \varphi= \xi_1 \cos \xi_3 \cos \xi_2$$

$$x_2 = y = r \cos \theta \sin \varphi = \xi_1 \cos \xi_3 \sin \xi_2$$

$$x_3 = z = r \sin \theta = \xi_1 \sin \xi_3$$

Find
a) $${dx_i}$$ in terms of $${\xi_j}$$ and $${d \xi_k}$$

b) Find $$ds^2 = \sum (dx_i)^2 = \sum(h_k)^2(d \xi)^2$$. Identify $${h_i}$$ in terms of $${\xi_i}$$.

c) Find the Laplacian and compare to the solution in King

Solution
a)

$$dx_1 = d( \xi_1 \cos \xi_2 \cos \xi_3) = d\xi_1 \cdot \cos \xi_2 \cos \xi_3 $$

$$dx_2 = d( \xi_1 \sin \xi_2 \cos \xi_3) = d \xi_2 \cdot \xi_1 \cdot \cos \xi_2 \cos \xi_3$$

$$dx_3 = d(\xi_1 \sin \xi_3) = d\xi_3 \xi_1 \cos \xi_3$$

$${dx_i} = (\cos \xi_2 \cos \xi_3 \cdot d\xi_1, \xi_1 \cdot \cos \xi_2 \cdot \cos \xi_3 \cdot d\xi_2, \xi_1 \cos \xi_3 d\xi_3)$$

b)

$$ds^2 = \sum(dx_1)^2 = (\cos \xi_2)^2 (\cos \xi_3)^2 (d\xi_1)^2 + (\xi_1)^2(\cos \xi_2)^2 (\cos \xi_3)^2 (d\xi_2)^2 + (\xi_1)^2 (\cos \xi_3)^2 \cdot (d\xi_3)^2$$

where $${h} = (\cos \xi_2 \cdot \cos \xi_3, \xi_1 \cdot \cos \xi_2 \cdot \cos \xi_3, \xi_1 \cdot \cos \xi_3)$$

c)

$$ \Delta \Psi = \frac{1}{h_1 \cdot h_2 \cdot h_3} \sum_{i=1}^3 \frac {\partial}{\partial \xi_i} \left[ \frac{h_1 \cdot h_2 \cdot h_3}{(h_i)^2} \cdot \frac {\partial \psi}{\partial \xi_i}\right] $$

where $$h_1h_2h_3 = \xi_1^2 \cdot (\cos \xi_2)^2 \cdot (\cos \xi_3)^3$$

$$ \Delta \Psi = \frac{1}{\xi_1^2 \cdot (\cos \xi_2)^2 cdot (\cos \xi_3)^3} \left[ \frac {\partial}{\partial \xi_1} \left[ \frac{\xi_1^2 \cdot (\cos \xi_2)^2 \cdot (\cos \xi_3)^3} { (\cos \xi_2 \cdot \cos \xi_3)^2 } \cdot \frac {\partial \psi}{\partial \xi_1}\right] + \frac {\partial}{\partial \xi_2} \left[ \frac{\xi_1^2 \cdot (\cos \xi_2)^2 \cdot (\cos \xi_3)^3}{( \xi_1 \cdot \cos \xi_2 \cdot \cos \xi_3 )^2} \cdot \frac {\partial \psi}{\partial \xi_2}\right] + \frac {\partial}{\partial \xi_3} \left[ \frac{ \xi_1^2 \cdot (\cos \xi_2)^2 \cdot (\cos \xi_3)^3 }{( xi_1 \cdot \cos \xi_3 )^2} \cdot \frac {\partial \psi}{\partial \xi_3}\right] \right] $$

$$ \Delta \Psi = \frac{1}{ \xi_1^2 \cdot (\cos \xi_2)^2 \cdot (\cos \xi_3)^3 } \left[ \cos \xi_3 \frac {\partial}{\partial \xi_1} ( \xi_1^2 \frac {\partial \psi}{\partial \xi_1} + \cos \xi_3 \frac {\partial^2 \psi}{\partial \xi_2^2} + (\cos \xi_2)^2 \frac {\partial}{\partial \xi_3} ( \cos \xi_3 {\partial \psi}{\partial \xi_3} \right]$$

$$ \Delta \Psi = \frac{1}{ \xi_1^2 \cdot (\cos \xi_2)^2 \cdot (\cos \xi_3)^2 } \frac {\partial}{\partial \xi_1} ( \xi_1^2 \frac {\partial \psi}{\partial \xi_1} + \frac{1}{ \xi_1^2 \cdot (\cos \xi_2)^2 \cdot (\cos \xi_3)^2 }  \frac {\partial^2 \psi}{\partial \xi_2^2} + \frac{1}{ \xi_1^2 \cdot (\cos \xi_3)^2 }  \frac {\partial}{\partial \xi_3} ( \cos \xi_3 {\partial \psi}{\partial \xi_3} $$

Converting back to $$(r, \varphi, \theta)$$

$$ \Delta \Psi = \frac{1}{r^2 \cos^2 \varphi \cos^2 \theta} \frac{\partial}{\partial r}(r^2 \frac{\partial \psi}{\partial r}) + \frac{1}{r^2 \cos^2 \varphi \cos^2 \theta} \frac{\partial ^2 \psi}{\partial \varphi^2} + \frac{1}{r^2 \cos^3 \theta} \frac{\partial}{\partial \theta} (\cos \theta \frac{\partial \psi}{\partial \theta}) $$

I have the same thing as you up to here. I am not sure that by assuming that is axisymetrical you can just eliminate the $\cos^2 \varphi$ on the first term. I know that the second term goes to zero but not sure about the first term. And I am not matching the formula that the instructor gave us maybe i am not understanding something here?

Assume axisymmetric (not a function of $$\varphi$$)

$$ \Delta \Psi = \frac{1}{r^2 \cos^2 \theta} \frac{\partial}{\partial r}(r^2 \frac{\partial \psi}{\partial r}) + \frac{1}{r^2 \cos^3 \theta} \frac{\partial}{\partial \theta} (\cos \theta \frac{\partial \psi}{\partial \theta}) = 0 $$

Multiply by $$ \cos^2 \theta $$

$$ \frac{1}{r^2 } \frac{\partial}{\partial r}(r^2 \frac{\partial \psi}{\partial r}) + \frac{1}{r^2 \cos \theta} \frac{\partial}{\partial \theta} (\cos \theta \frac{\partial \psi}{\partial \theta}) = 0 $$

Compare to King, page 45,

$$ \frac{1}{r^2 } \frac{\partial}{\partial r}(r^2 \frac{\partial T}{\partial r}) + \frac{1}{r^2 \sin \bar \theta} \frac{\partial}{\partial \bar \theta} (\sin \bar \theta \frac{\partial T}{\partial \bar \theta}) = 0 $$

\since $$\sin \bar \theta = \sin(\frac {\pi}{2} - \theta) = \cos \theta$$, the equations match!

= Spherical Coordinates in Math/Physics Notation =

Given
$$x_1 = x = r \sin \bar\theta \cos \varphi= \xi_1 \sin \xi_3 \cos \ xi_2$$

$$x_2 = y = r \sin \bar\theta \sin \varphi = \xi_1 \sin \xi_3 \sin \xi_2$$

$$x_3 = z = r \cos \bar \theta = \xi_1 \cos \xi_3$$

Find
a) $${dx_i}$$ in terms of $${\xi_j}$$ and $${d \xi_k}$$

b) Find $$ds^2 = \sum (dx_i)^2 = sum(h_k)^2(d \xi)^2$$. Identify $${h_i}$$ in terms of $${\xi_i}$$.

c) Find the Laplacian and compare to the solution in King

Solution
a)

$$dx_1 = d( \xi_1 \cos \xi_2 \sin \xi_3) = d\xi_1 \cdot \cos \xi_2 \sin \xi_3 $$

$$dx_2 = d( \xi_1 \sin \xi_2 \sin \xi_3) = d \xi_2 \cdot \xi_1 \cdot \cos \xi_2 \sin \xi_3$$

$$dx_3 = d(\xi_1 \cos \xi_3) = d\xi_3 \xi_1 (- \sin \xi_3)$$

$${dx_i} = (\cos \xi_2 \sin \xi_3 \cdot d\xi_1, \xi_1 \cdot \cos \xi_2 \cdot \sin \xi_3 \cdot d\xi_2, \xi_1 (-\sin \xi_3) d\xi_3)$$

b)

$$ds^2 = \sum(dx_1)^2 = (\cos \xi_2)^2 (\sin \xi_3)^2 (d\xi_1)^2 + (\xi_1)^2(\cos \xi_2)^2 (\sin \xi_3)^2 (d\xi_2)^2 + (\xi_1)^2 (-\sin \xi_3)^2 \cdot (d\xi_3)^2$$

where $${h} = (\cos \xi_2 \cdot \sin \xi_3, \xi_1 \cdot \cos \xi_2 \cdot \sin \xi_3, - xi_1 \cdot \sin \xi_3)$$

c)

$$ \Delta \Psi = \frac{1}{h_1 \cdot h_2 \cdot h_3} \sum_{i=1}^3 \frac {\partial}{\partial \xi_i} \left[ \frac{h_1 \cdot h_2 \cdot h_3}{(h_i)^2} \cdot \frac {\partial \psi}{\partial \xi_i}\right] $$

where $$h_1h_2h_3 = - \xi_1^2 \cdot (\cos \xi_2)^2 \cdot (\sin \xi_3)^3$$

$$ \Delta \Psi = \frac{1}{- \xi_1^2 \cdot (\cos \xi_2)^2 cdot (\sin \xi_3)^3} \left[ \frac {\partial}{\partial \xi_1} \left[ \frac{-\xi_1^2 \cdot (\cos \xi_2)^2 \cdot (\sin \xi_3)^3} { (\cos \xi_2 \cdot \sin \xi_3)^2 } \cdot \frac {\partial \psi}{\partial \xi_1}\right] + \frac {\partial}{\partial \xi_2} \left[ \frac{-\xi_1^2 \cdot (\cos \xi_2)^2 \cdot (\sin \xi_3)^3}{( \xi_1 \cdot \cos \xi_2 \cdot \sin \xi_3 )^2} \cdot \frac {\partial \psi}{\partial \xi_2}\right] + \frac {\partial}{\partial \xi_3} \left[ \frac{ -\xi_1^2 \cdot (\cos \xi_2)^2 \cdot (\sin \xi_3)^3 }{( xi_1 \cdot \sin \xi_3 )^2} \cdot \frac {\partial \psi}{\partial \xi_3}\right] \right] $$

$$ \Delta \Psi = \frac{-1}{ \xi_1^2 \cdot (\cos \xi_2)^2 \cdot (\sin \xi_3)^3 } \left[ -\sin \xi_3 \frac {\partial}{\partial \xi_1} ( \xi_1^2 \frac {\partial \psi}{\partial \xi_1} + -\sin \xi_3 \frac {\partial^2 \psi}{\partial \xi_2^2} + -(\cos \xi_2)^2 \frac {\partial}{\partial \xi_3} ( \sin \xi_3 {\partial \psi}{\partial \xi_3} \right]$$

$$ \Delta \Psi = \frac{1}{ \xi_1^2 \cdot (\cos \xi_2)^2 \cdot (\sin \xi_3)^2 } \frac {\partial}{\partial \xi_1} ( \xi_1^2 \frac {\partial \psi}{\partial \xi_1} + \frac{1}{ \xi_1^2 \cdot (\cos \xi_2)^2 \cdot (\sin \xi_3)^2 }  \frac {\partial^2 \psi}{\partial \xi_2^2} + \frac{1}{ \xi_1^2 \cdot (\sin \xi_3)^3 }  \frac {\partial}{\partial \xi_3} ( \sin \xi_3 {\partial \psi}{\partial \xi_3} $$

Converting back to $$(r, \varphi, \theta)$$

$$ \Delta \Psi = \frac{1}{r^2 \cos^2 \varphi \sin^2 \bar\theta} \frac{\partial}{\partial r}(r^2 \frac{\partial \psi}{\partial r}) + \frac{1}{r^2 \cos^2 \varphi \sin^2 \bar \theta} \frac{\partial ^2 \psi}{\partial \varphi^2} + \frac{1}{r^2 \sin^3 \bar \theta} \frac{\partial}{\partial \bar\theta} (\sin \bar \theta \frac{\partial \psi}{\partial \bar \theta}) $$

Assume axisymmetric (not a function of $$\varphi$$)

$$ \Delta \Psi = \frac{1}{r^2 \sin^2 \bar \theta} \frac{\partial}{\partial r}(r^2 \frac{\partial \psi}{\partial r}) + \frac{1}{r^2 \sin^3 \bar \theta} \frac{\partial}{\partial \bar \theta} (\sin \bar \theta \frac{\partial \psi}{\partial \bar \theta}) = 0 $$

Multiply by $$ \sin^2 \bar \theta $$

$$ \frac{1}{r^2 } \frac{\partial}{\partial r}(r^2 \frac{\partial \psi}{\partial r}) + \frac{1}{r^2 \sin \bar \theta} \frac{\partial}{\partial \bar \theta} (\sin \bar \theta \frac{\partial \psi}{\partial \bar \theta}) = 0 $$

Compare to King, page 45,

$$ \frac{1}{r^2 } \frac{\partial}{\partial r}(r^2 \frac{\partial T}{\partial r}) + \frac{1}{r^2 \sin \bar \theta} \frac{\partial}{\partial \bar \theta} (\sin \bar \theta \frac{\partial T}{\partial \bar \theta}) = 0 $$

The equations match!

= Solution by Quadratic Equation =

Given
$$\lambda (\lambda +1 ) = n(n +1)$$

Find
Solutions $$\lambda = n$$ and $$\lambda = -(n + 1)$$

Solution
Using the equation $$\frac{-b +/- \sqrt{4ac - b^2}}{2a}$$

where a = 1, b = 1, c = -n(n+1),

$$\lambda = \frac{-b +/- \sqrt{4ac - b^2}}{2a} = \frac{-1 +/- \sqrt{4(1)(-n(n+1) - 1}}{2 \cdot 1}$$

$$\lambda = \frac{-b +/- \sqrt{4ac - b^2}}{2a} = \frac{-1 +/- (2n + 1)}{2}$$

u\sing the + solution:

$$\lambda = \frac{-1 + (2n + 1)}{2} = n$$

u\sing the - solution:

$$\lambda = \frac{-1 - (2n + 1)}{2} = - (n + 1)$$

= Prove Polynominal Statements Agree =

Given
$${P}_{0} = 1$$

$${P}_{1} = x$$

$${P}_{2} = \frac{1}{2}(3{x}^{2} - 1)$$

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

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

And,

$$ {P}_{n}(x) = \sum_{i=0}^{[\frac{n}{2}]}{(-1)}^{i}\frac{(2n-2i)!*{x}^{n-2i}}{{2}^{n}*i!(n-i)!(n-2i)!}$$

Show
The polynomials $$ {P}_{0}, {P}_{1}, {P}_{2}, {P}_{3}, {P}_{4}$$ are in agreement with the summation in $${P}_{n}$$.

Solution
''I have worked the problem from both directions and this is the best way I could get agreement, feel free to edit, correct, or discard. I have finished most of the assignment on paper and will be uploading my solutions (for what is still left blank) over the next 2 days. I am done for today though. - Barrett ''

$$ {P}_{n}(x) = \sum_{i=0}^{[\frac{n}{2}]}{(-1)}^{i}\frac{(2n-2i)!*{x}^{n-2i}}{{2}^{n}*i!(n-i)!(n-2i)!}$$

For n=0,

$$ {P}_{0}(x) = \sum_{i=0}^{[\frac{0}{2}]}{(-1)}^{0}\frac{(2*0-2*0)!*{x}^{0-2*0}}{{2}^{0}*0!(0-0)!(0-2*0)!}$$

(this is solved knowing 0! = 1)

$$ {P}_{0}(x) = 1*\frac{1!*1}{1!*1!*1!} = 1 $$, this is same as eq(1) pg 31-3 from the notes.

For n = 1,

$$ {P}_{1}(x) = {(-1)}^{0}\frac{(2*1-2*0)!*{x}^{1-2*0}}{{2}^{1}*0!(1-2*0)!(1-2*0)!}$$

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

For n = 2,

$$ {P}_{2}(x) = \sum_{i=0}^{1}{(-1)}^{i}\frac{(2*2-2i)!*{x}^{2-2i}}{{2}^{2}*i!(2-i)!(2-2i)!}$$

$$ {P}_{2}(x) = {(-1)}^{0}\frac{(2*2-2*0)!*{x}^{2-2*0}}{{2}^{2}*0!(2-0)!(2-2*0)!} + {(-1)}^{1}\frac{(2*2-2*1)!*{x}^{2-2*1}}{{2}^{2}*1!(2-1)!(2-2*1)!}$$

$$ {P}_{2}(x) = \frac{24}{16}*{x}^{2}+\frac{1}{2} = \frac{1}{2}(3*{x}^{2} + 1)$$

For n = 3,

$$ {P}_{3}(x) = \sum_{i=0}^{1}{(-1)}^{i}\frac{(2*3-2i)!*{x}^{3-2i}}{{2}^{3}*i!(3-i)!(3-2i)!}$$

$$ {P}_{3}(x) = {(-1)}^{0}\frac{(2*3-2*0)!*{x}^{3-2*0}}{{2}^{3}*0!(3-0)!(3-2*0)!} + {(-1)}^{1}\frac{(2*3-2*1)!*{x}^{3-2*1}}{{2}^{3}*1!(3-1)!(3-2*1)!}$$

$$ {P}_{3}(x) = \frac{720}{288}*{x}^{3}+\frac{3}{2}*x = \frac{1}{2}(5*{x}^{2} + 3*x)$$

For n = 4,

$$ {P}_{4}(x) = \sum_{i=0}^{2}{(-1)}^{i}\frac{(2*4-2i)!*{x}^{4-2i}}{{2}^{4}*i!(4-i)!(4-2i)!}$$

$$ {P}_{4}(x) = {(-1)}^{0}\frac{(2*4-2*0)!*{x}^{4-2*0}}{{2}^{4}*0!(4-0)!(4-2*0)!} + {(-1)}^{1}\frac{(2*4-2*1)!*{x}^{4-2*1}}{{2}^{4}*1!(4-1)!(4-2*1)!} + {(-1)}^{2}\frac{(2*4-2*2)!*{x}^{4-2*2}}{{2}^{4}*2!(4-2)!(4-2*2)!}$$

$$ {P}_{4}(x) = \frac{35}{8}*{x}^{4} - \frac{15}{4}*{x}^{2} + \frac{3}{8} $$

= Verify Polynominal Statement is a Solution of the Legendre Equation =

Given
The Legendre Equation

$$ (1-x^2)y''-2xy'+n(n+1)y=0$$

and the Legendre Polymomial statement

$${P}_{0} = 1$$

$${P}_{1} = x$$

$${P}_{2} = \frac{1}{2}(3{x}^{2} - 1)$$

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

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

Find
The solution such that the polynominal statement agrees

Solution
$$

P_0=1$$

$$P_0'=P_0''=0 $$

Substituting P0 for y yields

$$ (1-x^2)(0)-2x(0)+0(0+1)1=0$$

so P0 satisfies the Legendre Equation

$$ P_1=x $$

$$P_1'=1$$

$$P_1''=0 $$

Substituting P1 for y yields

$$ (1-x^2)(0)-2x(1)+1(1+1)x=0$$

$$ -2x+2x=0$$

so P1 satisfies the Legendre Equation

$$ P_2=\frac{1}{2}(3x^2-1)$$

$$P_2'=3x$$

$$P_2''=3 $$

Substituting P2 for y yields

$$ (1-x^2)(3)-2x(3x)+2(2+1)(\frac{1}{2}3x^2-1)=0$$

$$ 3-3x^2-6x^2+9x^2-3=0$$

so P2 satisfies the Legendre Equation

$$ P_3=\frac{1}{2}(5x^3-3x)$$

$$P_3'=\frac{15}{2}x^2-\frac{3}{2}$$

$$P_3''=15x $$

Substituting P3 for y yields

$$ (1-x^2)(15x)-2x(\frac{15/2}x^2-\frac{3}{2} )+3(3+1)(\frac{1}{2}(5x^3-3x) =0$$

$$ 15x-15x^3-15x^3+3x+30x^3-18x=0$$

so P3 satisfies the Legendre Equation

$$ P_4=\frac{35}{8}x^4-\frac{15}{4}x^2+\frac{3}{8} $$

$$P_4'=\frac{35}{2}x^3-\frac{15}{2}x$$

$$P_4''=\frac{105}{2}x^2-\frac{15}{2} $$

Substituting P4 for y yields

$$ (1-x^2)(\frac{105}{2}x^2-\frac{15}{2} )-2x(\frac{35}{2}x^3-\frac{15}{2}x )+4(4+1)(\frac{35}{8}x^4-\frac{15}{4}x^2+\frac{3}{8}) =0$$

$$ \frac{105}{2}x^2-\frac{105}{2}x^4-\frac{15}{2} +\frac{15}{2}x^2-\frac{70}{2}x^4+\frac{30}{2}x^2+\frac{175}{2}x^4-\frac{150}{2}x^2+\frac{15}{2}=0$$

so P4 satisfies the Legendre Equation

= Odd/Even Functions =

Given
A function is even if $$ f(-x)= f(x)$$

A function is odd if $$ f(-x) = -f(x)$$

Find
Show that the sum of 2 odd functions is odd

Solution
Let $$f = \sum g_i$$

If $${g_1}$$ is odd, then f is odd.

If $${g_i}$$ is even, then f is even.

= Proof of Polynominal Statement as Odd/Even =

Given
$$P_{2k}$$ and $$P_{2k+1}$$

Find
$$P_{2k}$$ is even

$$P_{2k+1}$$ is odd

Solution
The polynominal statement is:

$$ {P}_{n}(x) = \sum_{i=0}^{[\frac{n}{2}]}{(-1)}^{i}\frac{(2n-2i)! \cdot {x}^{n-2i}}{{2}^{n} \cdot i!(n-i)!(n-2i)!}$$

For n = 2k, the polynomial statement becomes:

$$ {P}_{2k}(x) = \sum_{i=0}^{[\frac{2k}{2}]}{(-1)}^{i}\frac{(2 \cdot 2k -2i)! \cdot {x}^{2k-2i}}{{2}^{2k} \cdot i!(2k-i)!(2k-2i)!}$$

Because the definition of odd or even depends upon only the function of x, we can rename the portion of $$ {P}_{2k}(x) $$ that depends on x as:

$$ p_{2k}(x) = \sum_{i=0}^{[k]}x^{2k-2i}$$

for any value of k, $$p_{2k}$$ includes an x to an even power, which makes the whole function, $${P}_{2k}$$, even!

For n = 2k+1, the polynomial statement becomes:

$$ {P}_{2k+1}(x) = \sum_{i=0}^{[\frac{2k+1}{2}]}{(-1)}^{i}\frac{(2 \cdot (2k+1) -2i)! \cdot {x}^{2k + 1 -2i}}{{2}^{2k+1} \cdot i!(2k+1-i)!(2k+1-2i)!}$$

Because the definition of odd or even depends upon only the function of x, we can rename the portion of $$ {P}_{2k}(x) $$ that depends on x as:

$$ p_{2k+1}(x) = \sum_{i=0}^{[\frac {2k+1}{2}]}x^{2k+1-2i}$$

for any value of k, $$p_{2k+1}$$ includes an x to an odd power, which makes the whole function, $${P}_{2k+1}$$, odd!

= Find Coefficients =

Given
$$q(x) = c_0 + c_1 x + c_2 x^2 + c_3 x^3 + c_4 x^4$$

and

$$c_0 = 3 $$

$$c_1 = 10$$

$$c_2 = 15$$

$$c_3 = -1$$

$$c_4 = 5$$

Find
Find $$a_i$$ such that $$q = \sum a_i P_i$$.

Plot $$q = \sum c_i x^i = \sum a_i P_i$$.

Solution
Since $$q(x) = 3 + 10 x + 15 x^2 - x^3 + 5x^4$$

and $$ q = a_0 \cdot P_0 + a_1 \cdot P_1 + a_2 \cdot P_2 + a_3 \cdot P_3 + a_4 \cdot P_4 $$

Note $$P_0, P_1, P_2, P_3, P_4, P_4$$ have been solved in prior homework problems.

Solve using matrices, such that:

$$\begin{bmatrix} 3\\ 10x \\ 15x^2 \\ -x^3 \\ 5x^4 \end{bmatrix} = \begin{bmatrix} a_0\\ a_1 \\ a_2 \\ a_3\\ a_4 \end{bmatrix} \begin{bmatrix} 1 & 0 & -\frac{1}{2} & 0 & \frac{3}{8} \\ 0 & x & 0 & \frac{3}{2} x^2 & 0 & -\frac{15}{4}x^2 \\ 0 & 0 & 0 & \frac{5}{2} x^3 & 0 \\ 0 & 0 & 0 & 0 & \frac{35}{8}x^4 \end{bmatrix}$$

Solving for the column matrix of a values:

$$\begin{bmatrix} a_0\\ a_1 \\ a_2 \\ a_3\\ a_4 \end{bmatrix} = \begin{bmatrix} 9 \\ 9.4 \\ 12.857 \\ -0.4 \\ 1.1428 \end{bmatrix}$$

This yields two equations for q:

$$q = \sum c_i x^i = 3 + 10x + 15x^2 - x^3 + 5x^4$$

$$q = 9(1) + 9.4 x + 12.857 (\frac{1}{2}(3x^2 -1)) - 0.4(\frac{1}{2}(5x^2 - 3x)) + 1.1428(\frac{35}{8}x^4 - \frac{15}{4}x^2 + \frac{3}{8})$$

Plot the two solutions to ensure they match:

= HW 4 Question, King 1.1.b =

Given
$$u_1(x) = \frac{1}{x}\sin x$$

and the ODE

$$xy'' + 2y' + xy = 0$$

Find
Prove $$u_1(x) = \frac{1}{x}\sin x$$

and then find $$u_2(x)$$ u\sing the method of reduction of order 2

Solution
First, determine if the ODE is exact:

where $$ f(x,y,p) = x $$ and $$ g(x,y,p) = 2p+xy $$

Condition 2.i is:

$$ f_{xx} + 2p \cdot f_{xy} + p^2 \cdot f_{yy} = g_{xp} + p \cdot g_{yp} - g_y $$

and the partial derivatives are:

$$ f_{xx} = f_{xy} = f_{yy} = g_{xp} = g_{yp} = 0 $$

or $$ g_y = x $$

which yields

$$ 0 + 2p \cdot 0 + p^2 \cdot 0 = 0 + p \cdot 0 - x $$

which is not satified, therefore there's no reason to go on to the second condition.

Next, we can find the integrating factor ($$h(x,y,) = x^my^n$$) to make the equation exact OR use the method of trial solution.

(I tried the integration factors method and could not find a value of m to satisfy, so we'll move directly into the method of trial solutions.)

In the method of trial solution, first try $$ y(x) = exp(rx) $$

Take the first and second derivatives and substitute back into the ODE, cancelling the term $$ exp(rx) $$ to get:

$$ xr^2 + 2r + x = 0 $$

\since the solution requires r = f(x), we move on to another trial solution.

Our second trial solution is $$ y(x) = x \cdot exp(rx) $$

Take the first and second derivatives and substitute back into the ODE, cancelling the term $$ exp(rx) $$ to get:

$$ x^2r^2 + 4rx + x^2 + 2 = 0 $$

which again requires r = f(x), so we move on to a third trial solution.

Our third trial solution is $$ y(x) = \frac{1}{x} \cdot exp(rx) $$

Take the first and second derivatives and substitute back into the ODE, cancelling the term $$ exp(rx) $$ to get:

$$ r^2 + 1 = 0 $$

which is $$ r = +/- i $$

By deMoivre, the solution is

$$u_1(x) = \frac{1}{x} \sin x$$

Now, \since we have $$u_1(x)$$, we need to find $$u_2(x)$$ u\sing the reduction of order method 2

We assume the full solution $$ y = U(x) u_1(x) $$

\since the process is the same as shown in Problem #1, we go straight to the solution:

$$ u_2(x) = u_1(x) \int \frac{1}{u_1(t)^2} exp(- \int a_1(s) ds) dt $$

where $$ a_1(s) = \frac{2}{s}$$

such that $$ u_2(x) = \frac{1}{x} \sin x \int \frac{1}{(\sin t)^2} dt = -\frac{\cos(x)}{x} $$

Therefore, $$ u_2(x) =-\frac{\cos(x)}{x} $$

= Properties and Calculation of A(n) =

Given
$$\psi(1, \theta) = f(\theta) = T_0 \cos \theta$$

or

$$\psi(1, \theta) = f(\mu) = T_0 \sqrt{1- \mu^2}$$

and

$${A}_{n} = \frac{2n+1}{2}\int_{-1}^{1}f(\mu){P}_{n}(\mu) d\mu$$

Find
a) without calculation, the properties of $$A_n$$, i.e., $$A_{2k} = 0$$? or $$A_{2k+1} = 0$$?

b) Compute 3 non-zero coefficients of $$A_n$$, using (i) analytical methods (e.g. integration table) and (ii) numerically using Gauss_Legendre, accurate to 5%

Solution
a) $$ f(\mu) = {T}_{o}{(1-{\mu}^{2})}^{\frac{1}{2}}$$ is even and is an element of a set of Polynomials of degree 2 or less. Therefore it can be concluded $$ {A}_{n} = 0 $$ for all $$ n = 2k+1 $$ where the polynomial expressions are odd. Also, it is only necessary to evaluate $${A}_{0}$$ and $${A}_{2}$$.

b) (i) Using analytical integration techniques the two even (non-zero) coefficients are solved as follows:


 * $${A}_{0} = \frac{1}{2}*\int_{-1}^{1}({T}_{0}{(1-{\mu}^{2})}^{\frac{1}{2}}{P}_{0}(\mu)) d\mu$$, where $${P}_{0}(\mu) = 1$$

using the integration tables,


 * $${A}_{0} = \frac{1}{2}*\frac{\pi{T}_{0}}{2} = \frac{\pi{T}_{0}}{4} $$

for the next non-zero coefficient,


 * $${A}_{2} = \frac{5}{2}\int_{-1}^{1}({T}_{0}{(1-{\mu}^{2})}^{\frac{1}{2}}{P}_{2}(\mu)) d\mu$$, where $${P}_{2}(\mu) = \frac{1}{2}(3{\mu}^{2} - 1)$$

using the integration tables,


 * $${A}_{2} = \frac{5}{4}*\frac{-\pi{T}_{0}}{8} = \frac{-5\pi{T}_{0}}{32} $$


 * $${A}_{4} = \frac{9}{2}*\int_{-1}^{1}({T}_{0}{(1-{\mu}^{2})}^{\frac{1}{2}}{P}_{4}(\mu)) d\mu$$, where $${P}_{4}(\mu) = \frac{35}{8}{\mu}^{4} - \frac{15}{4}{\mu}^{2} + \frac{3}{8}$$

using the integration tables,


 * $${A}_{4} = \frac{9}{2}*\frac{-\pi{T}_{0}}{128} = \frac{-9\pi{T}_{0}}{256} $$

(ii) Using Gauss-Legendre the two even (non-zero) coefficients are computed numerically as follows:


 * $${A}_{n} = \frac{2n+1}{2}\int_{-1}^{1}f(\mu){P}_{n}(\mu) d\mu = \frac{2n+1}{2}\sum_{i=1}^{n}{w}_{i}f({x}_{i}) $$


 * $$ w_i = \frac{2}{\left( 1-x_i^2 \right) (P'_n(x_i))^2} \,\!$$

for n = 2,


 * $$A_2 = \frac{2(2)+1}{2}\sum_{i=1}^{2}(\frac{2}{\left( 1-x_i^2 \right) (P'_2(x_i))^2}f(x_i))$$


 * $$A_2 = \frac{5}{2}*2*T_0\sum_{i=1}^{2}\frac{(1-{x_i}^{2})^{\frac{1}{2}}}{(1-{x_i}^{2})*9{x_i}^{2}} $$

$$x_i$$ is the roots of the Legendre polynomial, therefore $$x_i = \pm\sqrt{1/3}$$


 * $$A_2 = 5T_0(.408248 - .288675) = .597866T_0 $$

for n = 4,


 * $$A_4 = \frac{2(4)+1}{2}\sum_{i=1}^{4}(\frac{2}{\left( 1-x_i^2 \right) (P'_4(x_i))^2}f(x_i))$$


 * $$A_4 = \frac{9}{2}*2*T_0\sum_{i=1}^{2}\frac{(1-{x_i}^{2})^{\frac{1}{2}}}{(1-{x_i}^{2})*{(\frac{35}{2}x_i^3 - \frac{15}{2}x_i)}^{2}} $$

$$x_i$$ is the roots of the Legendre polynomial, therefore $$x_i = \pm\sqrt{\Big( 3 \pm 2\sqrt{6/5} \Big)/7}$$

= Gauss- Legendre Quadrature =

Given
The Legendre Polynomial

Find
a) Verify the table in Wikipedia (analytical expressions for $$x_j$$, $$w_j$$ for j = 1, ..., n; n = 1, ..., 5).

b) Verify the expressions for $$P_n$$ with n=0, 1, ..., 6

c) Evaluate numerically $$x_j$$, $$w_j$$ and compare results with Abram and Stegun

Solution
The Wikipedia table in question is:

For n=1, $$P_1(x) = x$$, let $$P_1(x) = x = 0$$ to find the roots, such that the root is $$x_1 = 0$$.

$$P_1'(x) = 1$$

$$P_2(x) = \frac{1}{2} (3x^2 - 1)$$

$$w_1(x=0) = \frac{-2}{(2)(1)(\frac{1}{2}(3(0)-1))} = \frac{-2}{-1} = 2$$

as expected from the table.

For n = 2, $$P_2(x) = \frac{1}{2} (3x^2 - 1)$$, let $$P_2(x) = \frac{1}{2} (3x^2 - 1) = 0$$ to find the roots, such that the roots are $$x_{1,2} = +/- \frac{1}{\sqrt {3}}$$.

$$P_2'(x) = 3x$$

$$P_3(x) = \frac{1}{2} (5x^3 - 3x)$$

$$w_{1,2}(x=+/- \frac{1}{\sqrt {3}}) = \frac{-2}{(3)(3(+/- \frac{1}{\sqrt {3}}))(\frac{1}{2}(5(+/- \frac{1}{\sqrt {3}})^3-3(+/- \frac{1}{\sqrt {3}})))} = 1$$

as expected from the table.

For n = 3, $$P_3(x) = \frac{1}{2} (5x^3 - 3x)$$, let $$P_3(x) = \frac{1}{2} (5x^3 - 3x) = 0$$ to find the roots, such that the roots are $$x_{1,2} = +/- \sqrt{\frac{3}{5}}$$, $$x_3 = 0$$.

$$P_3'(x) = \frac{15}{2}x^2 - \frac{3}{2}$$

$$P_4(x) = \frac{35}{8}x^4 - \frac{15}{4}x^2 - \frac{3}{8} $$

$$w_{1,2}(x=+/- \sqrt{\frac{3}{5}}) = \frac{-2}{(4)(7.5(+/- \sqrt )- \frac{3}{2})(\frac{1}{8}(35(+/- \sqrt{\frac{3}{5}})^4-30(+/- \sqrt{\frac{3}{5}}) - 3))} = \frac{10}{63}$$

$$w_3(x=0) = \frac{-2}{(4)(7.5(0)- \frac{3}{2})(\frac{1}{8}(35(0)^4-30(0) - 3))} = -\frac{8}{9} $$

WHICH DOES NOT MATCH the table.

Need n = 4

Need n = 5

b)

Show $$P_n$$ follows the table for n = 0, ..., 6

$$ {P}_{n}(x) = \sum_{i=0}^{[\frac{n}{2}]}{(-1)}^{i}\frac{(2n-2i)!*{x}^{n-2i}}{{2}^{n}*i!(n-i)!(n-2i)!}$$

For n=0,

$$ {P}_{0}(x) = \sum_{i=0}^{[\frac{0}{2}]}{(-1)}^{0}\frac{(2*0-2*0)!*{x}^{0-2*0}}{{2}^{0}*0!(0-0)!(0-2*0)!}$$

(this is solved knowing 0! = 1)

$$ {P}_{0}(x) = 1*\frac{1!*1}{1!*1!*1!} = 1 $$, this is same as eq(1) pg 31-3 from the notes.

For n = 1,

$$ {P}_{1}(x) = {(-1)}^{0}\frac{(2*1-2*0)!*{x}^{1-2*0}}{{2}^{1}*0!(1-2*0)!(1-2*0)!}$$

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

For n = 2,

$$ {P}_{2}(x) = \sum_{i=0}^{1}{(-1)}^{i}\frac{(2*2-2i)!*{x}^{2-2i}}{{2}^{2}*i!(2-i)!(2-2i)!}$$

$$ {P}_{2}(x) = {(-1)}^{0}\frac{(2*2-2*0)!*{x}^{2-2*0}}{{2}^{2}*0!(2-0)!(2-2*0)!} + {(-1)}^{1}\frac{(2*2-2*1)!*{x}^{2-2*1}}{{2}^{2}*1!(2-1)!(2-2*1)!}$$

$$ {P}_{2}(x) = \frac{24}{16}*{x}^{2}+\frac{1}{2} = \frac{1}{2}(3*{x}^{2} + 1)$$

For n = 3,

$$ {P}_{3}(x) = \sum_{i=0}^{1}{(-1)}^{i}\frac{(2*3-2i)!*{x}^{3-2i}}{{2}^{3}*i!(3-i)!(3-2i)!}$$

$$ {P}_{3}(x) = {(-1)}^{0}\frac{(2*3-2*0)!*{x}^{3-2*0}}{{2}^{3}*0!(3-0)!(3-2*0)!} + {(-1)}^{1}\frac{(2*3-2*1)!*{x}^{3-2*1}}{{2}^{3}*1!(3-1)!(3-2*1)!}$$

$$ {P}_{3}(x) = \frac{720}{288}*{x}^{3}+\frac{3}{2}*x = \frac{1}{2}(5*{x}^{2} + 3*x)$$

For n = 4,

$$ {P}_{4}(x) = \sum_{i=0}^{2}{(-1)}^{i}\frac{(2*4-2i)!*{x}^{4-2i}}{{2}^{4}*i!(4-i)!(4-2i)!}$$

$$ {P}_{4}(x) = {(-1)}^{0}\frac{(2*4-2*0)!*{x}^{4-2*0}}{{2}^{4}*0!(4-0)!(4-2*0)!} + {(-1)}^{1}\frac{(2*4-2*1)!*{x}^{4-2*1}}{{2}^{4}*1!(4-1)!(4-2*1)!} + {(-1)}^{2}\frac{(2*4-2*2)!*{x}^{4-2*2}}{{2}^{4}*2!(4-2)!(4-2*2)!}$$

$$ {P}_{4}(x) = \frac{35}{8}*{x}^{4} - \frac{15}{4}*{x}^{2} + \frac{3}{8} $$

For n = 5,

$$ {P}_{5}(x) = \sum_{i=0}^{2}{(-1)}^{i}\frac{(2*5-2i)!*{x}^{5-2i}}{{2}^{5}*i!(5-i)!(5-2i)!}$$

$$ {P}_{5}(x) = {(-1)}^{0}\frac{(2*5-2*0)!*{x}^{5-2*0}}{{2}^{5}*0!(5-0)!(5-2*0)!} + {(-1)}^{1}\frac{(2*5-2*1)!*{x}^{5-2*1}}{{2}^{5}*1!(5-1)!(5-2*1)!} + {(-1)}^{2}\frac{(2*5-2*2)!*{x}^{5-2*2}}{{2}^{5}*2!(5-2)!(5-2*2)!}$$

$$ {P}_{5}(x) = \frac{1}{8}*(63{x}^{5} - 70*{x}^{3} + 15x) $$

For n = 6,

$$ {P}_{6}(x) = \sum_{i=0}^{3}{(-1)}^{i}\frac{(2*6-2i)!*{x}^{6-2i}}{{2}^{6}*i!(6-i)!(6-2i)!}$$

$$ {P}_{6}(x) = {(-1)}^{0}\frac{(2*6-2*0)!*{x}^{6-2*0}}{{2}^{6}*0!(6-0)!(6-2*0)!} + {(-1)}^{1}\frac{(2*6-2*1)!*{x}^{6-2*1}}{{2}^{6}*1!(6-1)!(6-2*1)!} + {(-1)}^{2}\frac{(2*6-2*2)!*{x}^{6-2*2}}{{2}^{6}*2!(6-2)!(6-2*2)!}  + {(-1)}^{3}\frac{(2*6-2*3)!*{x}^{6-2*3}}{{2}^{6}*3!(6-3)!(6-2*3)!}$$

$$ {P}_{6}(x) = \frac{1}{16}*(231{x}^{6} - 315*{x}^{4} + 105x^2 - 5) $$

= Proof of Inverse Hyperbolic Tangent =

Given
$$tanh^{-1}(x)=\left[\frac{1}{2}log\left(\frac{1+x}{1-x}\right)\right]$$

Show
Derivation of the equation

Solution
$$tanh s = \frac{e^s-e^{-s}}{e^s+e^{-s}} $$

let $$s=log t$$

$$ tanh (log t) = \frac{e^{(log t)} -e^{-(log t) }}{e^{(log t)} +e^{-(log t) }}$$

$$ tanh (log t) = \frac{t-\frac{1}{t}}{t +\frac{1}{t}} =\frac{t^2-1}{t^2+1}$$

It follows that

$$ 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{\frac{1+x}{1-x}-1}{\frac{1+x}{1-x}+1}= \frac{2x}{2}=x$$

Taking the inverse:

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