Let's consider $f \colon \mathbb{R}^n \to \mathbb{R}$,
$$f(\mathbf{x}) = \mathbf{c}^T\mathbf{x} - \sum_{i=1}^{m} \log(b_i - \mathbf{a}_i^T\mathbf{x}), $$
with $\mathbf{x} \in \mathbb{R}^n$, $\mathbf{c} \in \mathbb{R}^n$, $\mathbf{b} \in \mathbb{R}^m$, $\mathbf{a}_i \in \mathbb{R}^n$, for $i = 1,\ldots,m$, so $\mathbf{A} \in \mathbb{R}^{n\times m}$.
$\mathbf{dom}f$ contains the $\mathbf{x}$ for which the arguments of the logarithms are positive.
(Note: I have also seen $f$ written as, $f(\mathbf{x}) = \mathbf{c}^T\mathbf{x} - \operatorname{sum}(\log(\mathbf{b} - \mathbf{A}\mathbf{x}) )$.)
I have to prove that $f$ is convex (most likely using the second derivative theorem).
I am not sure how to proceed. I have read that:
$$ \nabla \biggl( \sum_{i=1}^{m} \log(b_i - \mathbf{a}_i^T\mathbf{x}) \biggr) = \sum_{i=1}^{m} \frac{1}{b_i - \mathbf{a}_i^T\mathbf{x}}\mathbf{a}_i $$
But I don't fully understand it.