# University of Florida/Egm4313/s12.team5.R5

Report 5

## R5.1

### Question

Find ${\displaystyle R_{c}}$ for the following series:
1. ${\displaystyle r(x)=\sum _{k=0}^{\infty }(k+1)kx^{k}}$

2. ${\displaystyle r(x)=\sum _{k=0}^{\infty }{\frac {(-1)^{k}}{\gamma ^{k}}}x^{2k}}$

${\displaystyle \gamma ={\text{constant}}}$

Use (2)-(3)p.7-31 to find ${\displaystyle R_{c}}$ for the Taylor series of

3. ${\displaystyle sinx}$ at ${\displaystyle {\hat {x}}=0}$

4. ${\displaystyle log(1+x)}$ at ${\displaystyle {\hat {x}}=0}$

5. ${\displaystyle log(1+x)}$ at ${\displaystyle {\hat {x}}=1}$

### Solution

1. ${\displaystyle r(x)=\sum _{k=0}^{\infty }(k+1)kx^{k}=0+2x+6x^{2}...}$

Using L'Hospital's rule and (2)p.7-31, and setting ${\displaystyle d_{k}=(k+1)k}$:

${\displaystyle R_{c}=\left[\lim _{k\to \infty }\left|{\frac {(k+2)(k+1)}{(k+1)k}}\right|\right]^{-1}=\left[\lim _{k\to \infty }\left|{\frac {k+2}{k}}\right|\right]^{-1}=\left[\lim _{k\to \infty }\left|{\frac {1}{1}}\right|\right]^{-1}=1}$

2.${\displaystyle r(x)=\sum _{k=0}^{\infty }{\frac {(-1)^{k}}{\gamma ^{k}}}x^{2k}=1-{\frac {1}{\gamma }}x^{2}+{\frac {1}{\gamma ^{2}}}x^{4}...}$

Using (3)p.7-31 and setting ${\displaystyle d_{k}={\frac {(-1)^{k}}{\gamma ^{k}}}}$:

${\displaystyle R_{c}=\lim _{k\to \infty }\left[{\sqrt[{k}]{\left|{\frac {(-1)^{k}}{\gamma ^{k}}}\right|}}\right]^{-1}=\lim _{k\to \infty }{\frac {{\sqrt[{k}]{|\gamma ^{k}}}|}{\sqrt[{k}]{|(-1)^{k}|}}}=\lim _{k\to \infty }{\frac {\sqrt {|\gamma |}}{\sqrt {|-1|}}}={\sqrt {|\gamma |}}}$

3. Taylor series about ${\displaystyle {\hat {x}}=0}$:

${\displaystyle sinx=x+{\frac {1}{6}}x^{3}+{\frac {1}{120}}x^{5}...\Rightarrow \sum _{k=0}^{\infty }{\frac {(-1)^{k}}{(2k+1)!}}x^{2k+1}}$

Using (2)p.7-31 and setting ${\displaystyle d_{k}={\frac {(-1)^{k}}{(2k+1)!}}}$:

${\displaystyle R_{c}=\left[\lim _{k\to \infty }\left|{\frac {\frac {(-1)^{k+1}}{(2(k+1)+1)!}}{\frac {(-1)^{k}}{(2k+1)!}}}\right|\right]^{-1}=\left[\lim _{k\to \infty }\left|{\frac {-1}{(2k+3)(2k+2)}}\right|\right]^{-1}=\infty }$

4. Taylor series about ${\displaystyle {\hat {x}}=0}$:

${\displaystyle log(1+x)=0+x-{\frac {x^{2}}{2}}+{\frac {x^{3}}{3}}...\Rightarrow \sum _{n=0}^{\infty }{\frac {(-1)^{k}(x)^{k+1}}{(k+1)}}}$

Using L'Hospital's rule and (2)p.7-31, and setting ${\displaystyle d_{k}={\frac {(-1)^{k}}{(k+1)}}}$:

${\displaystyle R_{c}=\left[\lim _{k\to \infty }\left|{\frac {\frac {(-1)^{k+1}}{(k+2)}}{\frac {(-1)^{k}}{(k+1)}}}\right|\right]^{-1}=\left[\lim _{k\to \infty }\left|{\frac {(-1)(k+1)}{(k+2)}}\right|\right]^{-1}=\left[\lim _{k\to \infty }\left|{\frac {-1}{1}}\right|\right]^{-1}=1}$

5. Taylor series about ${\displaystyle {\hat {x}}=1}$:

${\displaystyle log(1+x)=log(2)+{\frac {(x-1)}{2}}-{\frac {(x-1)^{2}}{8}}+{\frac {(x-1)^{3}}{24}}...\Rightarrow log(2)+\sum _{n=0}^{\infty }{\frac {(-1)^{k+1}(x-1)^{k}}{k2^{k}}}}$

Using L'Hospital's rule and (2)p.7-31, and setting ${\displaystyle d_{k}={\frac {(-1)^{k+1}}{k2^{k}}}}$:

${\displaystyle R_{c}=\left[\lim _{k\to \infty }\left|{\frac {\frac {(-1)^{k+2}}{(k+1)2^{k+1}}}{\frac {(-1)^{k+1}}{k2^{k}}}}\right|\right]^{-1}=\left[\lim _{k\to \infty }\left|{\frac {-1k}{2(k+1)}}\right|\right]^{-1}=\left[\lim _{k\to \infty }\left|{\frac {-1}{2}}\right|\right]^{-1}=2}$

## R5.2

### Question

Determine whether the following pairs of functions are linearly independent:

${\displaystyle \displaystyle \ 1.f(x)=x^{2},g(x)=x^{4}\ }$

${\displaystyle \displaystyle \ 2.f(x)=\cos(x),g(x)=\sin(3x)\ }$

First use the Wronskian method, then use the Gramian method.

### Solution

The Wronskian is defined as: ${\displaystyle \displaystyle \ W(f,g):=\det {\begin{bmatrix}f&g\\f'&g'\end{bmatrix}}=fg'-gf'\ }$

If ${\displaystyle \displaystyle \ W(f,g)\neq 0\ }$ , then the functions f and g are linearly independent.

The Gramian is defined as: ${\displaystyle \displaystyle \ \Gamma (f,g):=\det {\begin{bmatrix}&\\&\end{bmatrix}}\ }$

Where ${\displaystyle \displaystyle \ :=\int _{a}^{b}f(x)g(x)dx\ }$

If ${\displaystyle \displaystyle \ \Gamma (f,g)\neq 0\ }$ , then the functions f and g are linearly independent.

1. Using Wronskian.

${\displaystyle \displaystyle \ W(f,g)=fg'-gf'=x^{2}(4x^{3})-x^{4}(2x)=4x^{5}-2x^{5}=2x^{5}\neq 0}$

Therefore, f and g are linearly independent.


2. Using Wronskian.

${\displaystyle \displaystyle \ W(f,g)=fg'-gf'=\cos(x)(3\cos(3x))-\sin(3x)(-\sin(x))\neq 0}$

Therefore, f and g are linearly independent.


1. Using Gramian with an interval of [-1,1]

${\displaystyle \displaystyle \ =\int _{-1}^{1}x^{2}(x^{2})dx={\frac {1}{5}}x^{5}\mid _{-1}^{1}={\frac {2}{5}}\ }$

${\displaystyle \displaystyle \ ==\int _{-1}^{1}x^{2}(x^{4})dx={\frac {1}{7}}x^{7}\mid _{-1}^{1}={\frac {2}{7}}\ }$

${\displaystyle \displaystyle \ =\int _{-1}^{1}x^{4}(x^{4})dx={\frac {1}{9}}x^{9}\mid _{-1}^{1}={\frac {2}{9}}\ }$

${\displaystyle \displaystyle \ \Gamma (f,g)=-={\frac {2}{5}}({\frac {2}{9}})-{\frac {2}{7}}({\frac {2}{7}})={\frac {4}{45}}-{\frac {4}{49}}\neq 0\ }$

Therefore, f and g are linearly independent.


2. Using Gramian with an interval of [-1,1]

${\displaystyle \displaystyle \ =\int _{-1}^{1}\cos(x)(\cos(x))dx=\int _{-1}^{1}\cos ^{2}(x)dx={\frac {1}{2}}\int _{-1}^{1}1+\cos(2x)dx={\frac {1}{2}}(x+{\frac {1}{2}}\sin(2x))\mid _{-1}^{1}=1.4546\ }$

${\displaystyle \displaystyle ==\int _{-1}^{1}\sin(3x)\cos(x)dx=0\ }$

${\displaystyle \displaystyle ==\int _{-1}^{1}\sin ^{2}(3x)dx={\frac {1}{2}}\int _{-1}^{1}1-cos(6x)dx={\frac {1}{2}}(x-{\frac {1}{6}}\sin(6x))\mid _{-1}{1}=1.04657\ }$

${\displaystyle \displaystyle \ \Gamma (f,g)=-=1.4546(1.04657)-0(0)\neq 0\ }$

Therefore, f and g are linearly independent.


### Author

This problem was solved and uploaded by David Herrick.

## R5.3

### Question

Verify that ${\displaystyle b_{1}}$ and ${\displaystyle b_{2}}$ in (1)-(2) p.7-34 are linearly independent using the Gramian

### Solution

The given Grammian:

 ${\displaystyle \displaystyle \Gamma (b_{1},b_{2})={\begin{bmatrix}\left\langle b_{1},b_{1}\right\rangle \left\langle b_{1},b_{2}\right\rangle \\\left\langle b_{2},b_{1}\right\rangle \left\langle b_{2},b_{2}\right\rangle \end{bmatrix}}}$

In reference to to (3) on p.8-9

 ${\displaystyle \displaystyle \left\langle b_{1},b_{1}\right\rangle =(b_{1}\cdot b_{2})}$

Calculating the dot products yields:

 ${\displaystyle \displaystyle \left\langle b_{1},b_{1}\right\rangle =4+49=53}$
 ${\displaystyle \displaystyle \left\langle b_{1},b_{2}\right\rangle =3+21=24}$
 ${\displaystyle \displaystyle \left\langle b_{2},b_{1}\right\rangle =3+21=24}$
 ${\displaystyle \displaystyle \left\langle b_{2},b_{2}\right\rangle =2.25+9=11.25}$

Plugging the dot products into the Grammian yields:

 ${\displaystyle \displaystyle \Gamma =596.25-576=20.25\neq 0}$
Therefore, b1 and b2 are linearly independent.


### Author

Solved and uploaded by Derik Bell

## R5.4

### Question

Show that: ${\displaystyle y_{p}(x)=\sum _{i=0}^{n}(y_{p,i}(x))}$
is the particular solution to: ${\displaystyle y''+p(x)y'+q(x)y=r(x)}$
Discuss the choice of particular solutions in the table on p8-3. In other words, for r(x) = kcos(wx), why would you need to have both cos(wx) and sin(wx) in the particular solution?

### Solution

For a single excitation that satisfies ${\displaystyle r_{i}(x)}$,
${\displaystyle y_{p,i}''+p(x)y_{p,i}'+q(x)y_{p,i}=r_{i}(x)}$
for example:
${\displaystyle y_{p0}''+p(x)y_{p0}'+q(x)y_{p0}=r_{0}(x)}$
${\displaystyle y_{p1}''+p(x)y_{p1}'+q(x)y_{p1}=r_{1}(x)}$
${\displaystyle y_{p2}''+p(x)y_{p2}'+q(x)y_{p2}=r_{2}(x)}$
and so on until...
${\displaystyle y_{p,n}''+p(x)y_{p,n}'+q(x)y_{p,n}=r_{n}(x)}$ where by linearity: ${\displaystyle r(x)=\sum _{i=0}^{n}r_{i}(x)}$
Since ${\displaystyle y_{p,i}}$ is the solution to a single iteration of r(x) and ${\displaystyle r(x)=\sum _{i=1}^{n}r_{i}(x)}$ , then by linearity, the solution to r(x) is: ${\displaystyle y_{p}(x)=\sum _{i=1}^{n}y_{p,i}}$
Part 2:
kcos(wx) is a periodic function. As shown by (3) on p8-2, any periodic function can be broken down into a fourier trigonometric series:
${\displaystyle r(x)=a_{0}+\sum _{n=1}^{\infty }[a_{n}cos(nwx)+b_{n}sin(nwx)]}$
r(x) can be further broken down as the sum of:
${\displaystyle r_{a}=a_{0}}$
${\displaystyle r_{b}=\sum _{n=1}^{\infty }a_{n}cos(nwx)}$
${\displaystyle r_{c}=\sum _{n=1}^{\infty }b_{n}sin(nwx)}$
Where ${\displaystyle r(x)=r_{a}+r_{b}+r_{c}}$
Since r(x) is expressed in terms of cos(x) and sin(x) the particular solution, which is also a sum of the individual particular solutions for each iteration of ${\displaystyle r_{a}}$, ${\displaystyle r_{b}}$, and ${\displaystyle r_{c}}$, needs to be in terms of sin(x) and cos(x) as well. That applies to all periodic functions as shown on p8-2, which sin(x) is as well. Therefore that justifies why the particular solutions for kcos(wx), ksin(wx), ${\displaystyle ke^{\alpha x}\cos {wx}}$, and ${\displaystyle ke^{\alpha x}\sin {wx}}$ must all include both cos(x) and sin(x).

### Author

This problem was solved and uploaded by John North.

## R5.5

### Question

1. Show that cos(7x) and sin(7x) are linearly independent using the Wronskian and the Gramian (integrate over 1 period)
2. Find 2 equations for the two unknowns M,N and solve for M,N
3. Find the overall solution y(x) that corresponds to the initial condition y(0)=1, y'(0)=0. Plot the solution over 3 periods.

### Solution

(1)

First, using Wronskian:

For 2 functions, f and g, the Wrosnkian is defined as ${\displaystyle \displaystyle W(f,g):=det{\begin{bmatrix}f&g\\f'&g'\end{bmatrix}}=fg'-gf'}$
Where f and g are linearly independent if ${\displaystyle \displaystyle W(f,g)\neq 0}$
For ${\displaystyle \displaystyle f=cos(7x),g=sin(7x),f'=-7sin(7x),g'=7cos(7x)}$
Then, ${\displaystyle \displaystyle W(f,g):=det{\begin{bmatrix}cos(7x)&sin(7x)\\-7sin(7x)&7cos(7x)\end{bmatrix}}=7cos^{2}(7x)+7sin^{2}(7x)\neq 0}$
Therefore, f and g are linearly independent


Second, using Gramian:

Consider two functions, f and g, where the scalar product is defined as
${\displaystyle \displaystyle :=\int _{a}^{b}f(x)g(x)dx}$
And the Gramian defined as
${\displaystyle \displaystyle \Gamma (f,g):=det{\begin{bmatrix}&\\&\end{bmatrix}}}$
Then f and g are linearly indepdent if ${\displaystyle \displaystyle \Gamma (f,g)\neq 0}$
For f=cos(7x) and g=sin(7x) and integrating over one period (${\displaystyle \displaystyle {\frac {2\pi }{7}}}$)
${\displaystyle \displaystyle =\int _{0}^{{\frac {2\pi }{7}}{}}cos^{2}(7x)dx}$
Letting ${\displaystyle \displaystyle u=7x,du=7dx}$ and changing limits of integration by plugging in old limits into "u" equation
${\displaystyle \displaystyle ={\frac {1}{7}}\int _{0}^{2\pi }cos^{2}(u)du={\frac {1}{7}}[{\frac {u}{2}}+{\frac {1}{4}}sin2u\mathbf {\mid } _{0}^{2\pi }]={\frac {\pi }{7}}}$
${\displaystyle \displaystyle =\int _{0}^{\frac {2\pi }{7}}sin^{2}(7x)dx}$
Letting ${\displaystyle \displaystyle u=7x,du=7dx}$ and changing the limits of integration by plugging in old limits into "u" equations
${\displaystyle \displaystyle ={\frac {1}{7}}\int _{0}^{2\pi }sin^{2}(u)du={\frac {1}{7}}[{\frac {u}{2}}-{\frac {1}{4}}sin2u\mid _{0}^{2\pi }]={\frac {\pi }{7}}}$
${\displaystyle \displaystyle ==\int _{0}^{\frac {2\pi }{7}}cos(7x)sin(7x)dx}$
From Kreyszig p.479, it is apparent that sin and cos are orthogonal to each other, so the above integration will equal zero
${\displaystyle \displaystyle ==\int _{0}^{\frac {2\pi }{7}}cos(7x)sin(7x)dx=0}$
Plugging in the results of each integral into the Gramian
${\displaystyle \displaystyle {\boldsymbol {\Gamma }}(f,g)=det{\begin{bmatrix}&\\&\end{bmatrix}}=det{\begin{bmatrix}{\frac {\pi }{7}}&0\\0&{\frac {\pi }{7}}\end{bmatrix}}={\frac {\pi ^{2}}{49}}\neq 0}$
Therefore, f and g are linearly independent


(2)

Given ${\displaystyle \displaystyle y''-3y'-10y=3cos(7x)}$
And particular solutions of the form ${\displaystyle \displaystyle y_{p}(x)=Mcos(7x)+Nsin(7x),y'_{p}(x)=-M7sin(7x)+N7cos(7x),y''_{p}(x)=-M49cos(7x)-N49sin(7x)}$
Plug particular solutions back into original ODE and collect like terms
${\displaystyle \displaystyle -M49cos(7x)-N49sin(7x)+M21sin(7x)-N21cos(7x)-M10cos(7x)-N10sin(7x)=3cos(7x)}$
${\displaystyle \displaystyle -59Mcos(7x)-59Nsin(7x)+21Msin(7x)-21Ncos(7x)=3cos(7x)}$
Equating coefficients
${\displaystyle \displaystyle -59M=3\rightarrow M=-{\frac {3}{59}}}$
${\displaystyle \displaystyle -21N=3\rightarrow N=-{\frac {1}{7}}}$
${\displaystyle \displaystyle M=-{\frac {3}{59}},N=-{\frac {1}{7}}}$


(3)

The overall solution ${\displaystyle \displaystyle y(x)=y_{p}(x)+y_{h}(x)}$ consists of the particular solution and homogeneous soloution

Homogeneous solotuion
${\displaystyle \displaystyle y''-3y'-10y=0}$
${\displaystyle \displaystyle a^{2}-4b=3^{2}-4(10)=49>0}$ so we have distinct real roots
${\displaystyle \displaystyle \lambda _{1,2}={\frac {1}{2}}[-a\pm {\sqrt {a^{2}-4b}}]={\frac {1}{2}}[3\pm 7]=5,-2}$
${\displaystyle \displaystyle y_{h}(x)=c_{1}e^{5x}+c_{2}e^{-2x}}$
Using initial conditions ${\displaystyle \displaystyle y(0)=1,y'(0)=1}$ and ${\displaystyle \displaystyle y'_{h}(x)=5c_{1}e^{5x}-2c_{2}e^{-2x}}$
${\displaystyle \displaystyle 5c_{1}-2c_{2}=0}$
${\displaystyle \displaystyle c_{1}+c_{2}=1}$
Solving the two equations for the two unknowns yields ${\displaystyle \displaystyle c_{1}={\frac {2}{7}},c_{2}={\frac {5}{7}}}$
${\displaystyle \displaystyle y_{h}(x)={\frac {2}{7}}e^{5x}+{\frac {5}{7}}e^{-2x}}$
Particular solution
${\displaystyle \displaystyle y_{p}(x)=Kcos(\omega x)+Msin(\omega x)}$ where ${\displaystyle \displaystyle \omega =7,K=M=-{\frac {3}{59}},M=N=-{\frac {1}{7}}}$
${\displaystyle \displaystyle y_{p}(x)=-{\frac {3}{59}}cos(7x)-{\frac {1}{7}}sin(7x)}$
Giving us an overall solution of
${\displaystyle \displaystyle y(x)=y_{h}(x)+y_{p}(x)={\frac {2}{7}}e^{5x}+{\frac {5}{7}}e^{-2x}-{\frac {3}{59}}cos(7x)-{\frac {1}{7}}sin(7x)}$

Plotting the solution over three periods ${\displaystyle \displaystyle P={\frac {2\pi }{7}}\Rightarrow 3P={\frac {6\pi }{7}}}$
Matlabcode
EDU>> x=0:0.001:(6*pi)/7;
EDU>> y=(2/7).*exp(5.*x)+(5/7).*exp(-2.*x)-(3/59).*cos(7.*x)-(1/7).*sin(7.*x);
EDU>> plot(x,y)


### Author

Solved and uploaded by Joshua House

## R5.6

### Question

Find the solution to the following initial condition problem, and plot it over 3 periods.

${\displaystyle \displaystyle y''+4y'+13y=2e^{-2x}cos(3x)}$
${\displaystyle \displaystyle y_{h}(x)=e^{-2x}(Acos(3x)+Bsin(3x))}$
${\displaystyle \displaystyle y_{p}(x)=xe^{-2x}(Mcos(3x)+Nsin(3x))}$
${\displaystyle \displaystyle y(0)=1,y'(0)=0}$

### Solution

First, we take the first and second derivative of the particular solution:

${\displaystyle \displaystyle y'_{p}(x)=e^{-2x}(-3Msin(3x)-2Mcos(3x)+3Ncos(3x)-2Nsin(3x))=e^{-2x}[(-3M-2N)sin(3x)+(-2M+3N)cos(3x)]}$
${\displaystyle \displaystyle y''_{p}(x)=e^{-2x}(-9Mcos(3x)+6Msin(3x)-9Nsin(3x)-6Ncos(3x))-2e^{-2x}(-3Msin(3x)-2Mcos(3x)+3Ncos(3x)-2Nsin(3x))}$
${\displaystyle \displaystyle =2e^{-2x}[(12M-5N)sin(3x)+(13M-12N)cos(3x)]}$

Now, we plug the particular solution derivatives into the initial equation:

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

${\displaystyle \displaystyle 2e^{-2x}[(12M-5N)sin(3x)+(13M-12N)cos(3x)]+4[e^{-2x}[(-3M-2Nsin(3x)+(-2M+3N)cos(3x)]]}$
${\displaystyle \displaystyle +13[e^{-2x}[Mcos(3x)+Nsin(3x)]]=2e^{-2x}cos(3x)}$

${\displaystyle \displaystyle e^{-2x}[(24M-10N)sin(3x)+(26M-24N)cos(3x)+(-12M-8N)sin(3x)+(-8M+12N)cos(3x)+13Mcos(3x)+13Nsin(3x)]}$
${\displaystyle \displaystyle =2e^{-2x}cos(3x)}$

${\displaystyle \displaystyle (12M-5N)sin(3x)+(31M-12N)cos(3x)=2cos(3x)}$

Now, we equate the coefficients of sin(3x) and cos(3x) to determine the unknown coefficients M and N:

${\displaystyle \displaystyle 12M-5N=0}$
${\displaystyle \displaystyle 31M-12N=2}$
${\displaystyle \displaystyle N={\frac {24}{11}},M={\frac {10}{11}}}$

Therefore, the particular solution is:

${\displaystyle \displaystyle y_{p}(x)=e^{-2x}[{\frac {10}{11}}cos(3x)+{\frac {24}{11}}sin(3x)]}$

Now, we focus on the homogeneous part of the solution. It is given to us as:

${\displaystyle \displaystyle y_{h}(x)=e^{-2x}[Acos(3x)+Bsin(3x)]}$

As you can see, this is identical to the particular solution, except that M is now A and N is now B. Therefore, the first derivative of the homogenous solution will be in the same form as the first derivative of the particular solution:

${\displaystyle \displaystyle y'_{h}(x)=e^{-2x}(-3Asin(3x)-2Acos(3x)+3Bcos(3x)-2Bsin(3x))=e^{-2x}[(-3A-2B)sin(3x)+(-2A+3B)cos(3x)]}$

Remembering the two initial conditions, y(0) = 1 and y'(0) = 0, we apply these to the homogenous equations:

${\displaystyle \displaystyle y_{h}(0)=e^{-2x}[Acos(3x)+Bsin(3x)]=1}$
${\displaystyle \displaystyle y'_{h}(x)=e^{-2x}[(-3A-2B)sin(3x)+(-2A+3B)cos(3x)]=0}$

This yields two equations that we can use to solve for the coefficients A and B:

${\displaystyle \displaystyle A=1}$
${\displaystyle \displaystyle -2A+3B=0\Rightarrow 3B=2\Rightarrow B={\frac {3}{2}}}$

Therefore, the homoegenous solution is:

${\displaystyle \displaystyle y_{h}(x)=e^{-2x}[cos(3x)+{\frac {3}{2}}sin(3x)]}$

We find the final solution, y(x), by adding the homogenous and particular solutions as seen below:

${\displaystyle \displaystyle y(x)=y_{h}(x)+y_{p}(x)=e^{-2x}[cos(3x)+{\frac {3}{2}}sin(3x)]+e^{-2x}[{\frac {10}{11}}cos(3x)+{\frac {24}{11}}sin(3x)]}$
${\displaystyle \displaystyle y(x)=e^{-2x}[{\frac {21}{11}}cos(3x)+{\frac {81}{22}}sin(3x)]}$

Matlab Code: x= 0:0.001:(2*pi/3);

y = exp(-2.*x)*(21/11).*cos(3.*x) + exp(-2.*x)*(81/22).*sin(3.*x);

plot(x,y)

### Author

This problem was solved and uploaded by Will Knapper

## R 5.7

### Question

${\displaystyle v=4e_{1}+2e_{2}=c_{1}b_{1}+c_{2}b_{2}}$
The oblique basis vectors are:
${\displaystyle b_{1}=2e_{1}+7e_{2}}$
${\displaystyle b_{2}=1.5e_{1}+3e_{2}}$

1. Find the components ${\displaystyle c_{1},c_{2}}$ using the Gram matrix as in (1)p.8-11.
2. Verify the results by using (1)-(2)p.7c-34 in (2)p8-11, and rely on the non-zero determinant of the matrix of components of ${\displaystyle b_{1},b_{2}}$ relative to the basis ${\displaystyle e_{1},e_{2}}$, as discussed on p.7c-34.

### Solution

1. Using Gram matrix as in (1) p.8-10:

${\displaystyle {\begin{bmatrix}&\\&\end{bmatrix}}}$ ${\displaystyle {\begin{Bmatrix}c_{1}\\c_{2}\end{Bmatrix}}}$ = ${\displaystyle {\begin{Bmatrix}\\\end{Bmatrix}}}$

From (3)p.8-9 we know that ${\displaystyle =b_{i}\cdot b_{j}}$. Solving the various components we get:

${\displaystyle {\begin{bmatrix}53&24\\24&11.25\end{bmatrix}}}$ ${\displaystyle {\begin{Bmatrix}c_{1}\\c_{2}\end{Bmatrix}}}$ = ${\displaystyle {\begin{Bmatrix}22\\12\end{Bmatrix}}}$

In order to solve for ${\displaystyle c_{1},c_{2}}$ we need to calculate the inverse of ${\displaystyle {\begin{bmatrix}53&24\\24&11.25\end{bmatrix}}}$.

This gives is the Gram matrix as used in (1)p.8-11:
${\displaystyle c=\Gamma ^{-1}d}$

${\displaystyle {\begin{bmatrix}0.55556&-1.18519\\-1.18519&2.61728\end{bmatrix}}}$ ${\displaystyle {\begin{Bmatrix}22\\12\end{Bmatrix}}}$ = ${\displaystyle {\begin{Bmatrix}c_{1}\\c_{2}\end{Bmatrix}}}$

Thus:
${\displaystyle c_{1}=-2;c_{2}=5.333={\frac {16}{3}}}$

2. Plugging in ${\displaystyle b_{1},b_{2}}$ into ${\displaystyle v}$ we get:

${\displaystyle c_{1}(2e_{1}+7e_{2})+c_{2}(1.5e_{1}+3e_{2})=4e_{1}+2e_{2}}$

${\displaystyle 2c_{1}e_{1}+7c_{1}e_{2}+1.5c_{2}e_{1}+3c_{2}e_{2}=4e_{1}+2e_{2}}$

${\displaystyle e_{1}(2c_{1}+1.5c_{2})+e_{2}(7c_{1}+3c_{2})=4e_{1}+2e_{2}}$

Separating into components:

${\displaystyle 2c_{1}+1.5c_{2}=4}$ and ${\displaystyle 7c_{1}+3c_{2}=2}$

Solving the two linearly independent equations we get:

${\displaystyle \ }$
${\displaystyle c_{1}=-2;c_{2}={\frac {16}{3}}}$

## R 5.8

### Question

Find the integral (see R5.9)

${\displaystyle \displaystyle \ \int x^{n}log(1+x)dx\ }$

using integration by parts and then with the help of General binomial theorem.

${\displaystyle \displaystyle \ (x+y)^{n}=\sum _{k=0}^{n}{\binom {n}{k}}x^{n-k}y^{k}\ }$

${\displaystyle \ {\binom {n}{k}}={\frac {n!}{k!(n-k)!}}={\frac {n(n-1)...(n-k+1)}{k!}}\ }$

### Solution

The indefinite integral of ${\displaystyle \ x^{n}\ }$ is

${\displaystyle \ {\frac {x^{n+1}}{n+1}}+C\ }$

For n = 0, we get ${\displaystyle \ \int x^{0}=x\ }$

For n = 1, we get ${\displaystyle \ \int x^{1}={\frac {x^{2}}{2}}\ }$

And the indefinite integral of ${\displaystyle \ log(1+x)\ }$ is

${\displaystyle \ (x+1)log(1+x)-x+C\ }$

Integration by parts

- For n = 0 ${\displaystyle \ \int x^{0}log(1+x)dx=log(1+x)[x+1]-x\ }$

- For n = 1 ${\displaystyle \ \int x^{1}log(1+x)dx={\frac {1}{2}}*[(x-log(1+x))+x^{2}log(1+x)-{\frac {x^{2}}{2}}]\ }$

### Author

Solved and uploaded by Mike Wallace

## R 5.9

### Question

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

${\displaystyle \ y''-3y'+2y=r(x)\ }$

${\displaystyle \ r(x)=log(1+x)\ }$

and the initial conditions

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

#### Part One

Project the excitation r(x) on the polynomial basis ${\displaystyle \ [b_{j}(x)=x^{j},j=0,1,...,n]\ }$

i.e., find ${\displaystyle \ d_{j}\ }$ such that

r(x)${\displaystyle \ r_{n}(x)=\sum _{j=0}^{n}d_{j}x^{j}\ }$

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

Plot ${\displaystyle \ r(x),r_{n}(x)\ }$ to show uniform approximation and convergence

#### Part Two

In a separate series of plots, compare the approximation of the function log(1+x) by 2 methods:

A. Projection on polynomial basis (1) p.8-17

B. Taylor series expansion about x = 0

Observe and discuss the pros and cons of each method

Find ${\displaystyle \ y_{n}(x)\ }$ such that:

${\displaystyle \ y_{n}''+ay_{n}'+by_{n}=r_{n}(x)\ }$

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

Plot ${\displaystyle \ y_{n}(x)\ }$ for n = 3, 6, 9, for x in ${\displaystyle \ [-{\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

Using ${\displaystyle \ y''-3y'+2y=log(1+x)\ }$

For n = 0

${\displaystyle \ {b_{0}}={x^{0}}\ }$

${\displaystyle \ r=log(1+x)=C_{0}x^{0}\ }$

${\displaystyle \ d_{0}==\int _{-{\frac {3}{4}}}^{3}log(1+x)dx=2.14175\ }$

${\displaystyle \ =\int _{-{\frac {3}{4}}}^{3}x^{0}x^{0}dx=x|_{-{\frac {3}{4}}}^{3}={\frac {15}{4}}\ }$

${\displaystyle \ d_{0}=C_{0}=C_{0}({\frac {15}{4}})=2.14175\ }$

${\displaystyle \ C_{0}=0.57113\ }$

${\displaystyle \ Y=Y_{h}+Y_{p}=C_{1}e^{2x}+C_{2}e^{x}+0.57113\ }$

${\displaystyle \ Y'=2C_{1}e^{2x}+C_{2}e^{x}\ }$

${\displaystyle \ y({\frac {3}{4}})=C_{1}e^{\frac {6}{4}}+C_{2}e^{\frac {3}{4}}+0.57113=1\ }$

${\displaystyle \ y'(-{\frac {3}{4}})=-{\frac {6}{4}}C_{1}e^{-{\frac {6}{4}}}+C_{2}e^{-{\frac {3}{4}}}=0\ }$

Subtracting Y from Y' in order to find the coefficients

${\displaystyle \ C_{1}e^{-{\frac {6}{4}}}-0.57113=-1\ }$

${\displaystyle \ C_{1}=--1.92205\ }$

${\displaystyle \ C_{2}=1.81582\ }$

For n = 0 the final solution will be

${\displaystyle \ Y=-1.92205e^{2x}+1.81582e^{x}+0.57113\ }$

For n = 1

${\displaystyle \ C_{0}=-.09399,C_{1}=0.591217\ }$

We need to find the homogeneous Y

${\displaystyle \ \lambda ^{2}-3\lambda +2=0=>(\lambda -2)(\lambda -1)=0\ }$

${\displaystyle \ \lambda _{1,2}=2,1\ }$

${\displaystyle \ Y_{h}=C_{1}e^{2x}+C_{2}e^{x}\ }$

${\displaystyle \ Y=Y_{h}+Y_{p}=C_{1}e^{2x}+C_{2}e^{x}-0.09399+0.591217x\ }$

Solving for the initial conditions

${\displaystyle \ y({\frac {3}{4}})=C_{1}e^{\frac {6}{4}}+C_{2}e^{\frac {3}{4}}-0.09399+0.591217({\frac {3}{4}})=1\ }$

${\displaystyle \ Y'==2C_{1}e^{2x}+C_{2}e^{x}+0.591217\ }$

${\displaystyle \ y'(-{\frac {3}{4}})=-{\frac {6}{4}}C_{1}e^{-{\frac {6}{4}}}+C_{2}e^{-{\frac {3}{4}}}+0.591217=0\ }$

This gives coefficients of:

${\displaystyle \ C_{1}=-9.5398,C_{2}=7.761\ }$

For n = 1 the final solution will be;

${\displaystyle \ Y=-9.5398e^{2x}+7.761e^{x}+0.591217x-0.09399\ }$

### Author

This problem was solved and uploaded by Mike Wallace

## Contribution Summary

Problem 2 was solved and Problem 5 was proofread by David Herrick

Problem 5 was solved and uploaded by Joshua House