DSolve[{y''[x]*y[x]+y'[x]^2+1==0,y[a]==A,y[b]==B},y[x],x]

DSolve[{z''[x]==-2,z[a]==A^2,z[b]==B^2},z[x],x]