You should use substitution method, hence, you need to come up with the following substitution, such that:

`x + 1 = t^2 => x + 2 = t^2 + 1`

`sqrt(x + 1) = sqrt t^2 = |t|`

`x + 1 = t^2 => dx = 2tdt`

Changing the variable, yields:

`int sqrt(x + 2 + 2sqrt(x + 1))dx = int sqrt(t^2 + 1 + 2t) 2t*dt`

You should notice that `t^2 + 2t + 1` represents the expansion of the squared binomial `(t + 1)^2` , hence, you may replace `(t + 1)^2` for `t^2 + 2t + 1` , such that:

`int sqrt(t^2 + 1 + 2t) 2t*dt = int 2tsqrt((t + 1)^2) dt`

`int 2tsqrt((t + 1)^2) dt = int 2t|t+1| dt `

Using the absolute value definition, yields:

`|t+1| = {(t+1, t>=-1),(-1-t, t<-1):}`

Using the property of linearity of integral yields:

`int 2t|t+1| dt = int 2t(t+1)dt = int 2t^2 dt + int 2t dt`

`int 2t(t+1)dt = 2t^3/3 + 2t^2/2 + c`

`int 2t(t+1)dt = 2t^3/3 +t^2 + c, if t >= -1 `

`int 2t|t+1| dt = -2t^3/3 - t^2 + c, if t<-1`

Replacing back `sqrt(x + 1)` for `t` , yields:

`int sqrt(x + 2 + 2sqrt(x + 1))dx = 2sqrt((x+1)^3)/3 + x + 1 + c`

**Hence, evaluating the given indefinite integral, using the indicated substitution, yields **`int sqrt(x + 2 + 2sqrt(x + 1))dx = (2(x+1)sqrt(x+1))/3 + x + 1 + c.`