# University of Florida/Egm4313/s12.team8.dupre/R7.3

R7.3

## Problem Statement

Find:
(a) The scalar product $\displaystyle <f,g>.$
(b) The magnitude of $\displaystyle f$ and $\displaystyle g$.
(c) The angle between $\displaystyle f$ and $\displaystyle g$.
For:
(1) $\displaystyle f(x)=cos(x),g(x)=x$ for $\displaystyle -2\leq x\leq 10$.
(2) $\displaystyle f(x)={\frac {1}{2}}(3x^{2}-1),g(x)={\frac {1}{2}}{(5x^{2}-3x)}$ for $\displaystyle -1\leq x\leq 1$.

### Solution (1)

(a) We know that $\displaystyle <f,g>=\int _{a}^{b}f(x)g(x)dx$
Plugging in our given $\displaystyle f$ and $\displaystyle g$ functions:
$\displaystyle \int _{-2}^{10}xcos(x)dx$ (7.3.1)
Integrating (7.3.1) by parts where:
$\displaystyle du=cos(x),v=x,u=sin(x),dv=dx$
We find:
$\displaystyle \int vdu=vu-\int udv$
$\displaystyle \int xcosx=xsinx-\int sinxdx$
This leads us to the solution:
(b) We know that the magnitude of a function is obtained as follows:
$\displaystyle \parallel f\parallel =<f,f>=[\int _{a}^{b}{f^{2}(x)dx}]^{1/2}$
Plugging our given values in and using trigonometric identities:
$\displaystyle \parallel f(x)\parallel =[\int _{-2}^{10}{cos^{2}(x)dx}]^{1/2}=[\int _{-2}^{10}{({\frac {1}{2}}(cos(2x))+{\frac {1}{2}})dx}]^{1/2}$ (7.3.3)
Using u substitution on (7.3.3) to integrate, where:
$\displaystyle u=2x,du=2dx$
We find:
$\displaystyle {\frac {1}{4}}\int _{-2}^{10}cos(u)du=\int _{-2}^{10}{\frac {1}{2}}dx$
This leads to:
$\displaystyle [{\frac {1}{2}}(sinxcosx+x)\mid _{-2}^{10}]^{1/2}$
And allows us to solve for our answer:
Doing the same process (without needing to integrate by parts) for our given g function:
$\displaystyle \parallel g(x)\parallel =[\int _{-2}^{10}x^{2}dx]^{1/2}$
$\displaystyle \parallel g(x)\parallel =[{\frac {x^{3}}{3}}\mid _{-2}^{10}]$
Giving us our final magnitude of:
(c) We know that:
$\displaystyle cos(\theta )={\frac {<f,g>}{\parallel f\parallel \parallel g\parallel }}(7.3.4)$
Plugging in solved values shows:
$\displaystyle cos(\theta )={\frac {-7.68}{(2.478)(18.33)}}$
Leading us to:

### Solution (2)

(a) We know that $\displaystyle <f,g>=\int _{a}^{b}f(x)g(x)dx$
Plugging in our given $\displaystyle f$ and $\displaystyle g$ functions:
$\displaystyle {\frac {1}{2}}\int _{-1}^{1}(3x^{2}-1)(5x^{3}-3x)dx$ (7.3.5)
Integrating (7.3.5), we find:
$\displaystyle {\frac {1}{2}}[{\frac {15}{6}}x^{6}-{\frac {14}{4}}x^{4}+{\frac {3}{2}}x^{2}\mid _{-1}^{1}]$
This leads us to the solution:
(b) We know that the magnitude of a function is obtained as follows:
$\displaystyle \parallel f\parallel =<f,f>=[\int _{a}^{b}{f^{2}(x)dx}]^{1/2}$
Plugging our given values in and using trigonometric identities:
$\displaystyle \parallel f(x)\parallel =[\int _{-1}^{1}({\frac {3}{2}}x^{2}-{\frac {1}{2}})^{2}dx]^{1/2}=[{\frac {9}{20}}x^{5}-{\frac {x^{3}}{2}}+{\frac {x}{4}}\mid _{-1}^{1}]^{1/2}$ (7.3.7)
This allows us to solve for our answer:
We now obtain the magnitude of the g function in the same way, as follows:
$\displaystyle \parallel g(x)\parallel =[\int _{-1}^{1}({\frac {5}{2}}x^{3}-{\frac {3}{2}}x)^{2}dx]^{1/2}=[{\frac {25}{28}}x^{7}-{\frac {3}{2}}x^{5}+{\frac {3}{4}}x^{3}]\mid _{-1}^{1}]^{1/2}$
Which leads up to our final magnitude:
(c) We know that:
$\displaystyle cos(\theta )={\frac {<f,g>}{\parallel f\parallel \parallel g\parallel }}(7.3.4)$
Plugging in (7.3.8) and (7.3.9) shows:
$\displaystyle cos(\theta )={\frac {0}{(.632456)(.5345)}}$
Leading us to: