University of Florida/Egm4313/s12.team11.perez.gp/R5.9

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 1
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
Using Matlab, this is the code that was used to produce the results:

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
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\!$$