User:Rjorjorjo/HW4

=Problem 5-Prove the Equality (integration by parts)=

Statement
Given $$ \displaystyle g_{k}(t):=\,f(x(t)):\,\,\,x\,\,\in\, [\,x_k,x_{k+1}\,]\,$$

$$ \displaystyle \int_{-1}^{+1}g^{(1)}(t)dt =\, \int_{-1}^{+1}g(t)dt -\,[\,g(-1)+\,g(+1)\,]\,$$


 * {| style="width:100%" border="1" align="left"


 * Ref: Lecture Notes [[media:Egm6341.s10.mtg21.pdf|P21-2]]
 * }
 * }

Solution
Use Integration by parts [[media:Egm6341.s10.mtg5.pdf|P5-2]] $$ \displaystyle \int_{a}^{b}u^{'}vdt =\, [\,uv\,]_{a}^{b}-\,\int_{a}^{b}uv^{'}dt\,$$

Let $$ \displaystyle g^{(1)}(t)=\,u^{'}\,\,\,(-t)=\,v\,$$


 * $$ \displaystyle

\begin{align} \\\int_{-1}^{+1}g^{(1)}(t)(-t)dt &=\, [\,g(t)(-t)\,]_{-1}^{+1}-\,\int_{-1}^{+1}g(t)(-1)dt\; \\ &=\, -\,g(+1)-\,(g(-1))+\,\int_{-1}^{+1}g(t)dt\; \\ &=\, \int_{-1}^{+1}g(t)dt-\,[\,g(-1)+\,g(+1)\,]\,. \end{align} $$

=Problem 7-Download and Install chebfun package=

Statement
Install chebfun, a Matlab code package wrote by Trefethen et al.(2004)


 * {| style="width:100%" border="1" align="left"


 * Ref: Lecture Notes [[media:Egm6341.s10.mtg25.pdf|P25-1]]
 * }
 * }

Install
Use this website to download Matlab package |chebfun

Test with two quick examples: (1)What is the integral of $$ \displaystyle sin(sin(x)) \,$$ from 0 to 10? (2)What is the maximum of $$ \displaystyle sin(x)+\,sin(x_{2})\,$$ over the same interval?

-> installed successfully

(3)calculate the integration of $$ \int_{0}^{1}\,\frac{e^{x}\,-1}{x}\mathrm{d} x $$

Use chebfun : Matlab code :

Get Ich = 1.317902151454403  Ech = 4.403366560268296e-012 (4) How long for using chebfun to calculate?

Get Elapsed time is 0.462024 seconds.

EGM6341.s10.Team1.Ya-Chiao Chang 14:18, 7 March 2010 (UTC)