Answer: EITHER:
\(\int_{-\frac12\pi}^{\frac12\pi}e^x\cos x\,dx=\frac12\left(e^{\frac12\pi}+e^{-\frac12\pi}\right),\qquad (n^2+4)I_n=n(n-1)I_{n-2}.\)
The centroid has
\(\bar y=\frac18\left(e^{\frac12\pi}-e^{-\frac12\pi}\right)=0.575\quad \text{to 3 s.f.}\)
OR:
\(\dim V=3\), \(\mathbf v_4=\mathbf v_3-\mathbf v_2-2\mathbf v_1\), and a basis is \(\{\mathbf v_1,\mathbf v_2,\mathbf v_3\}\).
The general solution is
\(\mathbf x=\begin{pmatrix}1\\1\\0\\0\end{pmatrix}+\lambda\begin{pmatrix}2\\1\\-1\\1\end{pmatrix},\qquad \lambda\in\mathbb R.\)
\(W\) is not a vector space, since it is not closed under scalar multiplication.
EITHER
Let
\(I=\int_{-\frac12\pi}^{\frac12\pi}e^x\cos x\,dx.\)
Integrating by parts with \(u=\cos x\) and \(dv=e^x dx\), the boundary term is zero because \(\cos(\pm\frac12\pi)=0\), so
\(I=\int_{-\frac12\pi}^{\frac12\pi}e^x\sin x\,dx.\)
Integrating this new integral by parts gives
\(\int_{-\frac12\pi}^{\frac12\pi}e^x\sin x\,dx=\left[e^x\sin x\right]_{-\frac12\pi}^{\frac12\pi}-I=e^{\frac12\pi}+e^{-\frac12\pi}-I.\)
Therefore
\(I=e^{\frac12\pi}+e^{-\frac12\pi}-I,\)
so
\(I=\frac12\left(e^{\frac12\pi}+e^{-\frac12\pi}\right).\)
For the reduction formula, write
\(I_n=\int_{-\frac12\pi}^{\frac12\pi}e^{2x}\cos^n x\,dx.\)
Integrate by parts with \(u=\cos^n x\) and \(dv=e^{2x}dx\). Since \(n\ge2\), the boundary term is zero, giving
\(I_n=\frac n2\int_{-\frac12\pi}^{\frac12\pi}e^{2x}\sin x\cos^{n-1}x\,dx.\)
Now integrate the remaining integral by parts with \(u=\sin x\cos^{n-1}x\) and \(dv=e^{2x}dx\). Again the boundary term is zero, so
\(\int e^{2x}\sin x\cos^{n-1}x\,dx=-\frac12I_n+\frac{n-1}{2}\int e^{2x}\sin^2x\cos^{n-2}x\,dx.\)
Multiplying by \(\frac n2\),
\(4I_n=n(n-1)\int_{-\frac12\pi}^{\frac12\pi}e^{2x}\sin^2x\cos^{n-2}x\,dx-nI_n.\)
Since \(\sin^2x=1-\cos^2x\),
\(\int e^{2x}\sin^2x\cos^{n-2}x\,dx=I_{n-2}-I_n.\)
Substitute this into the previous result:
\(4I_n=n(n-1)(I_{n-2}-I_n)-nI_n.\)
Hence
\((n^2+4)I_n=n(n-1)I_{n-2}.\)
For the centroid, the area under \(y=e^x\cos x\) is
\(A=\frac12\left(e^{\frac12\pi}+e^{-\frac12\pi}\right).\)
The \(y\)-coordinate of the centroid is
\(\bar y=\frac{1}{2A}\int_{-\frac12\pi}^{\frac12\pi}(e^x\cos x)^2\,dx=\frac{I_2}{2A}.\)
From the reduction formula with \(n=2\),
\(8I_2=2I_0,\quad \text{so}\quad I_2=\frac14I_0.\)
Here
\(I_0=\int_{-\frac12\pi}^{\frac12\pi}e^{2x}\,dx=\frac12(e^\pi-e^{-\pi}),\)
so
\(I_2=\frac18(e^\pi-e^{-\pi}).\)
Therefore
\(\bar y=\frac{\frac18(e^\pi-e^{-\pi})}{e^{\frac12\pi}+e^{-\frac12\pi}}=\frac18\left(e^{\frac12\pi}-e^{-\frac12\pi}\right)=0.575\quad\text{to 3 s.f.}\)
OR
To show \(\dim V=3\), first note that \(\mathbf v_1\), \(\mathbf v_2\), and \(\mathbf v_3\) are independent. If
\(a\mathbf v_1+b\mathbf v_2+c\mathbf v_3=\mathbf0,\)
then comparing the four components gives
\(a-2b=0,\quad 2a-5b-3c=0,\quad 5b+15c=0,\quad 2a+6b+18c=0.\)
These equations imply \(c=0\), then \(b=0\), then \(a=0\). Hence the three vectors are independent.
Also
\(\mathbf v_4=\mathbf v_3-\mathbf v_2-2\mathbf v_1.\)
So the span of all four vectors is already spanned by three independent vectors. Therefore
\(\dim V=3,\qquad \{\mathbf v_1,\mathbf v_2,\mathbf v_3\}\text{ is a basis for }V.\)
For \(\mathbf M\mathbf x=\mathbf v_1+\mathbf v_2\), a particular solution is
\(\mathbf x_0=\begin{pmatrix}1\\1\\0\\0\end{pmatrix},\)
because the first two columns of \(\mathbf M\) are \(\mathbf v_1\) and \(\mathbf v_2\).
A null vector of \(\mathbf M\) is
\(\begin{pmatrix}2\\1\\-1\\1\end{pmatrix},\)
since \(2\mathbf v_1+\mathbf v_2-\mathbf v_3+\mathbf v_4=\mathbf0\). Therefore the general solution is
\(\mathbf x=\begin{pmatrix}1\\1\\0\\0\end{pmatrix}+\lambda\begin{pmatrix}2\\1\\-1\\1\end{pmatrix},\qquad \lambda\in\mathbb R.\)
The set \(W\) is not a vector space. For example,
\(2\begin{pmatrix}1\\1\\0\\0\end{pmatrix}\)
is not a solution of \(\mathbf M\mathbf x=\mathbf v_1+\mathbf v_2\), so it is in \(W\), but multiplying it by \(\frac12\) gives the solution \(\begin{pmatrix}1\\1\\0\\0\end{pmatrix}\), which is not in \(W\). Thus \(W\) is not closed under scalar multiplication.