# Find a basis for subspace defined by {$f∈$Span{$e^{x}, e^{-x},$cos$x,$sin$x, 1, x$}|f(0) = f'(0) = 0}

I got the system of equations:

$a_1 + a_2 +a_3 + 0a_4 + a_5 + 0a_6 = 0$
$a_1 - a_2 - 0a_3 + a_4 + 0a_5 + a_6 = 0$

And this gives four free variables (hence there will be four basis vectors). But I don't know how to write the final basis. E.g., I get:

$a_6 = t$
$a_5 = r$
$a_4 = s$
$a_3 = s - r + t$
$a_2 = q$
$a_1 = -q - s - t$

where $q, r, s, t$ parameters. But once I have this how do I write the final basis?

What you found are the relations between the coefficients to guarantee that $f$ is in the subspace; it has nothing to do with a basis.
Also, you have a mistake in your second equation: the coefficient of $a_2$ should be $-1$.
So a solution would be $$a_1=-(q+r+s+t)/2,\ \ a_2=(-q+r-s+t)/2,\ \ a_3=q,\ \ a_4=r,\ \ a_5=s,\ \ a_6=t$$ What we find then is that the subspace consists of functions of the form $$-\frac{q+r+s+t}2\,e^x+\frac{-q+r-s+t}2e^{-x}+q\cos x+r\,\sin x+s+tx.$$ Now if we think of these guys as vectors on the six "coordinates" given by the six functions, they are of the form \begin{align} \left(-\frac{q+r+s+t}2,\frac{-q+r-s+t}2,q,r,s,t\right)&=q\left(-\frac12,-\frac12,1,0,0,0\right) +r\left(-\frac12,\frac12,0,1,0,0\right)\\ \ \\ &\ \ \ \ \ \ +s\left(-\frac12,-\frac12,0,0,1,0\right)+t\left(-\frac12,\frac12,0,0,0,1\right). \end{align} And so those are the four elements of a basis: if we multiply everything by $2$ to avoid fractions, \begin{align} f_1&=-e^x-e^{-x}+2\cos x\\ f_2&=-e^x+e^{-x}+2\sin x\\ f_3&=-e^x-e^{-x}+2\\ f_4&=-e^x+e^{-x}+2x. \end{align}
• oh that switch from $a_j$ to $x_j$ was a typo - fixed. And I've fixed the other mistake now too. – Wilson Brians Oct 14 '16 at 2:39
• also, shouldn't there be a negative sign in front of your $a_1$? – Wilson Brians Oct 14 '16 at 2:49
• No. The derivative of $e^x$ is $e^x$. – Martin Argerami Oct 14 '16 at 2:57
• Sorry I meant on the last part. You get $a_1=(q+r+s+t)/2,$ but I get the negative of that. And also your equation for $a_2$ has the minus signs mixed up. – Wilson Brians Oct 14 '16 at 3:16