I know how to determine if vectors/matrices/polynomials span a vector space, even though I don't really understand the concept. Now I'm facing the question of which ones of the next options are within the span of $f=\cos^2(x)$ and $g=\sin^2(x)$:
1) $\cos(2x)$
2) $3+x^2$
3) $1$
4) $\sin(x)$
My guess is that only 3 and 4 are in the space spanned by f and g, but I can't really explain it or prove it. With vectors/matrices/polynomials I use the matrix method (I don't know if it has a name), but I can't use that one with these. What do I need to know to understand how this concept works with trigonometric functions? Sorry if it's a dumb question.
We have $\cos 2x=\cos^2 x-\sin^2 x$, so $\cos 2x$ is in the space spanned by $\cos^2 x$ and $\sin^2 x$.
The function $\sin x$ is not in the space spanned. There are many ways to see this. For example, $\sin x$ is an odd function, that is, $\sin(-x)=-\sin x$. But $\cos^2x$ and $\sin^2 x$ are even functions, and therefore so is any linear combination of them. Another way of seeing it is that $\sin x$ has smallest period $2\pi$, while $\cos^2 x$ and $\sin^2 x$ have smallest period $\pi$.
Or else we can suppose that $\sin x=a\cos^2 x+b\sin^2 x$ for some real numbers $a$ and $b$, and then use special values of the trig functions to derive a contradiction. As a start, let $x=0$. That tells us that $a=0$.
You are right in deciding $3+x^2$ is not in the span. Any function in the span is periodic, and $3+x^2$ isn't.