University of Florida/Egm4313/s12.team11.R5

Intermediate Engineering Analysis Section 7566 Team 11 Due date: March 30, 2012.

Problem Statement
Given: Find $$ R_{c} \!$$ for the following series: 1. $$ r(x) = \sum_{k=0}^\infty (k+1) k x^k \!$$ 2. $$ r(x) = \sum_{k=0}^\infty \frac{(-1)^k}{\gamma^k} x^{2k} \!$$ Find $$ R_{c} \!$$ for the Taylor series of 3. $$ sin(x) \!$$ at  $$ x = 0 \!$$

4. $$ log(1+x) \!$$ at  $$ x=0 \!$$

5. $$ log(1+x)\!$$ at  $$ x=1 \!$$

Solution
The radius of convergence $$ R_{c} \!$$ is defined as $$ R_{c} = [\lim_{k \to \infty} |\frac{d_{k+1}}{d_{k}}|]^{-1} \!$$ 1. $$ R_{c} = [\lim_{k \to \infty} |\frac{(k+2)(k+1)}{(k+1)(k)}|]^{-1} \!$$ $$ R_{c} = [\lim_{k \to \infty} |\frac{(k+2)}{(k)}|]^{-1} \!$$ $$ R_{c} = [\lim_{k \to \infty} |\frac{k(1+\frac{2}{k})}{k}|]^{-1} \!$$ $$ R_{c} = [\lim_{k \to \infty} |1+\frac{2}{k}|]^{-1} \!$$ $$ R_{c} = [1+0]^{-1} \!$$ $$ R_{c} = 1 \!$$ 2. $$ R_{c} = [\lim_{k \to \infty} |\frac{\frac{(-1)^{k+1}}{\gamma^{k+1}}}{\frac{(-1)^{k}}{\gamma^{k}}}|]^{-1} \!$$ $$ R_{c} = [\lim_{k \to \infty} |\frac{-1}{\gamma}|]^{-1} \!$$ $$ R_{c} = [\lim_{k \to \infty} \frac{1}{\gamma}]^{-1} \!$$ $$ R_{c} = [\frac{1}{\gamma}]^{-1} \!$$ $$ R_{c} = \gamma \!$$

However, in this problem, the series $$ x \!$$ term is $$ x^{2k} \!$$ not $$ x^k \!$$, as is the general form. Therefore, this implies: $$ |x^2| = \gamma \!$$ $$ |x| = \sqrt{\gamma} \!$$ $$ R_{c} = \sqrt{\gamma} \!$$ 3. The Taylor series for $$ sin(x) \!$$ is expressed as $$ sin(x) = \sum_{k=0}^\infty \frac{(-1)^{k}}{(2k+1)!}x^{2k+1} \!$$ $$\lim_{k \to \infty} \frac{\frac{(-1)^{k+1}}{(2(k+1)+1)!}x^{2(k+1)+1}}{\frac{(-1)^{k}}{(2k+1)!}x^{2k+1}} \!$$ $$\lim_{k \to \infty} \frac{\frac{1}{(2k+3)!}x^{2k+3}}{\frac{1}{(2k+1)!}x^{2k+1}} \!$$ $$\lim_{k \to \infty} \frac{\frac{1}{(2k+3)}x^{3}}{x} \!$$ $$\lim_{k \to \infty} \frac{1}{(2k+3)} x^{2} \!$$ Therefore: $$R_{c} = [\lim_{k \to \infty} \frac{1}{(2k+3)} ]^{-1}\!$$ $$R_{c} = \infty \!$$ 4. The Taylor series for $$ log(1+x) \!$$ at $$ x = 0 \!$$ is expressed as $$ log(1+x) = \sum_{k=1}^\infty \frac{(-1)^{k+1}}{k}x^{k} \!$$ $$R_{c} = [\lim_{k \to \infty} |\frac{\frac{(-1)^{k+2}}{k+1}}{\frac{(-1)^{k+1}}{k}} |]^{-1} \!$$ $$R_{c} = [\lim_{k \to \infty} |\frac{\frac{(-1)}{k+1}}{\frac{(1)}{k}} |]^{-1} \!$$ $$R_{c} = [\lim_{k \to \infty} |\frac{\frac{(-1)}{k(1+\frac{1}{k})}}{\frac{1}{k}} |]^{-1} \!$$ $$R_{c} = [\lim_{k \to \infty} |\frac{(-1)}{(1+\frac{1}{k})}|]^{-1} \!$$ $$R_{c} = [1/1]^{-1} \!$$ $$R_{c} = 1 \!$$

5. The Taylor series for $$ log(1+x) \!$$ at $$ x = 1 \!$$ is expressed as $$ log(1+x) = log(2) + \sum_{k=1}^\infty \frac{(-1)^{k+1}}{2^{k} k}(x-1)^{k} \!$$ $$\lim_{k \to \infty} \frac{\frac{(-1)^{k+2}}{2^{k+1} (k+1)}(x-1)^{k+1}}{\frac{(-1)^{k+1}}{2^{k} k}(x-1)^{k}} \!$$ $$\lim_{k \to \infty} \frac{\frac{(-1)^{2}}{2(k+1)}(x-1)}{\frac{1}{k}} \!$$ $$\lim_{k \to \infty} \frac{\frac{1}{2k(1+\frac{1}{k})}(x-1)}{\frac{1}{k}} \!$$ $$\lim_{k \to \infty} \frac{\frac{1}{2(1+\frac{1}{k})}(x-1)}{1} \!$$ $$\frac{1}{2}(x-1) \!$$ For convergence: $$ \frac{1}{2}(x-1) < 1 \!$$ $$ x-1 < 2 \!$$ $$ x < 3 \!$$ Therefore, $$R_{c} = 3 \!$$

R5.2
Solved by: Andrea Vargas

Problem Statement
Part 1:Determine whether the following are linearly independent using the Wronskian

Part 2: Determine whether the following are linearly independent using the Gramian

Part 1
Using the Wronskian we check for linear independence.

We know from (1) and (2) in 7-35 that if $$ W=\det\begin{bmatrix} f & g \\ f' & g' \end{bmatrix} =fg'-gf'\neq 0\!$$ Then the functions are linearly independent.

Part 1.1
$$ f(x)=x^2 \!$$ $$ g(x)=x^4 \!$$

Taking the derivatives of each function:

$$ f'(x)=2x \!$$ $$ g'(x)=4x^3\!$$

$$ W=\begin{bmatrix} x^2 & x^4 \\ 2x & 4x^3 \end{bmatrix} = 4x^5-2x^5=2x^5\neq 0\!$$

$$ \therefore \!$$ f(x) and g(x) are linearly independent

Part 1.2
$$ f(x)=\cos(x) \!$$ $$ g(x)=\sin(3x) \!$$

Taking the derivatives of each function:

$$ f'(x)=-\sin(x) \!$$ $$ g'(x)=3\cos(3x)\!$$

$$ W=\begin{bmatrix} \cos(x) & \sin(3x) \\ -\sin(x) & 3\cos(3x) \end{bmatrix} = 3\cos(x)\cos(3x)+\sin(3x)\sin(x)=\neq 0\!$$

$$ \therefore \!$$ f(x) and g(x) are linearly independent

Part 2
Using the Gramian we check for linear independence. We know from the notes in (1) 7-34 that: $$\langle f,g \rangle :=\int_{a}^{b}=f(x)g(x)\!$$

and that the Gramian is defined as: $$ \Gamma (f,g)=det\begin{bmatrix} \langle f,f \rangle & \langle f,g \rangle \\ \langle g,f \rangle & \langle g,g \rangle \end{bmatrix}\!$$

Then f,g are linearly independent if $$\Gamma(f,g)\neq 0 \!$$

Part 2.1
$$ f(x)=x^2 \!$$ $$ g(x)=x^4 \!$$

Taking scalar products: $$\langle f,f \rangle:=\int_{-1}^{1}=f(x)f(x)=x^2*x^2=\int_{-1}^{1}=x^4=\left [ \frac{x^5}{5} \right ]_{-1}^{1}=\frac{2}{5}\!$$ $$\langle f,g \rangle=\langle g,f \rangle:=\int_{-1}^{1}=f(x)g(x)=x^2*x^4=\int_{-1}^{1}=x^6=\left [ \frac{x^7}{7} \right ]_{-1}^{1}=\frac{2}{7}\!$$ $$\langle g,g \rangle:=\int_{-1}^{1}=g(x)g(x)=x^4*x^4=\int_{-1}^{1}=x^8=\left [ \frac{x^9}{9} \right ]_{-1}^{1}=\frac{2}{9}\!$$

$$ \Gamma (f,g)=\det \begin{bmatrix} \frac{2}{5} & \frac{2}{7} \\ & \\ \frac{2}{7} & \frac{2}{9} \end{bmatrix}=0.08888-0.0816326531\neq 0\!$$ $$ \therefore \!$$ f(x) and g(x) are linearly independent

Part 2.2
$$ f(x)=\cos(x) \!$$ $$ g(x)=\sin(3x) \!$$

Taking scalar products: $$\langle f,f \rangle:=\int_{-1}^{1}=f(x)f(x)=\int_{-1}^{1}=\cos^2(x)dx\!$$ We can use the trig identity for power reduction $$\cos^2(x)=\frac{1}{2}\cos(2x)+\frac{1}{2}\!$$ Then we have, $$\int_{-1}^{1}\frac{1}{2}\cos(2x)+\frac{1}{2}dx=\left [ \frac{1}{4}\sin(2x)+\frac{1}{2}x \right ]_{-1}^{1}\!$$ $$=0.7273243567-(-0.7273243567)=1.454648713\!$$

$$\langle f,g \rangle=\langle g,f \rangle:=\int_{-1}^{1}f(x)g(x)dx\!$$ $$=\int_{-1}^{1}\sin(3x)\cos(x)dx=\left [ \frac{1}{8}(-2\cos(2x)-\cos(4x)) \right ]_{-1}^{1}\!$$ $$=0.185742-0.185742=0\!$$

$$\langle g,g \rangle:=\int_{-1}^{1}g(x)g(x)dx=\int_{-1}^{1}\sin(3x)\sin(3x)dx\!$$ $$=\frac{1}{2}\int_{-1}^{1}1-\cos(6x)dx=\left [ \frac{1}{2}(x-\frac{1}{6}\sin(6x)) \right ]_{-1}^{1}\!$$ $$=0.523285+0.523285=1.04656925\!$$

$$ \Gamma (f,g)=\det \begin{bmatrix} 1.454648713 & 0 \\ 0 & 1.04656925 \end{bmatrix}=1.522390612\neq 0\!$$ $$ \therefore \!$$ f(x) and g(x) are linearly independent

Conclusion
By both methods (the Wronskian and the Gramian) we obtain the same results.

Problem Statement
Verify using the Gramian that the following two vectors are linearly independent.

$$\mathbf{b_1}=2\mathbf{e_1}+7\mathbf{e_2}\!$$ $$\mathbf{b_1}=1.5\mathbf{e_1}+3\mathbf{e_2}\!$$

Solution
$$ \Gamma (f,g)=det\begin{bmatrix} \langle \mathbf{b1},\mathbf{b1} \rangle & \langle \mathbf{b1},\mathbf{b2} \rangle \\ \langle \mathbf{b2},\mathbf{b1} \rangle & \langle \mathbf{b2},\mathbf{b2} \rangle \end{bmatrix}\!$$

We know from (3) 8-9 that: $$\langle \mathbf{b1},\mathbf{b2} \rangle= \mathbf{b1}\cdot \mathbf{b2} \!$$

We obtain, $$\langle \mathbf{b1},\mathbf{b1} \rangle= (2)(2)+(7)(7)=4+49=53\!$$ $$\langle \mathbf{b1},\mathbf{b2} \rangle= \langle \mathbf{b2},\mathbf{b1} \rangle=(1.5)(2)+(7)(3)=3+21=24\!$$ $$\langle \mathbf{b2},\mathbf{b2} \rangle= (1.5)(1.5)+(3)(3)=2.25+9=11.25\!$$

Then, $$ \Gamma (f,g)=det\begin{bmatrix} 53 & 24 \\ 24 & 11.25 \end{bmatrix}=596.25-576=20.25\neq0\!$$ $$ \therefore \!$$ b_1 and b_2 are linearly independent

Problem Statement
Show that $$ y_p(x)=\sum_{i=0}^{n}y_{p,i}(x)\!$$ is indeed the overall particular solution of the L2-ODE-VC $$ y''+p(x)y'+q(x)y=r(x) \!$$ with the excitation $$ r(x)=r_1(x)+r_2(x)+...+r_n(x)=\sum_{i=0}^{n}r_i(x)\!$$.

Discuss the choice of $$ y_p(x)\!$$ in the above table e.g., for $$ r(x)=k \cos\omega x\!$$ why would you need to have both $$ \cos \omega x \!$$ and $$\sin \omega x \!$$ in $$ y_p(x) \!$$ ?

Solution
Because the ODE is a linear equation in y and its derivatives with respect to x, the superposition principle can be applied:

$$r_1(x) \!$$ is a specific excitation with known form of $$ y_{p1}(x)\!$$ and $$r_2(x) \!$$ is a specific excitation with known form of $$ y_{p2}(x)\!$$

$$+\begin{cases} & \text{ } y_{p1}''+p(x)y_{p1}'+q(x)y_{p1}=r_1(x) \\ & \text{ } y_{p2}''+p(x)y_{p2}'+q(x)y_{p2}=r_2(x) \end{cases}\!$$

becomes

$$(y_{p1}+y_{p2})''+p(x)(y_{p1}+y_{p2})'+q(x)(y_{p1}+y_{p2})=r_1(x)+r_2(x)\!$$

proving that

$$ y_p(x)=\sum_{i=0}^{n}y_{p,i}(x)\!$$ is indeed the overall particular solution of the L2-ODE-VC $$ y''+p(x)y'+q(x)y=r(x) \!$$ with the excitation $$ r(x)=\sum_{i=0}^{n}r_i(x)\!$$

According to Fourier Theorem periodic functions can be represented as infinite series in terms of cosines and sines:

$$f(x)=a_0+\sum_{n=1}^{\infty}[a_n\cos\omega x+b_n\sin\omega x] \!$$

where the coefficients $$ a_0, a_n , b_n \!$$ are the Fourier coefficients calculated using Euler formulas.

So even though the system is being excited by functions like $$ r(x)=k\cos \omega x \!$$ the particular solution would still include both $$ \sin \omega x \!$$ and $$ \cos \omega x \!$$ in $$ y_p(x) \!$$ because the excitation is a periodic function that can be represented as the Fourier infinite series in terms of both $$ \sin \omega x \!$$ and $$ \cos \omega x \!$$ times the Fourier coefficients

Problem Statement
Show that $$cos(7x)$$ and $$sin(7x)$$ are linearly independant using the Wronskian and the Gramain (integrate over 1 period)

Solution
$$f=cos(7x),g=sin(7x)$$ One period of $$ 7x=\pi/7$$ Wronskian of f and g $$ W(f,g)=det\begin{bmatrix} f & g\\ f' & g' \end{bmatrix}$$

Plugging in values for $$f,f',g,g';$$ $$ W(f,g)=det\begin{bmatrix} cos(7x) & sin(7x)\\ -sin(7x) & cos(7x) \end{bmatrix}$$ $$=7cos^2(7x)+7sin^2(7x)$$ $$=7[cos^2(7x)+sin^2(7x)]$$ $$=7[1]$$  They are linearly Independant using the Wronskian. $$ = \int_{a}^{b}f(x)g(x)dx$$ $$\Gamma(f,g)=det\begin{bmatrix}  & \\  &  \end{bmatrix}$$ $$\int_{0}^{\pi/7}cos^2(7x)dx=\pi/14$$ $$\int_{0}^{\pi/7}sin^2(7x)dx=\pi/14$$ $$\int_{0}^{\pi/7}cos(7x)*sin(7x)dx=0$$ $$\Gamma(f,g)=det\begin{bmatrix} \pi/14 & 0\\ 0 & \pi/14 \end{bmatrix}$$ $$\Gamma(f,g)=\pi^2/49$$ They are linearly Independent using the Gramain.

Problem Statement
Find 2 equations for the 2 unknowns M,N and solve for M,N.

Solution
$$ y_p(x)=Mcos7x+Nsin7x$$ $$y'_p(x)=-M7sin7x+N7cos7x$$ $$y''_p(x)=-M7^2cos7x-N7^2sin7x$$ Plugging these values into the equation given ($$y''-3y'-10y=3cos7x$$) yields; $$-M7^2cos7x-N7^2sin7x-3(-M7sin7x+N7cos7x)-10(Mcos7x+Nsin7x)=3cos7x$$ Simplifying and the equating the coefficients relating sin and cos results in; $$-59M-21N=3$$ $$-59N+21M=0$$ Solving for M and N results in; $$M=-177/3922, N=-63/3922$$

Problem Statement
Find the overall solution $$ y(x)$$ that corresponds to the initial conditions $$y(0)=1, y'(0)=0$$. Plot over three periods.

Solution
From before, one period $$=\pi/7$$ so therefore, three periods is $$3\pi/7.$$ Using the roots given in the notes $$\lambda_1=-2,\lambda_2=5$$, the homogenous solution becomes; $$y_h(x)=c_1e^{-2x}+c_2e^{5x}$$ Using initial condtion $$y(0)=1$$; $$1=c_1+c_2$$ $$y'_h(x)=-2c_1e^{-2x}+5c_2e^{5x}$$ with $$y'(0)=0$$ $$0=-2c_1+5c_2$$ Solving for the constants; $$c_1=5/7,c_2=2/7$$ $$y_h(x)=5/7e^{-2x}+2/7e^{5x}$$ Using the $$ y_p(x)$$ found in the last part; $$y=y_h+y_p$$ $$y=5/7e^{-2x}+2/7e^{5x}-177/3922cos7x-63/3922sin7x$$



R5.6
solved by Luca Imponenti

Problem Statement
Complete the solution to the following problem


 * $$y''+4y'+13y=2e^{-2x}cos(3x)\!$$

where

$$y_h=e^{-2x}[Acos(3x)+Bsin(3x)]\!$$

and

$$y_p=xe^{-2x}[Mcos(3x)+Nsin(3x)]\!$$

Find the overall solution $$y(x)\!$$ corresponds to the initial condition:
 * $$y(0)=1 \, \ y'(0)=0\!$$

Plot the solution over 3 periods.

Particular Solution
Taking the derivatives of the particular solution $$y_p(x)\!$$

$$y_p=xe^{-2x}[Mcos(3x)+Nsin(3x)]\!$$

$$y'_p=e^{-2x}[sin(3x)(N-2Nx-3Mx)+cos(3x)(3Nx+M-2Mx)]\!$$

$$y''_p=e^{-2x}[sin(3x)(12Mx-6M-5Nx-4N)+cos(3x)(6N-5Mx-4M-12Nx)]\!$$

Plugging these into the ODE yields

$$sin(3x)(6M-12Mx+5Nx+4N)+cos(3x)(5Mx+4M+12Nx-6N)+\!$$ $$4[sin(3x)(N-2Nx-3Mx)+cos(3x)(3Nx+M-2Mx)]+$$ $$13x[Mcos(3x)+Nsin(3x)]=2cos(3x)\!$$

Equating like terms allows us to solve for M and N

$$sin(3x)[(12Mx-6M-5Nx-4N)+4(N-2Nx-3Mx)+13Nx]=0\!$$

$$cos(3x)[(6N-5Mx-4M-12Nx)+4(3Nx+M-2Mx)+13Mx]=2cos(3x)\!$$

$$-6M=0\!$$

$$6N=2\!$$

$$M=0 \, \ N=\frac{1}{3}\!$$

So the particular solution is

$$y_p=\frac{1}{3}xe^{-2x}sin(3x)\!$$

Overall Solution
The overall solution in the sum of the homogeneous and particular solutions

$$y(x)=y_h(x)+y_p(x)\!$$

$$y(x)=e^{-2x}[Acos(3x)+Bsin(3x)]+\frac{1}{3}xe^{-2x}sin(3x)\!$$

To find A and B we apply the initial conditions

$$y(0)=1 \, \ y'(0)=0\!$$

$$y(0)=1=A\!$$

Taking the derivative

$$y'(x)=\frac{d}{dx}[e^{-2x}[cos(3x)+Bsin(3x)]+\frac{1}{3}xe^{-2x}sin(3x)]\!$$

$$y'(x)=e^{-2x}[(3B+x-2)cos(3x)-(2B+\frac{2}{3}x+\frac{8}{3})sin(3x)]\!$$

$$y'(0)=0=3B-2\!$$

$$B=\frac{2}{3}\!$$

Giving us the overall solution

$$y(x)=e^{-2x}[cos(3x)+\frac{2}{3}sin(3x)+\frac{1}{3}xsin(3x)]\!$$

Plot
The period for $$cos(3x) \, \ sin(3x)\!$$ is $$\frac{2\pi}{3}$$

Plotting the solution $$y(x)\!$$ over 3 periods yields



R5.7
Solved by Daniel Suh

Problem Statement
$$v=4e_{1}+2e_{2}=c_{1}b_{1}+c{2}b_{2}\!$$

$$b_{1}=2e_{1}+7e_{2}\!$$

$$b_{2}=1.5e_{1}+3e_{2}\!$$ 1. Find the components $$c_{1},c_{2}\!$$ using the Gram matrix. 2. Verify the result by using $$b_{1}\!$$ and $$b_{2}\!$$, and rely on the non-zero determinant matrix of $$b_{1}\!$$ and $$b_{2}\!$$ relative to the bases of $$e_{1}\!$$ and $$e_{2}\!$$.

Gram Matrix
$$ T(b_{1},b_{2})=\begin{bmatrix}  &  \\  &  \end{bmatrix}$$ $$ = \!$$ Thus,

$$ =  = <(2)(2) + (7)(7)> = 53\!$$

$$ =  = <(1.5)(1.5) + (3)(3)> = 11.25\!$$

$$ = <b_{2}, b_{1}> = <b_{1}\cdot b_{2}> = <(2)(1.5) + (7)(3)> = 24\!$$

$$ T(b_{1},b_{2})=\begin{bmatrix} 53 & 24 \\ 24 & 11.25 \end{bmatrix}$$

$$\Gamma = det[T] = (53)(11.25)-(24)(24) = 20.25\!$$

Defining c
Define: $$c =\begin{bmatrix} c_{1} \\ c_{2} \end{bmatrix}$$ $$d = \begin{bmatrix} <b_{1}, v> \\ <b_{2}, v> \end{bmatrix}= \begin{bmatrix} d_{1} \\ d_{2} \end{bmatrix}\!$$

If $$\Gamma \neq 0 \!$$, then $$\Gamma^{-1}\!$$ exists

$$c = \Gamma^{-1}d\!$$

Finding c
$$\Gamma = 20.25 \neq 0 \!$$ thus, $$\Gamma ^{-1}\!$$exists

$$d =\begin{bmatrix} d_{1} \\ d_{2} \end{bmatrix} = \begin{bmatrix} (2)(4)+(7)(2) \\ (1.5)(4)+(3)(2) \end{bmatrix} = \begin{bmatrix} 22 \\ 12 \end{bmatrix}\!$$

$$\begin{bmatrix} c_{1} \\ c_{2} \end{bmatrix} = \begin{bmatrix} 53 & 24 \\ 24 & 11.25 \end{bmatrix}^{-1}\begin{bmatrix} 22 \\ 12 \end{bmatrix}\!$$

$$\begin{bmatrix} c_{1} \\ c_{2} \end{bmatrix} = \begin{bmatrix} -2 \\ 5.33 \end{bmatrix}\!$$

Part 2 Solution
$$v = 4e_{1} + 2e_{2} \equiv c_{1}b_{1} + c_{2}b_{2}\!$$

$$c_{1}b_{1} + c_{2}b_{2} = (-2)(2e_{1}+7e_{2}) + (5.33)(1.5e_{1} + 3e_{2})\!$$

$$c_{1}b_{1} + c_{2}b_{2} = -4e_{1} - 14e_{2} + 8e_{1} + 16e_{2}\!$$

$$c_{1}b_{1} + c_{2}b_{2} = 4e_{1} + 2e_{2}\!$$

$$v = 4e_{1} + 2e_{2} \equiv c_{1}b_{1} + c_{2}b_{2}\!$$

$$\therefore \!$$ solution is correct

Problem Statement
Find the integral $$ \int x^n log(1+x)dx \!$$ for $$ n=0 \!$$ and $$ n=1 \!$$ Using integration by parts, and then with the help of of General Binomial Theorem $$ (x+y)^n = \sum^n_{k=0} \binom{n}{k} x^{n-k} y^k \!$$

Solution
For $$ n=0 \!$$: $$ \int x^0 log(1+x)dx = \int log(1+x)dx \!$$ For substitution by parts, $$ u = log(1+x), du=\frac{1}{1+x}, dv=dx, v=x \!$$ $$\int log(1+x)dx = x log(1+x) - \int \frac{x}{1+x}dx \!$$ $$ \int log(1+x)dx = x log(1+x) - \int (1 - \frac{1}{1+x})dx \!$$ $$ \int log(1+x)dx = x log(1+x) - x + log(1+x) + C\!$$ Therefore: $$ \int log(1+x)dx = (x+1) log(1+x) - x + C \!$$ Using the General Binomial Theorem: $$ (x+y)^0 = \sum^0_{k=0} \binom{0}{k} x^{0-k} y^k = 1 \!$$ Therefore: $$ \int (1) log(1+x)dx = \int log(1+x)dx \!$$ Which we have previously found that answer as: $$ \int log(1+x)dx = (x+1) log(1+x) - x + C \!$$ For $$ n=1 \!$$: $$ \int x^1 log(1+x)dx = \int x log(1+x)dx \!$$ Initially we use the following substitutions: $$ t = 1+x, x = t-1, dt = dx \!$$ $$\int x log(1+x)dx = \int (t-1) log(t)dt = \int (t log(t) - \log(t))dt \!$$ First let us consider the first term: $$ \int t log(t) dt \!$$ Next, we use the integration by parts: $$ u = \log {t}, du = \frac{1}{t} dt, dv = t dt, v = \frac{1}{2}t^2 \!$$ $$ \int t log(t) dt = \frac{1}{2}t^2 log(t) - \int \frac{1}{2} t^2 (\frac{1}{t} dt) \!$$ $$ \int t log(t) dt = \frac{1}{2}t^2 log(t) - \int \frac{1}{2} t dt) \!$$ $$ \int t log(t) dt = \frac{1}{2}t^2 log(t) - \frac{1}{4} t^2 \!$$  Next let us consider the second term: $$ \int log(t) dt \!$$ Again, we will use integration by parts: $$ u = \log {t}, du = \frac{1}{t} dt, dv = dt, v = t \!$$ $$ \int t log(t) dt = t log(t) - \int t (\frac{1}{t} dt) \!$$  $$ \int t log(t) dt = t log(t) - \int dt \!$$  $$ \int t log(t) dt = t log(t) - t \!$$  Therefore: $$ \int (t log(t) - \log(t))dt = \frac{1}{2}t^2 log(t) - \frac{1}{4} t^2 - (t log(t) - t) \!$$  $$ \int (t log(t) - \log(t))dt = \frac{1}{2}t^2 log(t) - \frac{1}{4} t^2 - t log(t) + t \!$$  Re-substituting for t: $$ \int x log(1+x)dx = \frac{1}{2}(1+x)^2 log(1+x) - \frac{1}{4} (1+x)^2 - (1+x) log(1+x) + (1+x) + C\!$$  $$ \int x log(1+x)dx = (1+x)( \frac{1}{2}(1+x) log(1+x) - \frac{1}{4} (1+x)- log(1+x) + 1 ) + C\!$$  $$ \int x log(1+x)dx = (1+x)( \frac{1}{2} x log(1+x) - \frac{1}{2} log(1+x) - \frac{1}{4} x + \frac{3}{4}) + C\!$$ Therefore: $$ \int x log(1+x)dx = (1+x)(\frac{1}{2} x log(1+x) - \frac{1}{2} log(1+x) - \frac{1}{4} x + \frac{3}{4} ) + C\!$$ Using the General Binomial Theorem for the integral with t substitution $$ \int (t-1) log(t)dt \!$$: $$ (x+y)^1 = (t+(-1))^1 = (t+(-1)) = \sum^1_{k=0} \binom{1}{k} x^{1-k} y^k = \sum^1_{k=0} \binom{1}{k} t^{1-k} (-1)^k = t-1 \!$$ Therefore: $$ \int (t-1) log(t)dt = \int x log(1+x)dx \!$$ Which we have previously found that answer as: $$ \int x log(1+x)dx = (1+x)(\frac{1}{2} x log(1+x) - \frac{1}{2} log(1+x) - \frac{1}{4} x + \frac{3}{4} ) + C\!$$

R5.9
Solved by: Gonzalo Perez

Problem Statement
Consider the L2-ODE-CC (5) p.7b-7 with $$ log(1+x) \! $$ as excitation:

$$ y''-3y'+2y=r(x) \! $$  (5) p.7b-7

$$ r(x)=log(1+x) \! $$    (1) p.7c-28

and the initial conditions

$$ y(\frac{-3}{4})=1, y'(\frac{-3}{4})=0 \! $$.

Part A
Project the excitation $$ r(x) \! $$ on the polynomial basis

$$ {b_j (x) = x^j, j=0, 1, ..., n} \! $$   (1)

i.e., find $$ d_j \! $$ such that

$$ r(x) \approx r_n (x) = \sum_{j=0}^{n} d_j x^j \! $$   (2)

for x in $$ [\frac{-3}{4}, 3] \! $$, and for n = 3, 6, 9.

Plot $$ r(x) \! $$ and $$ r_n (x) \! $$ to show uniform approximation and convergence.

Note that:

$$ \left \langle x^i,r \right \rangle = \int_{a}^{b} x^i log(1+x) dx \! $$    (3)

Solution
To solve this problem, it is important to know that the scalar product is defined as the following:

$$ \left \langle b_0, b_0 \right \rangle = \int x^0\cdot x^0 dx \! $$.

Therefore, it follows that:

$$ \left \langle b_i,b_j \right \rangle = \int x^i\cdot x^j dx \! $$, where $$ b_i (x)=x^i \! $$ and $$ b_j (x) = x^j \! $$.

We know that if $$ b_1, b_2 \! $$ are linearly independent, then by theorem on p.7c-37, the matrix is solvable.

According to this and (3)p.8-14:

If $$ \Gamma \neq 0 \Rightarrow \Gamma^{-1} \! $$ exists $$ \Rightarrow c= \Gamma^{-1}d \! $$.      (3)p.8-14

Now let's define the Gram matrix $$ \Gamma \! $$ as a function of $$ b_i \! $$:

$$ \Gamma (b_i)=\begin{bmatrix} \left \langle b_0,b_0 \right \rangle & \left \langle b_0,b_1 \right \rangle & ... & \left \langle b_0,b_n \right \rangle\\ ... & ... & ... & ...\\ ... & ... & ... & ...\\ \left \langle b_n,b_0 \right \rangle & \left \langle b_n,b_1 \right \rangle & ... & \left \langle b_n,b_n \right \rangle \end{bmatrix} \! $$      (1)p.8-13

Defining the "d" matrix as was done in (3)p.8-13, we get:

$$ d = \begin{Bmatrix} \left \langle b_0,r \right \rangle\\ \left \langle b_1,r \right \rangle\\ ...\\

\left \langle b_n,r \right \rangle\end{Bmatrix} \! $$.       (3)p.8-13

And according to (1)p.8-15: $$ r_n(x) = \sum_{0}^{n}c_i x^i \! $$         (1)p.8-15

Now, we can find the values to compare $$ r_n \! $$ to $$ y \! $$.

Using Matlab, this is the code that was used to produce the results:

The Matlab code above produced the following graph:

Where $$ r_n(x) \! $$ is represented by the dashed line and the approximation,$$ y(x) \! $$, is represented by the red line. This code can work for all n values.

Part B
In a seperate series of plots, compare the approximation of the function $$ \log(x+1) \!$$ by Taylor series expansion about $$ x=0 \!$$.

Where: $$ f(x)= \sum_{n=0}^\infty \frac{f^{(n)}(\hat x)}{n!}(x- \hat x)^n \!$$

Solution
For n=1:

$$ \log(x+1) = \frac{x}{\log(10)} \! $$

For n=2:

$$ \log(x+1) = \frac{x}{\log(10)}-\frac{x^2}{\log(10^2)} \! $$

For n=3:

$$ \log(x+1) = \frac{x}{\log(10)}-\frac{x^2}{\log(10^2)}+\frac{x^3}{\log(10^3)} \! $$

For n=4:

$$ \log(x+1) = \frac{x}{\log(10)}-\frac{x^2}{\log(10^2)}+\frac{x^3}{\log(10^3)}-\frac{x^4}{\log(10^4)} \!$$

For n=5:

$$ \log(x+1) = \frac{x}{\log(10)}-\frac{x^2}{\log(10^2)}+\frac{x^3}{\log(10^3)}-\frac{x^4}{\log(10^4)}+\frac{x^5}{\log(10^5)} \! $$

For n=6:

$$ \log(x+1) = \frac{x}{\log(10)}-\frac{x^2}{\log(10^2)}+\frac{x^3}{\log(10^3)}-\frac{x^4}{\log(10^4)}+\frac{x^5}{\log(10^5)}-\frac{x^6}{\log(10^6)} \! $$

For n=7:

$$ \log(x+1) = \frac{x}{\log(10)}-\frac{x^2}{\log(10^2)}+\frac{x^3}{\log(10^3)}-\frac{x^4}{\log(10^4)}+\frac{x^5}{\log(10^5)}-\frac{x^6}{\log(10^6)}+\frac{x^7}{\log(10^7)} \!$$

For n=8:

$$ \log(x+1) = \frac{x}{\log(10)}-\frac{x^2}{\log(10^2)}+\frac{x^3}{\log(10^3)}-\frac{x^4}{\log(10^4)}+\frac{x^5}{\log(10^5)}-\frac{x^6}{\log(10^6)}+\frac{x^7}{\log(10^7)}-\frac{x^8}{\log(10^8)} \! $$

For n=9:

$$ \log(x+1) = \frac{x}{\log(10)}-\frac{x^2}{\log(10^2)}+\frac{x^3}{\log(10^3)}-\frac{x^4}{\log(10^4)}+\frac{x^5}{\log(10^5)}-\frac{x^6}{\log(10^6)}+\frac{x^7}{\log(10^7)}-\frac{x^8}{\log(10^8)}+\frac{x^9}{\log(10^9)} \! $$

For n=10:

$$ \log(x+1) = \frac{x}{\log(10)}-\frac{x^2}{\log(10^2)}+\frac{x^3}{\log(10^3)}-\frac{x^4}{\log(10^4)}+\frac{x^5}{\log(10^5)}-\frac{x^6}{\log(10^6)}+\frac{x^7}{\log(10^7)}-\frac{x^8}{\log(10^8)}+\frac{x^9}{\log(10^9)}-\frac{x^{10}}{\log(10^{10})} \! $$

For n=11:

$$ \log(x+1) = \frac{x}{\log(10)}-\frac{x^2}{\log(10^2)}+\frac{x^3}{\log(10^3)}-\frac{x^4}{\log(10^4)}+\frac{x^5}{\log(10^5)}-\frac{x^6}{\log(10^6)}+\frac{x^7}{\log(10^7)}-\frac{x^8}{\log(10^8)}+\frac{x^9}{\log(10^9)}-\frac{x^{10}}{\log(10^{10})}+\frac{x^{11}}{\log(10^{11})} \!$$

For n=12:

$$ \log(x+1) = \frac{x}{\log(10)}-\frac{x^2}{\log(10^2)}+\frac{x^3}{\log(10^3)}-\frac{x^4}{\log(10^4)}+\frac{x^5}{\log(10^5)}-\frac{x^6}{\log(10^6)}+\frac{x^7}{\log(10^7)}-\frac{x^8}{\log(10^8)}+\frac{x^9}{\log(10^9)}-\frac{x^{10}}{\log(10^{10})}+\frac{x^{11}}{\log(10^{11})}\!$$ $$ -\frac{x^{12}}{\log(10^{12})} \! $$

For n=13:

$$ \log(x+1) = \frac{x}{\log(10)}-\frac{x^2}{\log(10^2)}+\frac{x^3}{\log(10^3)}-\frac{x^4}{\log(10^4)}+\frac{x^5}{\log(10^5)}-\frac{x^6}{\log(10^6)}+\frac{x^7}{\log(10^7)}-\frac{x^8}{\log(10^8)}+\frac{x^9}{\log(10^9)}-\frac{x^{10}}{\log(10^{10})}+\frac{x^{11}}{\log(10^{11})}\!$$ $$ -\frac{x^{12}}{\log(10^{12})}+\frac{x^{13}}{\log(10^{13})} \! $$

For n=14:

$$ \log(x+1) = \frac{x}{\log(10)}-\frac{x^2}{\log(10^2)}+\frac{x^3}{\log(10^3)}-\frac{x^4}{\log(10^4)}+\frac{x^5}{\log(10^5)}-\frac{x^6}{\log(10^6)}+\frac{x^7}{\log(10^7)}-\frac{x^8}{\log(10^8)}+\frac{x^9}{\log(10^9)}-\frac{x^{10}}{\log(10^{10})}+\frac{x^{11}}{\log(10^{11})}\!$$ $$ -\frac{x^{12}}{\log(10^{12})}+\frac{x^{13}}{\log(10^{13})}-\frac{x^{14}}{\log(10^{14})} \! $$

For n=15:

$$ \log(x+1) = \frac{x}{\log(10)}-\frac{x^2}{\log(10^2)}+\frac{x^3}{\log(10^3)}-\frac{x^4}{\log(10^4)}+\frac{x^5}{\log(10^5)}-\frac{x^6}{\log(10^6)}+\frac{x^7}{\log(10^7)}-\frac{x^8}{\log(10^8)}+\frac{x^9}{\log(10^9)}-\frac{x^{10}}{\log(10^{10})}+\frac{x^{11}}{\log(10^{11})}\!$$ $$ -\frac{x^{12}}{\log(10^{12})}+\frac{x^{13}}{\log(10^{13})}-\frac{x^{14}}{\log(10^{14})}+\frac{x^{15}}{\log(10^{15})} \! $$

For n=16:

$$ \log(x+1) = \frac{x}{\log(10)}-\frac{x^2}{\log(10^2)}+\frac{x^3}{\log(10^3)}-\frac{x^4}{\log(10^4)}+\frac{x^5}{\log(10^5)}-\frac{x^6}{\log(10^6)}+\frac{x^7}{\log(10^7)}-\frac{x^8}{\log(10^8)}+\frac{x^9}{\log(10^9)}-\frac{x^{10}}{\log(10^{10})}+\frac{x^{11}}{\log(10^{11})}\!$$ $$ -\frac{x^{12}}{\log(10^{12})}+\frac{x^{13}}{\log(10^{13})}-\frac{x^{14}}{\log(10^{14})}+\frac{x^{15}}{\log(10^{15})}-\frac{x^{16}}{\log(10^{16})} \!$$

Using Matlab to plot the graph:

Part 2
Find $$ y_n (x) \! $$ such that:

$$ y_n'' + ay_n'+by_n = r_n (x) \! $$   (1) p.7c-27

with the same initial conditions as in (2) p.7c-28.

Plot $$ y_n (x) \! $$ for n = 3, 6, 9, for x in $$ [\frac{-3}{4}, 3] \! $$.

In a series of separate plots, compare the results obtained with the projected excitation on polynomial basis to those with truncated Taylor series of the excitation. Plot also the numerical solution as a baseline for comparison.

Solution
First, we find the homogeneous solution to the ODE: The characteristic equation is: $$\lambda^2-3\lambda+2=0\!$$ $$(\lambda-2)(\lambda-1)=0\!$$ Then, $$\lambda=1,2\!$$ Therefore the homogeneous solution is: $$y_h=C_1e^(2x)+c_2e^x\!$$

Now to find the particulate solution

For n=3:

$$ r(x)=\sum_{0}^{n}-\frac{(-1)^nx^n}{n\ln (10)} \!$$

$$ r(x)=\frac{x}{\ln(10)}-\frac{x^2}{2\ln(10)}+\frac{x^3}{3\ln(10)} \!$$

We can then use a matrix to organize the known coefficients:

$$ \begin{bmatrix} 2 &-3  &2  &0  & 0\\ 0&  2  &-6  &6  & 0\\ 0&  0&  2  &-9  &12  \\ 0&  0&  0&  2  &-12\\ 0&  0&  0& 0 &  2  \\  \end{bmatrix} \begin{bmatrix} K_{0} \\ K_{1} \\ K_{2} \\ K_{3} \end{bmatrix} = \begin{bmatrix} 0 \\ \frac{1}{ln(10)} \\ \frac{1}{2ln(10)} \\ \frac{1}{3ln(10)} \end{bmatrix}\!$$ Then, using MATLAB and the backlash operator we can solve for these unknowns: Therefore $$ y_{p4}=4.0444+3.7458x+1.5743x^2+0.3981x^3+0.0543x^4 \!$$ Superposing the homogeneous and particulate solution we get $$ y_{n}=4.0444+3.7458x+1.5743x^2+0.3981x^3+0.0543x^4+C_1e^{2x}+C_2e^{x} \!$$ Differentiating: $$y'_{n}=3.7458+3.1486x+1.1943x^2+0.2172x^3+2C_1e^{2x}+C_2e^{x}\!$$ Evaluating at the initial conditions: $$y(-0.75)=0.9698261719+0.231301601C_!+0.4723665527C_2=1\!$$ $$y'(-0.75)=1.9645125+0.4462603203C_1+0.4723665527C_2=0\!$$ We obtain: $$ C_1=-4.46\!$$ $$ C_2=0.055 \!$$ Finally we have: $$ y_{n}=4.0444+3.7458x+1.5743x^2+0.3981x^3+0.0543x^4-4.46e^{2x}+0.055e^{x} \!$$

For n=6:

$$ r(x)=\sum_{0}^{n}-\frac{(-1)^nx^n}{n\ln (10)} \!$$

$$ r(x)=\frac{x}{\ln(10)}-\frac{x^2}{2\ln(10)}+\frac{x^3}{3\ln(10)}-\frac{x^4}{4\ln(10)}+\frac{x^5}{5\ln(10)}-\frac{x^6}{6\ln(10)} \!$$

We can then use a matrix to organize the known coefficients:

$$ \begin{bmatrix} 2 &-3  &2  &0  & 0 &0 &0 &0\\ 0&  2  &-6  &6  & 0 &0 &0 &0\\ 0&  0&  2  &-9  &12  &0 &0 &0\\ 0&  0&  0&  2  &-12 &20 &0 &0 \\ 0&  0&  0& 0 &  2 &-15 &30 &0\\ 0 &0 &0 &0 &0 &2 &-18 &42\\ 0 &0 &0 &0 &0 &0  &2 &-21\\ 0 &0 &0 &0 &0 &0 &0 &2\\  \end{bmatrix} \begin{bmatrix} K_{0} \\ K_{1} \\ K_{2} \\ K_{3} \\ K_{4} \\ K_{5} \\ K_{6} \end{bmatrix} \begin{bmatrix} 0 \\ \frac{1}{ln(10)} \\ \frac{1}{2ln(10)} \\ \frac{1}{3ln(10)} \\ \frac{1}{4ln(10)} \\ \frac{1}{5ln(10)} \\ \frac{1}{6ln(10)} \end{bmatrix}\!$$ Then, using MATLAB and the backlash operator we can solve for these unknowns: Therefore $$ y_{p7}=377.4833+375.3933x+185.6066x^2+60.5479x^3+14.4946x^4+2.6492x^5+0.3619x^6+0.0310x^7 \!$$ Superposing the homogeneous and particulate solution we get $$ y_{n}=377.4833+375.3933x+185.6066x^2+60.5479x^3+14.4946x^4+2.6492x^5+0.3619x^6+0.0310x^7+C_1e^{2x}+c_2e^x \!$$ Differentiating: $$y'_{n}=375.3933+371.213x+181.644x^2+57.9784x^3+13.46x^4+2.1714x^5+0.214x^6+2C_1e^{2x}+C_2e^x\!$$ Evaluating at the initial conditions: $$y(-0.75)=178.816+0.2231301601C_!+0.4723665527C_2=1\!$$ $$y'(-0.75)=178.413+0.4462603203C_1+0.4723665527C_2\!$$ We obtain: $$ C_1=-2.6757\!$$ $$ C_2=-375.173 \!$$ Finally $$ y_{n}=377.4833+375.3933x+185.6066x^2+60.5479x^3+14.4946x^4+2.6492x^5+0.3619x^6+0.0310x^7+-2.6757e^{2x}-375.173e^x \!$$

For n=9:

$$ r(x)=\sum_{0}^{n}-\frac{(-1)^nx^n}{n\ln (10)} \!$$

$$ r(x)=\frac{x}{\log(10)}-\frac{x^2}{\log(10^2)}+\frac{x^3}{\log(10^3)}-\frac{x^4}{\log(10^4)}+\frac{x^5}{\log(10^5)}-\frac{x^6}{\log(10^6)}+\frac{x^7}{\log(10^7)}-\frac{x^8}{\log(10^8)}+\frac{x^9}{\log(10^9)} \! $$

We can then use a matrix to organize the known coefficients: $$ \begin{bmatrix} K_{0} \\ K_{1} \\ K_{2} \\ K_{3} \\ K_{4} \\ K_{5} \\ K_{6} \\ K_{7} \\ K_{8} \\ K_{9} \end{bmatrix} = \begin{bmatrix} 0 \\ \frac{1}{ln(10)} \\ \frac{1}{2ln(10)} \\ \frac{1}{3ln(10)} \\ \frac{1}{4ln(10)} \\ \frac{1}{5ln(10)} \\ \frac{1}{6ln(10)} \\ \frac{1}{7ln(10)} \\ \frac{1}{8ln(10)} \\ \frac{1}{9ln(10)} \end{bmatrix}\!$$ Then, using MATLAB and the backlash operator we can solve for these unknowns: Therefore $$ y_{p11}=1753158.594+1752673.419x+875851.535x^2+291627.134x^3+72745.1129x^4+14484.362x^5+2392.510x^6+335.632x^7+40.417x^8\!$$ $$+4.1499x^9+0.3474x^(10)+0.0197x^(11) \!$$ Superposing the homogeneous and particulate solution we get $$ y_{n}=1753158.594+1752673.419x+875851.535x^2+291627.134x^3+72745.1129x^4+14484.362x^5+2392.510x^6+335.632x^7+40.417x^8\!$$ $$+4.1499x^9+0.3474x^(10)+0.0197x^(11)+C_1e^{2x}+C_2e^(x) \!$$ Differentiating: $$y'_{n}=0.2167 x^10+3.474 x^9+37.3491 x^8+323.336 x^7+2349.42 x^6+14355.1 x^5+72421.8 x^4+290980. x^3+874881. x^2\!$$ $$+1.7517x10^6 x+1.75267x10^6+2C_1e^{2x}+C_2e^x\!$$ Evaluating at the initial conditions: $$y(-0.75)=828254+0.2231301601C_!+0.4723665527C_2=1\!$$ $$y'(-0.75)=828145+0.4462603203C_1+0.4723665527C_2=0\!$$ We obtain: $$ C_1=-484.022\!$$ $$ C_2=-1753750 \!$$ Finally $$ y_{n}=1753158.594+1752673.419x+875851.535x^2+291627.134x^3+72745.1129x^4+14484.362x^5+2392.510x^6+335.632x^7+40.417x^8\!$$ $$+4.1499x^9+0.3474x^(10)+0.0197x^(11)-484.022e^{2x}-1753750e^x \!$$

Here is the graph for this problem using Matlab: