## 5 Two-Parameter Family of Densities with Different Degrees of Smoothness
### Expansion Coefficients of Test Functions (Fourier-Legendre Series)  
To exactly calculate the second term of the projection estimate error (27) in examples, we find expansion coefficients \(G_{v_{1},v_{2},i}\) of the density \(g_{v_{1},v_{2}}\), as well as expansion coefficients \(F_{v_{1},v_{2},i}\) of the distribution function \(f_{v_{1},v_{2}}\) with respect to Legendre polynomials (6):\[g_{v_{1},v_{2}}(x)=\sum_{i=0}^{\infty}G_{v_{1},v_{2},i}\hat{P}_{i}(x),\ \ f_{v_{1},v_{2}}(x)=\sum_{i=0}^{\infty}F_{v_{1},v_{2},i}\hat{P}_{i}(x).\]  
First, we obtain the following values:  
\[Q^{-}_{v,i}=\int_{-1}^{0}x^{v}P_{i}(x)dx,\ \ \ Q^{+}_{v,i}=\int_{0}^{1}x^{v}P_{i}(x)dx. \tag{37}\]  
We multiply the left-hand and right-hand sides of relation (1) by \(x^{v-1}\) and integrate over the interval \([-1,0]\):  
\[(i+1)\int_{-1}^{0}x^{v-1}P_{i+1}(x)dx=(2i+1)\int_{-1}^{0}x^{v}P_{i}(x)dx-i\int_ {-1}^{0}x^{v-1}P_{i-1}(x)dx,\]  
or  
\[(i+1)Q^{-}_{v-1,i+1}=(2i+1)Q^{-}_{v,i}-iQ^{-}_{v-1,i-1},\ \ \ Q^{-}_{v,i}=\frac{(i+1)Q^{-}_{v-1,i+1}+iQ^{-}_{v-1,i-1}}{2i+1}. \tag{38}\]  
Similarly, by multiplying the left-hand and right-hand sides of relation (1) by \(x^{v-1}\) and integrating over the interval \([0,1]\), we obtain  
\[Q^{+}_{v,i}=\frac{(i+1)Q^{+}_{v-1,i+1}+iQ^{+}_{v-1,i-1}}{2i+1}.\]  
These relations can be formally applied for \(i=0\) when \(Q^{-}_{v,-1}=Q^{+}_{v,-1}=0\) but not for \(v=0\). Therefore, we should consider the case \(v=0\) separately:  
\[Q^{-}_{0,i}=\int_{-1}^{0}P_{i}(x)dx,\ \ \ Q^{+}_{0,i}=\int_{0}^{1}P_{i}(x)dx.\]  
For \(i=0\) and \(i=1\), we have  
\[Q^{-}_{0,0}=\int_{-1}^{0}P_{0}(x)dx=\int_{-1}^{0}dx=1,\ \ \ Q^{-}_{0,1}=\int_{-1}^{0}P_{1}(x)dx=\int_{-1}^{0} xdx=-\frac{1}{2},\]  
and then we use relation (17):  
\[Q^{-}_{0,i}=\int_{-1}^{0}P_{i}(x)dx=\frac{P_{i+1}(0)-P_{i-1}(0)}{2i+1},\ \ \ i=1,2,\ldots\]  
If \(i\
eq 0\) is even, then \(P_{i+1}(0)=P_{i-1}(0)=0\) according to Formula (5), and \(Q^{-}_{0,i}=0\). If \(i\) is odd, then we can apply the explicit Formula (4) or obtain an additional recurrence relation. We choose the latter way and take into account relation (1) for \(x=0\):  
\[(i+1)P_{i+1}(0)=-iP_{i-1}(0).\]  
Then,  
\[\frac{Q^{-}_{0,i}}{Q^{-}_{0,i-2}} =\frac{P_{i+1}(0)-P_{i-1}(0)}{2i+1}\,\frac{2i-3}{P_{i-1}(0)-P_{i- 3}(0)}\] \[Q^{-}_{v,i}=\int_{-1}^{0}x^{v}P_{i}(x)dx,\ \ \ Q^{+}_{v,i}=\int_{0}^{1}x^{v}P_{i}(x)dx. \tag{37}\]0 \[Q^{-}_{v,i}=\int_{-1}^{0}x^{v}P_{i}(x)dx,\ \ \ Q^{+}_{v,i}=\int_{0}^{1}x^{v}P_{i}(x)dx. \tag{37}\]1i.e.,  
\[Q^{-}_{v,i}=\int_{-1}^{0}x^{v}P_{i}(x)dx,\ \ \ Q^{+}_{v,i}=\int_{0}^{1}x^{v}P_{i}(x)dx. \tag{37}\]2  
The same reasoning leads to the following results:  
\[Q^{-}_{v,i}=\int_{-1}^{0}x^{v}P_{i}(x)dx,\ \ \ Q^{+}_{v,i}=\int_{0}^{1}x^{v}P_{i}(x)dx. \tag{37}\]3  
and  
\[Q^{-}_{v,i}=\int_{-1}^{0}x^{v}P_{i}(x)dx,\ \ \ Q^{+}_{v,i}=\int_{0}^{1}x^{v}P_{i}(x)dx. \tag{37}\]4  
where \(Q_{0,i}^{+}=0\) for even \(i\
eq 0\). For odd \(i\), we have  
\[Q^{-}_{v,i}=\int_{-1}^{0}x^{v}P_{i}(x)dx,\ \ \ Q^{+}_{v,i}=\int_{0}^{1}x^{v}P_{i}(x)dx. \tag{37}\]5  
Thus, we obtain the general expression for calculating \(Q_{\
u,i}^{-}\) and \(Q_{\
u,i}^{+}\) with arbitrary non-negative integers \(\
u\) and \(i\):  
\[Q_{\
u,i}^{\pm}=\left\{ \begin{array}{ll}1&\text{for $\
u=i=0$,}\\ \pm\frac{1}{2}&\text{for $\
u=0$ and $i=1$,}\\ 0&\text{for $\
u=0$ and $i=2,4,6,\ldots$,}\\ \frac{2-i}{i+1}\,Q_{0,i-2}^{\pm}&\text{for $\
u=0$ and $i=3,5,7,\ldots$,}\\ \frac{(i+1)Q_{\
u-1,i+1}^{\pm}+iQ_{\
u-1,i-1}^{\pm}}{2i+1}&\text{otherwise,} \end{array}