Differentiating roadmap of a loss function
Here the function used for $p_{i}$ is sigmoid function.
So,
                     $p_{i}$ = $\frac{1}{1+e^{-\Sigma w_{j} ∗ x_{i}^j}}$
$\frac{∂p_{i}} {w_{j}}$= $\frac{-1}{(1+e^{-\Sigma w_{j} ∗ x_{i}^j})^2}$ ∗ $e^{-\Sigma w_{j} ∗ x_{i}^j}$ ∗ $(-x_{i}^j)$

$\frac{∂p_{i}} {w_{j}}$ = $\frac{1}{(1+e^{-\Sigma w_{j} ∗ x_{i}^j})}$ ∗ $\frac{e^{-\Sigma w_{j} ∗ x_{i}^j}}{(1+e^{-\Sigma w_{j} ∗ x_{i}^j})}$ ∗ $x_{i}^j$

$1-p_{i}$ = $\frac{e^{-\Sigma w_{j} ∗ x_{i}^j}}{1+e^{-\Sigma w_{j} ∗ x_{i}^j}}$

$\frac{∂p_{i}} {w_{j}}$ = $p_{i}$ ∗ $(1-p_{i})$ ∗ $x_{i}^j$