Solution (source code)

= Solution
{c}

When $n=0$, the forcing has nonzero integral $\int_{-1}^11\,dx=2$, violating the <Fredholm alternative> condition. There is no bounded solution. Directly, integration gives $(1-x^2)y'=x+B$; cancellation of its logarithmic divergence at $x=-1$ requires $B=1$, while cancellation at $x=1$ requires $B=-1$.

For $n\geq1$, the constant $1/[n(n+1)]$ is a <particular solution>. Subtract it from any solution. The remainder satisfies the <Legendre differential equation>, whose <general solution> is a combination of $P_n$ and the logarithmically unbounded <Legendre function of the second kind>. Boundedness removes the latter coefficient, giving
$$
\boxed{\begin{cases}
\text{no bounded solution},&n=0,\\
y(x)=\dfrac1{n(n+1)}+CP_n(x),\quad C\in\mathbb R,&n\geq1.
\end{cases}}
$$
The constant forcing is <orthogonal> to $P_n$ for $n\geq1$, consistently with <Orthogonality of Legendre polynomials> and the <Fredholm alternative>.