Let $p(x)$ be a real $7$ degree polynomial with $p(\pi)=\sqrt 3$ and $\int_{-\pi}^{\pi}x^k p(x)=0$ for $0\le k\le 6$. Find $p(0)$ and $p(-\pi)$. 
Q.Let $p(x)$ be a real $7$ degree polynomial with $p(\pi)=\sqrt 3$ and $\int_{-\pi}^{\pi}x^k p(x)=0$ for $0\le k\le 6$. Find $p(0)$ and $p(-\pi)$.

Let $p(x)=a_0 + a_1 x+ a_2 x^2+ a_3 x^3+...+a_7 x^7.$
Then we can approach this problem by evaluating the definite integral given in question for each $k$, therefore giving us $7$ equations in $8$ variables $a_0, a_1,...,a_7$. We get eighth equation by using given condition $p(\pi)=\sqrt 3$.
This way we have $8$ equations with $8$ unknowns. We form following system of equations,
$$
    \left(\begin{matrix}
    1 & 0 & \frac {{\pi}^2}3 & 0 & \frac {{\pi}^4}5 & 0 & \frac {{\pi}^6}7 & 0 \\
    0 & \frac 13 & 0 & \frac {{\pi}^2}5 & 0 & \frac {{\pi}^4}7 & 0 & \frac {{\pi}^6}9 \\
    \frac 13 & 0 & \frac {{\pi}^2}5 & 0 & \frac {{\pi}^4}7 & 0 & \frac {{\pi}^6}9 & 0 \\
    0 & \frac 15 & 0 & \frac {{\pi}^2}7 & 0 & \frac {{\pi}^4}9 & 0 & \frac {{\pi}^6}{11} \\
    \frac 15 & 0 & \frac {{\pi}^2}7 & 0 & \frac {{\pi}^4}9 & 0 & \frac {{\pi}^6}{11} & 0 \\
    0 & \frac 17 & 0 & \frac {{\pi}^2}9 & 0 & \frac {{\pi}^4}{11} & 0 & \frac {{\pi}^6}{13} \\
    \frac 17 & 0 & \frac {{\pi}^2}9 & 0 & \frac {{\pi}^4}{11} & 0 & \frac {{\pi}^6}{13} & 0 \\
    1 & \pi & \pi^2 & \pi^3 & \pi^4 & \pi^5 & \pi^6 & \pi^7 
    \end{matrix}\right)
\cdot 
    \left(\begin{matrix}
    a_0  \\
    a_1  \\
    a_2  \\
    a_3 \\
    a_4 \\
    a_5 \\
    a_6 \\
    a_7  \\
    \end{matrix}\right)=
    \left(\begin{matrix}
    0  \\
    0 \\
    0  \\
    0 \\
    0   \\
    0 \\
    0 \\
    \sqrt 3 \\
    \end{matrix}\right)$$
If we solve this system of equations, then we get the values of $a_i$s. This way we have identified the polynomial $p(x)$. Once we have identified the polynomial it is easy to calculate $p(0)$ and $p(-\pi)$. Note that $p(0)=a_0$.
But this approach is very much lengthy. Is there a faster way?
 A: One way.
Consider the vector space $V$ of polynomials of degree $\le7$. We know from linear algebra that $\dim V=8$ and $\{1,x,x^2,\ldots,x^7\}$ is a basis.
We also know that the subspace $U$ spanned by $\{1,x,\ldots,x^6\}$ has dimension seven. We further know that
$$
(f,g)=\int_{-\pi}^\pi f(x)g(x)\,dx
$$
is an inner product on $V$.
Given all this, the conditions $(p(x),x^k)=0$, $k=0,1,2\ldots,6$, define the orthogonal complement
$$U^\perp =\{f(x)\in V\mid (f,g)=0\,\forall g\in U\}$$ of $U$ in $V$. Complementary subspaces have complementary dimensions, so $\dim U^\perp=8-7=1$. Thus $U^\perp$ is spanned by a single polynomial $p(x)$. Because $p(x)\notin U$, we know that $\deg p(x)=7$.
Drums, please.
But if $f(x)\in U^\perp$ so is $f(-x)$. This is because the substitution $x\mapsto -x$ gives us
$$(f(-x),x^k)=(f(x),(-x)^k)=(-1)^k(f(x),x^k)=0$$
for all $k=0,1,2,\ldots,6$.
So $p(-x)\in U^\perp$ and therefore $p(-x)=\lambda p(x)$ for some constant $\lambda\neq0$. A comparison of the leading coefficients of $p(x)$ and $p(-x)$ then leaves $\lambda=-1$ as the only possibility.
Therefore any polynomial $p(x)\in U^\perp$ is odd. That is, $p(-x)=-p(x)$ for all $x$. Consequently $p(0)=0$ and $p(-\pi)=-p(\pi)$.
