User:G-man~enwikiversity

Problem 1
Problem Statement: Find the Euler Integrating Factor h(y) for a non-linear 1st order ODE for the particular case where we assume hxN=0

Two conditions must be satisfied in order for a nonlinear 1st order ODE to be exact.

The first condition is that $$F(x,y,y')=0$$ must be in the form $$M(x,y)+N(x,y)y'=0$$

The second condition is that $$M_y=N_x$$. This example will show how to satisfy the second condition.

Start with equation $$M(x,y)+N(x,y)y'=0$$ which already satisfies the first condition.

If we assume the equation is not exact we can multiply it by an unkown factor $$h(x,y)$$ (Euler Integrating Factor) to attempt to find a factor that will make the equation exact.

The equation becomes:

$$h(x,y)[M(x,y)dx+N(x,y)dy]=0$$

$$(hM)dx+(hN)dy=0, where\ hM=\overline M, and\ hN=\overline N$$

$$\overline M_y=(hM)_y=h_yM+hM_y$$

$$\overline N_x=(hN)_y=h_xN+hN_x$$

Set $$\overline M_y=\overline N_x$$ and rearrange,

$$h_xN-h_yM+h(N_x-M_y)=0$$

To solve for $$h_y$$ we will let $$h_xN=0$$ which implies that $$h_x=0$$ since $$\scriptstyle M\ne 0$$

$$-h_yM+h(N_x-M_y)=0$$, rearrage terms

$${h_y\over h}dy={1\over M}(N_x-M_y)$$ take the integral of both sides,

$$\int {h_y\over h}dy=\int {1\over M}(N_x-M_y)dy$$

If the right hand side of the integral is only a function of y then it can be written as $$g(y)$$

$${1\over M}(N_x-M_y)=g(y)$$

$$ln\mid h\mid=\int g(y)dy$$



$$h(y)=exp\int_{}^{y}g(s)ds$$

Problem 2
Problem Statement: Given the Non-homogeneous linear 1st order ODE with VC $$y'+{1\over x}y=x^2$$ show the steps to obtain $$y={x^3\over 4}+{C\over x}$$ where C=Const.

The first step is to check if the given equation is in the proper form:

$$P_{(x)}y'+Q_{(x)}y=R_{(x)}$$ ; Yes [pg.(8-1) Eg.(1)]

If $$P_{(x)}\ne 0$$ for all (x) then:

$$y'+{Q_{(x)}\over P_{(x)}}y={R_{(x)}\over P{(x)}}$$

In this form we can use the Integration Factor Method to solve for y

$$N_{(x,y)}{dy\over dx}+M_{(x,y)}=0$$

Multiply by $$h_{(x,y)}$$

$$h_{(x,y)}[N_{(x,y)}dy+M_{(x,y)}dx]$$

$$(hM)dx+(hN)dy=0$$ where $$(hM)=\overline M;\ (hN)=\overline N$$

Satisfy the exactness condition $$\overline M_y=\overline N_x$$ where:

$$\overline M_y=(hM)_y=h_yM+hM_y$$

$$\overline N_x=(hN)_x=h_xN+hN_x$$

$$h_xN-h_yM+h(Nx-My)=0$$

To solve for h(x,y) we must make an assumption that h is a function of (x) only.

Assume hyM=0, so our equation becomes;

$$h_xN+h(N_x-M_y)=0$$

$${h_x\over h}=-{1\over N_{(x,y)}}(N_x-M_y)$$

Let $$N_{(x,y)}=1$$ and $$M_{(x,y)}={Q_{(x)}\over P_{(x)}}y={1\over x}y$$

$$N_x=0$$ and $$M_y={1\over x}$$

Substitute back into the right hand side of the equationto verify h is a function of (x) only,

$${1\over 1}(0-{1\over x})={1\over x}=f(x)$$

Using that result we can now solve for $$h$$

$$\int {h_x\over h}dx=\int {1\over x}dx$$

$$ln|h|=ln|x|$$

$$h_x=x$$

Now that we have $$h_x$$ we can multiply through our original equation to obtain,

$$(x)y'+(x){1\over x}y=(x)x^2\ =xy'+y=x^3$$

Integrating yields:

$$xy={x^4\over 4}+C$$ divide by x,

 $$y={x^3\over 4}+{C\over x}$$

Problem 1
Problem Statement : Given a L2_ODE_VC $$\sqrt{x}y''+2xy'+3y=0$$

Find (m,n) from the integrating factor (xm,yn) that makes the equation exact.

A first integral is $$\phi(x,y,p)=xp+\big(2x^{3/2}\big)y+k_1=k_2$$


 * $$\phi_p=x$$
 * $$\phi_x=p+3x^{1/2}$$
 * $$\phi_y=2x^{3/2}-1$$

$$\phi(x,y,p)=h(x,y)+\int_{}f(x,y,p)dp, f=\phi_p$$

$$\phi(x,y,p)=h(x,y)+\int_{}xdp={h(x,y)+xp}$$

$$g(x,y,p)=\phi_x+\phi_yp=h_x+\phi_x+(h_y+\phi_y)p$$

$$g(x,y,p)=p+3x^{1/2}+(2x^{3/2}-1)p=h_x+x+(h_y+0)p$$


 * $$h_y=2x^{3/2}$$
 * $$h_x=3x^{1/2}-x$$

$$y^n=h_y\Rightarrow lny^n=ln(2x^{3/2})$$  $$n=ln(2x^{3/2})$$ $$x^m=h_x\Rightarrow lnx^m=ln(3x^{1/2}-x)$$  $$m=ln(3x^{1/2}-x)$$

Problem 2
Problem Statement: Given a first integral$$\phi$$ of a L2_ODE_VC, solve for $$y(x)$$.

$$\phi(x,y,p)=xp+(2x^{3\over 2}-1)y+k_1=k_2$$ (1)

where k1 and k2 are const, and $$p=y'$$

Eq. (1) is in the form $$M(x,y)+N(x,y)y'$$ where

$$M(x,y)=(2x^{3\over 2}-1)y$$

$$N(x,y)=x$$

so it satisfies the 1st condition of exactness.

Check if $$M_y=N_x$$ for the 2ndcondition of exactness

$$M_y=2x^{3\over2}-1$$

$$N_x=1$$

$$M_y\ne N_x$$ so we do not satisfy the 2nd condition of exactness.

We must apply the integrating factor method for a L1_ODE_VC.

$$xp+(2x^{3\over 2}-1)y=k_2-k_1$$, divide by x to obtain the form:

$$y'+a_0(x)y=b(x)$$ where:

$$a_o(x)={1\over x}(2x^{3\over 2}-1)=2\sqrt{x}-{1\over x}$$

$$b(x)={k_2-k_1\over x}$$

From our solution of a general non-homogeneous L1_ODE_VC p.8-1

$$h(x)=exp\int_{}^{x}a_0(s)ds$$

$$h(x)=exp\int_{}^{x}2\sqrt{x}-{1\over x}=exp\bigg({4\over 3}x^{3\over 2}-ln\left|x\right|\bigg)\bigg({{k_2-k_1}\over x}\bigg)=exp{4\over 3}x^{3\over 2}-x$$

From p.8-2 Eq. (4)

$$y(x)={1\over h(x)}\int_{}^{x}h(s)b(s)ds$$

Use the product rule of integration $$\int_{} ab=a\int_{} b-\int_{}a'\int_{}b$$

$$y(x)={1\over h(x)}\bigg[h(x)\int_{}^{x}b(x)-\int_{}^{x}h'(x)\int_{}^{x}b(x)\bigg]$$

In our example $$\int_{}^{x}h'(x)=h(x)$$ so,

$$y(x)={1\over h(x)}\bigg[h(x)\int_{}^{x}b(x)-h(x)\int_{}^{x}b(x)\bigg]$$



$$y(x)=0$$

Problem 3
Problem Statement: From ([[media:Egm6321.f09.p13-1.png|p.13-1]]), find the mathematical structure of $$\Phi$$ that yields the above class of ODE. A class of exact L2_ODE_VC.

$$F(x,y,y',y'')={d\phi\over dx}=\phi_x(x,y,p)+\phi_y(x,y,p)p+\phi_p(x,y,p)p'\ where\ p=y'$$

$$\phi=h(x,y)+\int_{}\phi_pdp=h(x,y)+\phi_pp$$

$$\phi_x=h_x+\phi_{px}p$$

$$\phi_y=h_y+\phi_{py}p$$

$$g=\phi_x+\phi_yp=h_x+\phi_{px}p+(h_y+\phi_{py}p)p$$

$$h_y=\phi_y-\phi_{px}$$

Take the integral of $$h_y$$

$$h(x,y)=(\phi_y-\phi_{px})y+k_1$$

Substitute back into the equation for $$\phi$$

$$\phi=(\phi_y-\phi_{px})y+k_1+\phi_pp$$

Rearrange the terms to obtain

$$\phi(x,y,p)=\phi_pp+(\phi_y-\phi_{px})y+k$$ where,


 * $$P(x)=\phi_p$$
 * $$T(x)=(\phi_y-\phi_{px})y$$
 * $$k=k_1$$



$$\phi(x,y,p)=P(x)p+T(x)y+k$$

Problem 4
Problem Statement: Given a N1_ODE, for the case n=1 $$F(x,y,y')=0\Leftrightarrow {d\phi\over dx}(x,y)$$

Show that $$f_0-{df_1\over df_x}=0\Leftrightarrow\phi_{xy}=\phi_{yx},$$ Hint:$$f_1=\phi_y$$

$$F={d\phi\over dx}(x,y^{(0)},....y^{(n-1)}=\phi_x+\phi_y6{(0)}y^{(1)}$$

$$F=\phi_x+\phi_yy'$$

$$f_i:={\partial F\over \partial y^i}$$

4.1
Find $$f_0$$ in terms of $$\phi$$.

$$f_0={\partial F\over \partial y}={\partial (\phi_x+\phi_yy')\over \partial y}=\phi_{xy}$$  $$f_0=\phi_{xy}$$

4.2
Find $$f_1$$ in terms of $$\phi_y$$

$$f_1={\partial F\over \partial y'}={\partial (\phi_x+\phi_yy')\over \partial y'}=\phi_y$$  $$f_1=\phi_y$$

4.3
Show that $$f_0-{df_1\over df_x}=0\Leftrightarrow\phi_{xy}=\phi_{yx},$$

$$\phi_{xy}-{d\phi_y\over df_x}=\phi_{xy}-\phi_{yx}=0$$  $$\phi_{xy}=\phi_{yx}$$

Problem 9
$$y_{xxx}=(d/dx)\bigg[{d/dx\over (d/dx)y}\bigg]=(dt/dx)(d/dt)(dt/dx)(d/dt)(dt/dx)(d/dt)y$$

Replace $$(dt/dx)\ with\ e^{-t}\ and\ (d/dt)y\ with\ y_t.$$

$$y_{xxx}=(e^{-t})(d/dt)(e^{-t})(d/dt)((e^{-t})y_t)$$ 'Chain Rule'

$$y_{xxx}=(e^{-t})(d/dt)(e^{-t})(-e^{-t}(y_t)+e^{-t}(t_{tt}))$$

$$y_{xxx}=(e^{-t})(d/dt)(-e^{-2t}(y_t)+e^{-2t}(y_{tt}))$$

$$y_{xxx}=(e^{-t})(2e^{-2t}(y_t)-e^{-2t}(y_{tt})-2e^{-2t}(y_{tt})+e^{-2t}(y_{ttt}))$$

$$y_{ttt}=2e-3t(y_t)-e^{-3t}(y_{tt})-2e^{-3t}(y_{tt})+e^{-3t}9y_{ttt})$$

Factor out $$e^{-3t}$$ and re-arrange terms in ordre of derivative, 

$$y_{xxx}=(e^{-3t})(y_{ttt}-3y_{tt}+2y_t)$$

$$y_{xxxx}=(d/dx)(d/dx)(d/dx)(d/dx)y$$

$$y_{xxxx}=(dt/dx)(d/dt)[(dt/dx)(d/dt)]((dt/dx)(d/dt))\langle(dt/dx)(d/dt)y\rangle$$

Replace $$(dt/dx)\ with\ e^{-t}\ and\ (d/dt)y\ with\ y_t.$$

$$y_{xxxx}=(e^{-t})(d/dt)(e^{-t})(d/dt)(e^{-t})(d/dt)((e^{-t})y_t)$$

$$y_{xxxx}=(e^{-t})(d/dt)(e^{-t})(d/dt)(e^{-t})(-e^{-t}(y_t)+e^{-t}(y_{tt}))$$

$$y_{xxxx}=(e^{-t})(d/dt)(e^{-t})(d/dt)(e^{-2t}(y_t)+e^{-2t}(y_{tt}))$$

$$y_{xxxx}=(e^{-t})(d/dt)(e^{-t})(-2e^{-2t}(y_t)+e^{-2t}(y_{tt})-2e^{-2t}(y_{tt})+e^{-2t}(y_{ttt}))$$

$$y_{xxxx}=(e^{-t})(d/dt)(-2e^{-3t}(y_t)+e^{-3t}(y_{tt})-2e^{-3t}(y_{tt})+e^{-3t}(y_{ttt}))$$

$$y_{xxxx}=(e^{-t})(6e^{-3t}(y_t)-2e^{-3t}(y_{tt})-3e^{-3t}(y_{tt})+e^{-3t}(y_{ttt})+6e^{-3t}(y_{tt})-2e^{-3t}(y_{ttt})-3e^{-3t}(y_{ttt})+e^{-3t}(y_{tttt}))$$

$$y_{xxxx}=6e^{-4t}(y_t)+2e^{-4t}(y_{tt})+3e^{-4t}(y_{tt})-e^{-4t}(y_{ttt})+6e^{-4t}(y_{tt})-2e^{-4t}(y_{ttt})-3e^{-4t}(y_{ttt})+e^{-4t}(y_{tttt}))$$

Factor out $$e^{-4t}$$ and re-arrange terms in order of derivative.



$$y_{xxxx}=(e^{-4t})(y_{tttt}-6y_{ttt}+11y_{tt}-6y_t)$$

Problem #1
Given the Legendra differential equation $$(1-x^2)y''-2xy'+n(n+1)y=0$$ with $$n=0$$ and given the homogeneous solution $$u_1(x)=1$$. use the reduction of order method 2 (undetermined factor) to find $$u_2(x)$$, the second homgeneous solution.

$$(1-x^2)y''-2xy'+n(n+1)y=0\ at\ n=0\ yields,$$

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

From the form $$y''+a_1y'+a_0y=0$$

$$a_1(x)=-{2x\over 1-x^2}$$

The homogeneous solution is represented by:

$$y_H(x)=k_1u_1(x)+k_2u_2(x)$$

The full homogeneous solution is assumed to be:

$$y(x)=U(x)u_1(x)\ where\ U\ is\ unknown.$$


 * $$y'=Uu'_1+U'u_1$$ multiply by $$a_1(x)$$


 * $$y=Uu_1+2U'u'_1+U''u_1$$ multiply by $$a_2(x)=1$$

Adding yields: $$a_1y'+y=U[a_1u'_1+u_1]+U'[a_1u_1+2u'_1]+U''u_1$$

Since $$u_1$$ is a homogeneous solution $$[a_1u'_1+u_1]=0$$ and $$a_1y'+y=0$$ we get:

$$U'[a_1u_1+2u'_1]+U''u_1=0$$

Let $$Z=U'$$

$$Z[a_1u_1+2u'_1]+Z'u_1=0$$, solve for Z by direct integration.

$${Z'\over Z}+(a_1+{2u'_1\over u_1})=0$$, solve for Z by direct integration.

$$Z(x)={e^k\over (u_1)^2}exp[-\int_{}^ta_1(s)ds]$$

$$U(x)=\int_{}^x{e^k\over (u_1(t))^2}exp[-\int_{}^ta_1(s)ds]dt+k_1$$


 * $$\int_{}^ta_1(s)ds=\int_{}^t-{2s\over (1-s^2)}ds=ln(1-t^2)$$

$$y_H(x)=k_1u_1(x)+k_2u_2(x)=U(x)u_1(x)=e^ku_1\int_{}^x{1\over (u_1(t))^2}exp[-ln(1-t^2)]dt+k_1u_1(x)$$

Solve for $$u_2(x)$$

$$u_2(x)=u_1\int_{}^x{1\over (u_1(t))^2}exp[-ln(1-t^2)]dt=x\int_{}^x{1\over (x)^2}exp[-ln(1-t^2)]dt=x\int_{}^x{dt\over (x)^2(1-t^2)}$$



$$u_2(x)={x\over 2}ln\bigg({1+x\over 1-x}\bigg)-1$$

Problem #2
Problem 1.1 part (b) from King, Differential Equations page 28.

Show that the function $$u_1=x^{-1}sinx$$ is a solution of the differential equation $$ xy''+2y'+xy=0$$. Use the reduction of order method to find the second independent solution $$u_2$$.

Arrange the differential equation into the form $$y''+a_1y'+a_0y=0$$

$$y''+{2\over x}y'+y=0$$

$$a_1(x)=2/x$$

$$\int_{}^ta_1(s)ds=\int_{}^t{2\over s}ds=2ln(t)$$

$$u_2(x)=u_1(x)\int_{}^x{1\over u^2_1(t)}exp\bigg[-\int_{}^ta_1(s)ds\bigg]dt$$ [King Eq.(1.3)p.6]

$$u_2(x)={sinx\over x}\int_{}^x{1\over {sin^2t\over t^2}}exp[-2ln(t)]dt={sinx\over x}\int_{}^x{t^2\over sin^2t}exp[-2ln(t)]dt$$

$$u_2(x)=\Bigg({sinx\over x}\Bigg)\Bigg({x^3\over 3}\Bigg)\Bigg({1\over {1\over 2}x-{1\over 4}sin2x}\Bigg)exp[-2ln(x)]$$

Problem 1
p.29-4 Complete equations (3) & (4) for i=2 and i=3 respectively.

Problem Statement: From the Laplace equation $$\mathcal {4}\psi={1\over h_1h_2h_3}\sum_{i=1}^3{\partial \over \partial \xi_i}\Big[{h_1h_2h_3\over (h_i)^2}{\partial \psi \over \partial \xi_i}\Big]$$ where $$h_1(\xi)=1$$ $$h_2(\xi)=rcos\theta=\xi_1cos\xi_2$$ $$h_3(\xi)=r=\xi_1$$ $$h_1h_2h_3=r^2cos\theta$$ $$\xi_1=r, \xi_2=\psi, \xi_3=\theta$$

Solve for when $$i=2, i=3$$

When $$i=2$$ $$\mathcal {4}\psi={1\over h_1h_2h_3}\sum_{i=1}^3{\partial \over \partial \xi_i}\Big[{h_1h_2h_3\over (h_i)^2}{\partial \psi \over \partial \xi_i}\Big]$$ becomes

$$\mathcal {4}\psi_{i=2}={1\over r^2cos\theta}{\partial \over \partial \phi}\Big[{r^2cos\theta\over (rcos\theta)^2}{\partial \psi \over \partial \phi}\Big]$$

$$\mathcal {4}\psi_{i=2}={1\over r^2cos\theta}{\partial \over \partial \phi}\Big[{r^2cos\theta\over (rcos\theta)^2}{\partial \psi \over \partial \phi}\Big]={1\over r^2cos\theta}{\partial \over \partial \phi}\Big[{r^2cos\theta\over r^2cos^2\theta}{\partial \psi \over \partial \phi}\Big]$$

$$\mathcal {4}\psi_{i=2}={1\over r^2cos\theta}{r^2cos\theta\over r^2cos^2\theta}{\partial \over \partial \phi}\Big[{\partial \psi \over \partial \phi}\Big]$$

 $$\mathcal {4}\psi_{i=2}={1\over r^2cos^2\theta}\Big[{\partial^2 \psi \over \partial \phi^2}\Big]$$

When $$i=3$$ $$\mathcal {4}\psi={1\over h_1h_2h_3}\sum_{i=1}^3{\partial \over \partial \xi_i}\Big[{h_1h_2h_3\over (h_i)^2}{\partial \psi \over \partial \xi_i}\Big]$$ becomes

$$\mathcal {4}\psi_{i=3}={1\over r^2cos\theta}{\partial \over \partial \theta}\Big[{r^2cos\theta\over (r)^2}{\partial \psi \over \partial \theta}\Big]$$

$$\mathcal {4}\psi_{i=3}={1\over r^2cos\theta}{\partial \over \partial \theta}\Big[{r^2cos\theta\over r^2}{\partial \psi \over \partial \phi}\Big]$$

 $$\mathcal {4}\psi_{i=3}={1\over r^2cos\theta}{\partial \over \partial \theta}\Big[cos\theta{\partial \phi\over \partial\theta}\Big]$$

Problem 2
p.30-2 Solve eq.(1) using the trial solution method where $$R(r)=r^\lambda$$

Problem Statement:

Solve $${d\over dr}\Bigg(r^2{dR\over dr}\Bigg)=kR$$ by trial solution: $$R(r)=r^\lambda$$

where,

$$R'={d\over dr}R=\lambda r^{\lambda-1}$$

$$R''=\lambda(\lambda-1)r^{\lambda-2}$$

$$r^2{dR\over dr}=r^2R'=r^2(\lambda r^{\lambda-1})=\lambda r^{\lambda-1+2}$$

$${d\over dr}\Bigg(r^2{dR\over dr}\Bigg)={d\over dr}\Big(\lambda r^{\lambda-1+2}\Big)=kR$$

$$\lambda (\lambda-1+2)r^{\lambda-2+2}=kr^\lambda$$

$$\lambda (\lambda+1)r^\lambda=kr^\lambda$$

Divide by $$r^\lambda$$



$$\lambda (\lambda+1)=k$$

=Homework #6=

Problem 9
p. 33-3 For $$f=\sum_i g_i$$ 1) show if {gi} is odd then f is odd 2) show if {gi} is even then f is even

A continuous function f can be expressed as $$f(x)=\sum_{n=0}^\infty A_nP_n(x)$$

We have observed that when n is EVEN $$P_n$$ is EVEN and when n is ODD $$P_n$$ is ODD

If we say $$g_i=A_nP_n$$

Then $$g_i$$ will be EVEN for all EVEN values of n.

And $$g_i$$ will be ODD for all ODD values of n.

Problem 10
p. 33-3 Show $$P_{2k}(x)$$ is even for k=0,1,2,... Show $$P_{2k+1}(x)$$ is odd for k=0,1,2,... Use equation (6) from p.31-3

For $$P_{2k}(x)$$ 'n' will always be an even number for all values of 'k' i.e. k=0,1,2,3,4,5......; n=0,2,4,6,8,10....

For $$P_{2k+1}(x)$$ 'n' will always be an odd number for all values of 'k' i.e. k=0,1,2,3,4,5......; n=1,3,5,7,9,11....

From the equation $$P_n(x)=\sum_{i=0}^{[n/2]}(-1)^i{(2n-2i)!x^{n-2i}\over 2^ni!(n-i)!(n-2i)!}$$ where [n/2] is only the integer part of the quotient i.e. [3/2]=1.5=1

$$\ x^{n-2i}$$ will always be an even number for all even values of 'n'.

$$\ x^{n-2i}$$ will always be an odd number for all odd values of 'n'.

Problem 11
p. 33-4 For $$q(x)=\sum_{i=0}^4c_ix^i$$ where $$c_0=3,\ c_1=10,\ c_2=15,\ c_3=-1,\ c_4=5$$

Find $$(a_i)$$ such that $$q=\sum_{i=0}^4a_iP_i$$

Plot $$q=\sum_ic_ix^i\ and\ q=\sum_ia_iP_i$$

$$q(x)=\sum_{i=0}^4c_ix^i$$ can be shown as a column matrix:

$$\begin{bmatrix} c_0x^0\\c_1x^1\\c_2x^2\\c_3x^3\\c_4x^4 \end{bmatrix}=\begin{bmatrix} 3x^0\\10x^1\\15x^2\\-1x^3\\5x^4 \end{bmatrix}$$

$$q(x)=\sum_{i=0}^4a_iP_i=\begin{bmatrix} a_0&a_1&a_2&a_3&a_4 \end{bmatrix}\begin{bmatrix} P_0\\P_1\\P_2\\P_3\\P_4 \end{bmatrix}$$

Setting $$q(x)=\sum_{i=0}^4c_ix^i=\sum_{i=0}^4a_iP_i(x)$$ yields

$$\begin{bmatrix} a_0&a_1&a_2&a_3&a_4 \end{bmatrix}\begin{bmatrix} P_0\\P_1\\P_2\\P_3\\P_4 \end{bmatrix}=\begin{bmatrix} 3x^0\\10x^1\\15x^2\\-1x^3\\5x^4 \end{bmatrix}$$

$$a_0P_0=3x^0 \Rightarrow a_0={3/P_0}$$

$$a_1P_1=10x^1 \Rightarrow a_1={10x/P_1}$$

$$a_2P_1=15x^2 \Rightarrow a_2={15x^2/P_2}$$

$$a_3P_3=-1x^3 \Rightarrow a_3={-x^3/P_3}$$

$$a_4P_4=5x^4 \Rightarrow a_4={5x^4/P_4}$$

From lecture p.31-3

$$P_0(x)=1$$

$$P_1(x)=x$$

$$P_2(x)=1/2(3x^2-1)$$

$$P_3(x)=1/2(5x^3-3x)$$

$$P_4(x)=25/8x^4-15/4x^2+3/8$$

 $$a_0=3$$

$$a_1={10x\over x}=10$$

$$a_2={15x^2\over 1/2(3x^2-1)}$$

$$a_3={-x^3\over 1/2(5x^3-3x)}$$

$$a_4={5x^4\over 25/8x^4-15/4x^2+3/8}$$

Fig. 1 Fig. 2

Problem 14
p35-3 Verify the table for the Gaus-Legendre quadrature in wikepedia, analytic expression of {xj} and {wj} for j=1,...,n and n=1,...,5. You must first verify the expression for Pn for n=5,6. Evaluate numerically {xj} and {wj} and compare results with Abramovitz & Stegun, Table 25.4 p.916. 

First we will verify $$P_n\ when\ n=5,6$$

$$P_n(x)=\sum_{i=0}^{[n/2]}(-1)^i{(2n-2i)!x^{n-2i}\over 2^ni!(n-i)!(n-2i)!}$$

When n=5

$$P_{5(i=0)}(x)=(-1)^0{10!x^5\over 2^5(0!)(5!)(5!)}={(1)3628800x^5\over 460800}={63\over 8}x^5$$

$$P_{5(i=1)}(x)=(-1)^1{8!x^3\over 2^5(1!)(4!)(3!)}={(-1)40320x^3\over 4608}={-70\over 8}x^3$$

$$P_{5(i=2)}(x)=(-1)^2{6!x\over 2^5(2!)(3!)(1!)}={(1)720x\over 384}={15\over 8}x$$

$$P_5(x)=P_{5(i=0)}+P_{5(i=1)}+P_{5(i=2)}={63\over 8}x^5-{70\over 8}x^3+{15\over 8}x$$ <div style="width: 25%; margin-left: 0; margin-right: 0; padding: 8px; border: 2px solid #0000FF; text-align: left;"> $$P_5(x)={1\over 8}(63x^5-70x^3+15x)$$ When n=6

$$P_{6(i=0)}(x)=(-1)^0{12!x^6\over 2^6(0!)(6!)(6!)}={(1)479001600x^6\over 33177600}={231\over 16}x^6$$

$$P_{6(i=1)}(x)=(-1)^1{10!x^3\over 2^6(1!)(5!)(4!)}={(-1)3628800x^4\over 184320}={-315\over 16}x^4$$

$$P_{6(i=2)}(x)=(-1)^2{8!x^2\over 2^6(2!)(4!)(2!)}={(1)40320x^2\over 6144}={105\over 16}x^2$$

$$P_{6(i=3)}(x)=(-1)^3{6!x^0\over 2^6(3!)(3!)(0!)}={(-1)720\over 2304}=-5$$

$$P_6(x)=P_{6(i=0)}+P_{6(i=1)}+P_{6(i=2)}+P_{6(i=3)}={231\over 16}x^6-{315\over 16}x^4+{105\over 16}x^2-5$$ <div style="width: 30%; margin-left: 0; margin-right: 0; padding: 8px; border: 2px solid #0000FF; text-align: left;"> $$P_6(x)={1\over 16}(231x^6-315x^4+105x^2-5)$$

$$P_1,\ P_2,\ P_3,\ P_4$$ have been shown earlier in problem #6 of HW#6

Solve for the roots of $$(x_i)\ for\ n=1,..,5$$

$$P_1(x)=x\Rightarrow roots\ x=0$$

$$P_2(x)=1/2(3x^2-1)\Rightarrow x^2=1/3\Rightarrow roots\ x=+/-\sqrt {1/3}$$

$$P_3(x)=1/2(5x^3-3x)\Rightarrow (5/2)x^3=(3/2)x\Rightarrow x^2=3/5\Rightarrow roots\ x=0,\ x=+/-\sqrt{3/5}$$

$$P_4(x)=1/8(35x^4-30x^2+3)\Rightarrow roots\ x=+/-\sqrt {(3-2\sqrt 6/5)\over 7},\ x=+/-\sqrt {(3+2\sqrt 6/5)\over 7}$$

$$P_5(x)=1/8(63x^5-70x^3-15x)\Rightarrow roots\ x=0, x=+/-1/3\sqrt {5-2\sqrt 10/7},\ x=0'\ x=+/-1/3\sqrt {5+2\sqrt 10/7}$$

Solve for {wj} for j=1,...n and n=1,...5

where $$w_j={-2\over (n+1)P'_n(x_j)P_{n+1}(x_j)}$$

n=1

$$P_1=x;\ P'_1=1;\ P_2=1/2(3x_j^2-1)$$ <div style="width: 20%; margin-left: 0; margin-right: 0; padding: 8px; border: 2px solid #0000FF; text-align: left;"> $$w_1={-2\over (2)(1)(-1/2)}=2$$

n=2

$$P_2=1/2(3x_j^2-1);\ P'_2=3x_j;\ P_3=1/2(5x_j^3-3x)$$ <div style="width: 75%; margin-left: 0; margin-right: 0; padding: 8px; border: 2px solid #0000FF; text-align: left;"> $$w_{2+}={-2\over (3)(3)\sqrt{1/3}(1/2)[5\sqrt{1/3}^3-3\sqrt{1/3}]}={-2\over 9(1/3)^{1/2}[5/2(1/3)^{3/2}-3/2(1/3)^{1/2}]}={-2\over -2}=1$$

$$w_{2-}={-2\over (3)(3)(-\sqrt{1/3})(1/2)[5(-\sqrt{1/3}^3)-3(-\sqrt{1/3})]}={-2\over -9(1/3)^{1/2}[5/2(-1/3)^{3/2}-3/2(-1/3)^{1/2}]}={-2\over -2}=1$$

n=3

$$P_3=1/2(5x_j^3-3x);\ P'_3=15/2x_j^2-3/2;\ P_4=1/8(35x^4-30x^2+3)$$ <div style="width: 75%; margin-left: 0; margin-right: 0; padding: 8px; border: 2px solid #0000FF; text-align: left;"> $$w_{3-0}={-2\over (4)[(15/2)(0)-3/2](1/8)[35(0)-30(0)+3]}={-2\over (4)(-3/2)(3/8)}={-2\over -9/4}=8/9$$

$$w_{3+}={-2\over (4)[(15/2)\sqrt{3/5}^2-3/2](1/8)[35\sqrt{3/5}^4-30\sqrt{3/5}^2+3]}={-2\over (4)(3)(-18/5)}={-2\over -3.6}=5/9$$

$$w_{3-}={-2\over (4)[(15/2)(-\sqrt{3/5}^2)-3/2](1/8)[35(-\sqrt{3/5}^4)-30(-\sqrt{3/5}^2)+3]}={-2\over (4)(3)(-18/5)}={-2\over -3.6}=5/9$$

n=4

$$P_4=1/8(35x^4-30x^2+3);\ P'_4=1/8(140x^3-60x);\ P_5=1/8(63x^5-70x^3+15x)$$ <div style="width: 100%; margin-left: 0; margin-right: 0; padding: 8px; border: 2px solid #0000FF; text-align: left;"> $$w_{4+-}={-2\over (5)\Bigg[1/8\Bigg(140\Bigg(\sqrt {(3-2\sqrt 6/5)\over 7}\Bigg)^3-60\sqrt {(3-2\sqrt 6/5)\over 7}\Bigg)\Bigg]\Bigg[1/8\Bigg(63\Bigg(\sqrt {(3-2\sqrt 6/5)\over 7}\Bigg)^5-70\Bigg(\sqrt {(3-2\sqrt 6/5)\over 7}\Bigg)^3+15\sqrt {(3-2\sqrt 6/5)\over 7}\Bigg)\Bigg]}={18+\sqrt 30\over 36}$$

$$w_{4--}={-2\over (5)\Bigg[1/8\Bigg(140\Bigg(-\sqrt {(3-2\sqrt 6/5)\over 7}\Bigg)^3-60-\sqrt {(3-2\sqrt 6/5)\over 7}\Bigg)\Bigg]\Bigg[1/8\Bigg(63\Bigg(-\sqrt {(3-2\sqrt 6/5)\over 7}\Bigg)^5-70\Bigg(-\sqrt {(3-2\sqrt 6/5)\over 7}\Bigg)^3+15\Bigg(-\sqrt {(3-2\sqrt 6/5)\over 7}\Bigg)\Bigg)\Bigg]}={18+\sqrt 30\over 36}$$

$$w_{4++}={-2\over (5)\Bigg[1/8\Bigg(140\Bigg(\sqrt {(3+2\sqrt 6/5)\over 7}\Bigg)^3-60\sqrt {(3+2\sqrt 6/5)\over 7}\Bigg)\Bigg]\Bigg[1/8\Bigg(63\Bigg(\sqrt {(3+2\sqrt 6/5)\over 7}\Bigg)^5-70\Bigg(\sqrt {(3+2\sqrt 6/5)\over 7}\Bigg)^3+15\sqrt {(3+2\sqrt 6/5)\over 7}\Bigg)\Bigg]}={18-\sqrt 30\over 36}$$

$$w_{4-+}={-2\over (5)\Bigg[1/8\Bigg(140\Bigg(-\sqrt {(3+2\sqrt 6/5)\over 7}\Bigg)^3-60-\sqrt {(3+2\sqrt 6/5)\over 7}\Bigg)\Bigg]\Bigg[1/8\Bigg(63\Bigg(-\sqrt {(3+2\sqrt 6/5)\over 7}\Bigg)^5-70\Bigg(-\sqrt {(3+2\sqrt 6/5)\over 7}\Bigg)^3+15\Bigg(-\sqrt {(3+2\sqrt 6/5)\over 7}\Bigg)\Bigg)\Bigg]}={18-\sqrt 30\over 36}$$

n=5

$$P_5=1/8(63x^5-70x^3+15x);\ P'_5=1/8(315x^4-210x^2+15);\ P_6=1/16(231x^6-315x^4+105x^2-5)$$

<div style="width: 140%; margin-left: 0; margin-right: 0; padding: 8px; border: 2px solid #0000FF; text-align: left;"> $$w_{5-0}={-2\over (6)\Big[1/8\Big(315(0)-210(0)+15\Big)\Big]\Big[1/16\Big(231(0)-315(0)-5\Big)\Big]}={-2\over (6)(15/8)(-5/16)}=128/225$$

$$w_{5+-}={-2\over (6)\Bigg[1/8\Bigg(315\Bigg(1/3\sqrt{5-2\sqrt{10/7}}\Bigg)^4-210\Bigg(1/3\sqrt{5-2\sqrt{10/7}}\Bigg)^2+15\Bigg)\Bigg]\Bigg[1/16\Bigg(231\Bigg(1/3\sqrt{5-2\sqrt{10/7}}\Bigg)^6-315\Bigg(1/3\sqrt{5-2\sqrt{10/7}}\Bigg)^4+105\Bigg(1/3\sqrt{5-2\sqrt{10/7}}\Bigg)^2-5\Bigg)\Bigg]}={332+13\sqrt70\over 900}$$

$$w_{5--}={-2\over (6)\Bigg[1/8\Bigg(315\Bigg(-1/3\sqrt{5-2\sqrt{10/7}}\Bigg)^4-210\Bigg(-1/3\sqrt{5-2\sqrt{10/7}}\Bigg)^2+15\Bigg)\Bigg]\Bigg[1/16\Bigg(231\Bigg(-1/3\sqrt{5-2\sqrt{10/7}}\Bigg)^6-315\Bigg(-1/3\sqrt{5-2\sqrt{10/7}}\Bigg)^4+105\Bigg(-1/3\sqrt{5-2\sqrt{10/7}}\Bigg)^2-5\Bigg)\Bigg]}={332+13\sqrt70\over 900}$$

$$w_{5++}={-2\over (6)\Bigg[1/8\Bigg(315\Bigg(1/3\sqrt{5+2\sqrt{10/7}}\Bigg)^4-210\Bigg(1/3\sqrt{5+2\sqrt{10/7}}\Bigg)^2+15\Bigg)\Bigg]\Bigg[1/16\Bigg(231\Bigg(1/3\sqrt{5+2\sqrt{10/7}}\Bigg)^6-315\Bigg(1/3\sqrt{5+2\sqrt{10/7}}\Bigg)^4+105\Bigg(1/3\sqrt{5+2\sqrt{10/7}}\Bigg)^2-5\Bigg)\Bigg]}={332-13\sqrt70\over 900}$$

$$w_{5-+}={-2\over (6)\Bigg[1/8\Bigg(315\Bigg(-1/3\sqrt{5+2\sqrt{10/7}}\Bigg)^4-210\Bigg(-1/3\sqrt{5+2\sqrt{10/7}}\Bigg)^2+15\Bigg)\Bigg]\Bigg[1/16\Bigg(231\Bigg(-1/3\sqrt{5+2\sqrt{10/7}}\Bigg)^6-315\Bigg(-1/3\sqrt{5+2\sqrt{10/7}}\Bigg)^4+105\Bigg(-1/3\sqrt{5+2\sqrt{10/7}}\Bigg)^2-5\Bigg)\Bigg]}={332-13\sqrt70\over 900}$$

Numerical values of {xj} and {wj}

$$\begin{bmatrix} {} & x_i & w_i \\ n=2 &

0.577350269189626 & 1.000000000000000 \\ n=3 & 0.000000000000000 & 0.888888888888889 \\ n=3 & 0.774596669241483 & 0.555555555555556 \\ n=4 & 0.339981043584856 & 0.652145154862546 \\ n=4 & 0.861136311594053 & 0.347854845137454\\ n=5 & 0.000000000000000 & 0.568888888888889 \\ n=5 & 0.538469310105683 & 0.478628670499366 \\ n=5 & 0.906179845938664 & 0.236926885056189 \end{bmatrix}$$

=Homework #7=

Problem 4
p. 38-2 Given $$(r_{PQ})^2=\sum_{i=1}^3(x_Q^i-x_P^i)^2$$ Where $$x_P^1=r_Pcos\theta_Pcos\phi_P$$, $$x_P^2=r_Pcos\theta_Psin\phi_P$$, $$x_P^3=r_Psin\theta_P$$

$$x_Q^1=r_Qcos\theta_Qcos\phi_Q$$, $$x_Q^2=r_Qcos\theta_Qsin\phi_Q$$, $$x_Q^3=r_Qsin\theta_Q$$

Show $$(r_{PQ})^2=r_p^2+r_Q^2-2r_Pr_Qcos\gamma$$

where $$ cos\gamma=cos\theta_Qcos\theta_Pcos(\phi_Q-\phi_P)+sin\theta_Qsin\theta_P$$

$$(r_{PQ})^2=\sum_{i=1}^3(x_Q^i-x_P^i)^2$$

$$(r_{PQ})^2= \left( x_{1{Q}}-x_{1{P}} \right) ^{2}+ \left( x_{2{Q}}-x_{2{P}}\right) ^{2}+ \left( x_{3{Q}}-x_{3{P}} \right) ^{2}$$

$$(r_{PQ})^2={x_{1{Q}}}^{2}-2\,x_{1{Q}}x_{1{P}}+{x_{1{P}}}^{2}+{x_{2{Q}}}^{2}-2\,x_{2{Q}}x_{2{P}}+{x_{2{P}}}^{2}+{x_{3{Q}}}^{2}-2\,x_{3{Q}}x_{3{P}}+{x_{3{P}}}^{2}$$


 * $$={r_}^{2} \left( \cos \left( \theta_ \right) \right) ^{2}

\left( \cos \left( \phi_ \right) \right) ^{2}-2\,r_\cos \left( \theta_ \right) \cos \left( \phi_ \right) r_ \cos \left( \theta_ \right) \cos \left( \phi_ \right)$$
 * $$ +{r_}^{2} \left( \cos \left( \theta_ \right) \right) ^{2} \left(\cos \left( \phi_ \right)  \right) ^{2}+{r_}^{2} \left( \cos \left( \theta_ \right)  \right) ^{2} \left( \sin \left( \phi_ \right)  \right) ^{2}-2\,r_\cos \left( \theta_ \right)

\sin \left( \phi_ \right) r_\cos \left( \theta_ \right) \sin \left( \phi_ \right)$$
 * $$ +{r_}^{2} \left( \cos \left( \theta_ \right) \right) ^{2} \left( \sin \left( \phi_ \right)  \right) ^{2}+{r_}^{2} \left( \sin \left( \theta_ \right)  \right) ^{2}-2\,r_\sin \left( \theta_ \right) r_\sin \left( \theta_ \right) +{r_}^{2} \left( \sin \left( \theta_ \right)  \right) ^{2}$$

Combine terms;


 * $$={r_}^{2}+ \left (\,\cos \left( \theta_ \right) \cos

\left( \theta_ \right) \cos \left( \phi_ \right) \cos \left( \phi_ \right)-2\, \cos \left( \theta_ \right) \cos \left( \theta_ \right) \sin \left( \phi_ \right) \sin \left( \phi_ \right) -2\,\sin \left( \theta_ \right) \sin \left( \theta_ \right) \right)r_r_+{r_}^{2} $$


 * $$={r_}^{2}+{r_}^{2}-2r_r_(\,\cos \left( \theta_ \right) \cos

\left( \theta_ \right) \cos \left( \phi_ \right) \cos \left( \phi_ \right)+\, \cos \left( \theta_ \right) \cos \left( \theta_ \right) \sin \left( \phi_ \right) \sin \left( \phi_ \right) +\,\sin \left( \theta_ \right) \sin \left( \theta_ \right)) $$


 * $$={r_}^{2}+{r_}^{2}-2r_r_[\,\cos \left( \theta_ \right) \cos

\left( \theta_ \right)[ \cos \left( \phi_ \right) \cos \left( \phi_ \right)+ \sin \left( \phi_ \right) \sin \left( \phi_ \right)] +\,\sin \left( \theta_ \right) \sin \left( \theta_ \right)]$$

Using the identity: $$\cos \left( a \right) \cos \left( b \right) +\sin \left( a \right) \sin \left( b \right)=\cos \left( a-b \right)$$

We can further reduce
 * $$={r_}^{2}+{r_}^{2}-2r_r_[\,\cos \left( \theta_ \right) \cos

\left( \theta_ \right)[ \cos \left( \phi_-\phi_ \right)] +\,\sin \left( \theta_ \right) \sin \left( \theta_ \right)] $$

Substitute $$ cos\gamma=cos(\theta_Q)cos(\theta_P)cos(\phi_Q-\phi_P)+sin(\theta_Q)sin(\theta_P)$$

Yields <div style="width: 28%; margin-left: 0; margin-right: 0; padding: 8px; border: 2px solid #0000FF; text-align: left;"> $$(r_{PQ})^2=r_p^2+r_Q^2-2r_Pr_Qcos\gamma$$