Differentiating a rational function

Excuse me if I make any improper use of mathematical experssions because English isn't my mother-tongue and I don't study math in English.

I'm a high school student in the 10th. I have math exam tomorrow and while stuyding I came across this question where I must differentiate a rational function. The function is:

y = 3 / ( (2x+1)^3 * sqrt(2x+1) )

I solved it by first adding a minus, then squaring the denominator, then multiplying by the derivative of the denominator, which is 3.5*(2x+1)^2.5 * 2... This obviously gave me a correct answer...

However, I recall that our teacher once mentioned a shortcut to derive a rational function, but gave us a simpler example. He said, in general:

y = 1/x^n
y' = - n / x^n+1

But if I try to solve it that way, I get:

y' = - 10.5 / (2x+1)^4.5, whilst the correct final derivative has 21 in the numerator. That means that I must multiply it by 2, which is the internal-derivative (dunno how u call it, but I'm referring to the 2x+1) of the denominator!

So is that correct? Can I solve it in the above-mentioned method? If so, has the teacher actually missed that specific detail when he gave us the general law?

The answer is no! Your function is not of the form $\displaystyle 1 / x^n$; it is of the form $\displaystyle 1 / u^n$ where $\displaystyle u$ is a function of $\displaystyle x$ (here, $\displaystyle u = (2x + 1)$).

In a problem like yours, where $\displaystyle y$ is a function of $\displaystyle u$, and $\displaystyle u$ is a function of $\displaystyle x$, you need to use a theorem called the chain rule. The chain rule states: