Find a polynomial $P$ of the smallest degree such that $\int_{-1}^{1}\left|x^{2 / 3}-P(x)\right|^{2} d x<0.01$

It is standard $L^2$ on $[-1,1]$, and the orthogonal polynomials are the Legendre polynomials. Or you can calculate the distance from your function to the space $\langle 1, x, \ldots, x^n\rangle$ using Gram determinants.

$\bf{Added:}$

Let us do some calculations. The Legendre $P_n(x)$ polynomials $P_n(x)$ on $[-1,1]$ are an orthogonal system. $P_n(x)$ is of degree $n$, and orthogonal to $1$, $x$, $\ldots$, $x^{n-1}$. This leaves it uniquely determined up to a normalizing constant, which it is such that $P_x(1)=1$. Here is a list of the first $6$ polynomials.

$$ 1, x, \frac{1}{2}(-1 + 3 x^2), \frac{1}{2}(-3 x + 5 x^3), \frac{1}{8}(3 - 30 x^2 + 35 x^4), \frac{1}{8}(15 x - 70 x^3 + 63 x^5)$$

The projection of a vector on a subspace spanned by several orthogonal vectors $w_k$ is $$\pi(v) = \sum_k \frac{\langle v, v_k\rangle v_k}{\langle v_k, v_k\rangle}$$ and the distance squared from $v$ to this subspace is $$d^2 =\|v\|^2 - \sum_k \frac{|\langle v, w_k\rangle|^2}{\|w_k\|^2}$$

Now, for the Legendre polynomials we have $\|P_n(x)\|^2 = \frac{2}{2n+1}$.

Another approach is with Gram matrices and determinants. The distance squared from $x^{\alpha}$ to a space of functions $\langle x^{\alpha_i} \rangle$ equals $G(x^{\alpha}, x^{\alpha_i})/ G( x^{\alpha_i})$.

Notice that $x^{2/3}$ is even, so it will project into even functions. Recall that for $\beta$ even we have $\int_{-1}^1 x^{\beta} = 2/(\beta+1)$. Therefore, for $\alpha_i$ even the Gram determinant $G(x^{\alpha_i})$ is a Cauchy dererminant $$\det(\frac{2}{\alpha_i + \alpha_j+1}) = 2^{|I|} V(\alpha_i)^2 \cdot \prod_{i,j} \frac{1}{\alpha_i + \alpha_j + 1}$$ where $V$ is a Vandermonde determinant.

We conclude that the distance squared from even $x^{\alpha}$ to $\langle 1, x^2, \ldots, x^{2n}\rangle$ equals $$d^2 = \frac{2}{2\alpha+ 1} \prod_{k=0}^n \frac{(2k -\alpha)^2}{(2k +\alpha + 1)^2}$$


First, let us try $\mathrm{deg} P(x) \le 2$. Let $P(x) = ax^2 + bx + c$. We have $$\int_{-1}^1 |\sqrt[3]{x^2} - P(x)|^2 \mathrm{d} x = \frac{2}{5}a^2 + \frac{4}{3}ac + \frac{2}{3}b^2 + 2c^2 - \frac{12}{11}a - \frac{12}{5} c + \frac{6}{7}.$$ It is easy to minimize a quadratic form. The best $P(x)$ is given by $P(x) = \frac{9}{11}x^2 + \frac{18}{55}$ with $\int_{-1}^1 |\sqrt[3]{x^2} - P(x)|^2 \mathrm{d} x = 384/21175 \approx 0.01813 > \frac{1}{100}$.

Similarly, we try $\mathrm{deg} P(x) \le 3$. The best $P(x)$ is the same as that of $\mathrm{deg} P(x) \le 2$.

Then we try $\mathrm{deg} P(x) \le 4$. The best $P(x)$ is given by $P(x) = -\frac{189}{187}x^4 + \frac{315}{187}x^2 + \frac{45}{187}$ with $\int_{-1}^1 |\sqrt[3]{x^2} - P(x)|^2 \mathrm{d} x = 1536/244783 \approx 0.006275 < \frac{1}{100}$.

Thus, the smallest degree is $4$.

Remark: How to find the best $P(x)$ if $\mathrm{deg} P(x) \le 2n$? Let $P(x) = a_{2n}x^{2n} + \cdots + a_0$. We set $$\frac{\partial }{\partial a_k} \int_{-1}^1 |\sqrt[3]{x^2} - P(x)|^2 \mathrm{d} x = 0, \ k=0, 1, \cdots, 2n.$$