# Help with a derivative

I need to take the derivative of the following function w.r.t. $x$.

(This is the General Beta of the Second Kind density function.)

$$\frac{a}{bB(p,q)}\frac{(x/b)^{ap-1}}{(1+(x/b)^a)^{p+q}}$$

$B(p,q)$ is the beta function.

Don't need the answer per se, but would appreciate some advice on what strategy I should use, especially as regards the derivative of the beta function.

Thanks

-
Please clarify: Are the variables $a, b, p, q$ independent of $x$? If so, then this question is not as intimidating as it may first seem. For example, I don't even need to know what $B(p, q)$ is to know that it is constant with respect to $x$. – Shaun Ault Jul 21 '11 at 0:09
Just do it the normal way; or take the log of your expression and calculate its derivative. – Apprentice Queue Jul 21 '11 at 0:34
@Ben: You can disregard the first fraction as a constant multiple and the second fraction you can use the power rule after doing some simplifying. – night owl Jul 21 '11 at 0:47
The ugly (or attractive) thing in front is just a constant, to make the "total probability" equal to $1$. There is less to this problem than meets the eye! – André Nicolas Jul 21 '11 at 14:53
@ben: I posted an answer assuming that $p,q$ are independent of $x$. Is that so? If you confirm I will undelete my answer. – Américo Tavares Jul 21 '11 at 16:53

Assuming that everything is real-valued and that a, b, p, and q are all independent of x, then we consider the following problem.

$$\left( K\frac{x^{ap-1} }{(1 + (x/b)^a)^{p + q}} \right)'$$ where $K = \dfrac{a}{bB(p,q) \cdot b^{ap-1}}$, i.e. constant to x. This is not such a bad problem, as it's just a composition of various functions that we learn how to differentiate in an intro calc class. But it's not very fun looking, and it's a bit messy. But keep track of the factors and plug along.

Now it's an application of either the quotient rule or the product rule - one's choice. I choose the product rule today. So we note the following: $(x^{ap-1})' = (ap-1)x^{ap-2}$ and $(\;(1 + \frac{x^a}{b^a})^{-p-q}\;)'$ which, remembering the chain rule, becomes $(-p-q) (1 + \frac{x^a}{b^a})^{-p-q-1} \cdot \frac{ax^{a-1} }{b^a}$.

Putting these together, one gets $$K \left( \frac{(ap-1)x^{ap-2}}{(1 + \frac{x^a}{b^a})^{p+q}} + \frac{x^{ap-1} \cdot -(p+q) (\frac{ax^{a-1}}{b^a})}{(1 + \frac{x^a}{b^a})^{p+q+1}} \right)$$

And I have done my best to put factors in the order in which they appear from using the chain, product, and power rules.

-
Yes x is independent of the parameters a,b,p,q and everything is real valued. Thanks everybody! Unfortunately I just realized I also need to take the derivative with respect to each of the parameters! – ben Jul 22 '11 at 6:14
@ben: you need to find 5 different derivatives? A total derivative? What's the overall goal? – mixedmath Jul 22 '11 at 7:19
The overall goal is to fit this model to a dataset via minimizing the sum of squared errors. Hence I need to know the derivative of the model with respect to the four parameters a,b,p,q (so that I can subsequently do a Newton-Raphson method to solve for the minimizing parameter values) – ben Aug 15 '11 at 0:25