We consider the fractional Laplacian operator (−Δ)s (let s∈(0,1)) on Euclidean space and investigate the validity of the classical integration-by-parts formula that connects the L2(Rd) scalar product between a function and its fractional Laplacian to the nonlocal norm of the fractional Sobolev space . More precisely, we focus on functions belonging to some weighted L2 space whose fractional Laplacian belongs to another weighted L2 space: we prove and disprove the validity of the integration-by-parts formula depending on the behaviour of the weight ρ(x) at infinity. The latter is assumed to be like a power both near the origin and at infinity (the two powers being possibly different). Our results have direct consequences for the self-adjointness of the linear operator formally given by ρ−1(−Δ)s. The generality of the techniques developed allows us to deal with weighted Lp spaces as well.