If $$y=\{\log(1+x)\}^2$$
So, $$\frac{dy}{dx}=2\frac{\log(1+x)}{(1+x)}=2 (1+x)^{-1} \log(1+x)$$
$$=2\left(1+\frac{x(-1)}{1!}+\frac{x^2(-1)(-2)}{2!}+\frac{x^3(-1)(-2)(-3)}{3!}+\cdots\right)$$
$$\left(x-\frac{x^2}2+\frac{x^3}3-\frac{x^4}4+\cdots\right)$$
$$=2 (1-x+x^2-x^3+\cdots )\left(x-\frac{x^2}2+\frac{x^3}3-\frac{x^4}4+\cdots\right)$$
$$=2\{x+x^2\left(-\frac12-1\right)+x^3\left(\frac13+\frac12+1\right)+x^4\left(-\frac14-\frac13-\frac12-1\right)+\cdots\}$$
So, $$ dy =2\sum_{1\le r<\infty} H_rx^r(-1)^{r-1} dx$$ where $H_n=\sum_{1\le r\le n}\frac1r$
Integrating both sides, $y= 2\sum_{1\le r<\infty} \frac{H_rx^{r+1}(-1)^{r-1}}{r+1}+C$ where $C$ is an arbitrary constant for indefinite integral.
As at $x=0, y=\{\log(1+x)\}^2=0\implies C=0 $
$$\implies\{\log(1+x)\}^2=2\sum_{1\le r<\infty} \frac{H_rx^{r+1}(-1)^{r-1}}{r+1}$$