Find the minimum $n$ such that $x^2+7=\sum_{k=1}^n f_k(x)^2$ where $f_k(x)\in \mathbb{Q}[x]$ Recently, I have found this problem:

Find the minimum $n \in N$ such that $x^2+7=f_1(x)^2+f_2(x)^2+\cdots+f_n(x)^2$ where $f_1(x),+f_2(x),+\cdots+f_n(x)$ are polynomials with rational coefficients. 

I have tried to solve this problem when $n=2$ using $f_1(x)=(a_1x+b_1)^2$ and $f_2(x)=-(a_2x+b_2)^2$, but I can't go on. Any idea?

You cannot go on this way, because even if you take a function negative, its square will be positive. Observe that degree of all of the polynomials is less than 2, because degree of LHS and RHS should match. It is easy to see that $n=1$ is not a solution. For $n=2$, we observe,
$$(ax+b)^2+(cx+d)^2=x^2+7$$
$$\Longrightarrow (a^2+c^2)x^2+2(ab+cd)x+(b^2+d^2)=x^2+7$$
$$\Longrightarrow a^2+c^2=1, ab+cd=0, b^2+d^2=7$$
Now, apply a trick. From second equation we get,
$$ab=-cd$$
$$\Longrightarrow \frac{a}{d}=\frac{-c}{b}$$
Apply ratio and proportion,
$$\Longrightarrow \frac{a}{d}=\frac{-c}{b}=\pm\sqrt{\frac{a^2+c^2}{d^2+b^2}}$$
The ratio on the RHS is irrational by first and third equations. Hence, $n=2$ is also not a solution.
For, $n=3$, we have the following solution.
$$f_1(x)=x$$
$$f_2(x)=\frac{21}{5}$$
$$f_3(x)=\frac{28}{5}$$
Hence, this is the required solution.
Hope it helps:)
