What is the result of $\frac{\partial^2 \ell(\beta)}{\partial \beta \partial \beta^T}$? For logistic regression model, the log-likelihood function can be written as
$$\ell(\beta)=\sum_{i=1}^N(y_i\beta^Tx_i-\log(1+e^{\beta^Tx_i}))$$
This is a $(p+1)$ nonlinear equations in $\beta$. To solve this problem, we use the Newton-Raphson algorithm, which requires the second-derivative
$$\frac{\partial^2 \ell(\beta)}{\partial \beta \partial \beta^T}=-\sum_{i=1}^Nx_ix_i^Tp(x_i;\beta)(1-p(x_i;\beta)) \,(*)$$
where $p(x_i;\beta)=1-\frac{1}{1+e^{\beta^Tx_i}}$.
My question is how to get (*)?
I know that
$$\frac{\partial \ell}{\partial \beta }=\sum_i (y_ix_i-\frac{e^{\beta^Tx_i}x_i}{1+e^{\beta^Tx_i}})\in R^{(p+1)\times 1}$$
But what is $$\frac{\partial^2 \ell(\beta)}{\partial \beta \partial \beta^T}?$$
I get
$$\frac{\partial^2 \ell(\beta)}{\partial \beta \partial \beta^T}=\frac{\partial}{\partial \beta^T }(\sum_i (y_ix_i-\frac{e^{\beta^Tx_i}x_i}{1+e^{\beta^Tx_i}}))=?$$

I'm not going to go through the entire calculation (mostly because I'm not confident that I can do it correctly, but after a couple minutes of algebra I think I can add some value).
First, let's note that if you have
$$ f(z) = \dfrac{1}{1 + \exp(-z)} \>, $$
then $$f'(z) = f(z)\Big(1-f(z)\Big) \>.$$
You can check that by either solving this differential equation, or by doing the algebra and checking that the LHS is the same as the RHS.
You can use this fact to determine that
$$ \dfrac{\partial}{\partial \beta} f(x^T\beta) = x^Tf(x^T\beta) \Big( 1-  f(x^T \beta) \Big) $$
by using the product rule.
These facts alone can get you very far in taking derivatives of the likelihood function, especially if you write it in the familiar form
$$ \ell(\beta) = \sum_i y_i \log(p_i) + (1-y_i) \log(1-p_i) $$
being sure to keep in mind that $p_i = p_i(x^T \beta)$
