Solve \(5x + 13 = \left|5(x + 1)^2 - 2\right|\) algebraically.