Calculus - First & Second Derivative Tests I am having a bit of trouble understanding, that is, tying together, the first and second derivative tests. 
I can sit down and work them out systematically (pretty well anyway), but am having a bit of trouble understanding the underlying logic, like why you evaluate the critical values [CV] of this function in that function, and when you need to evaluate values between intervals, and how far to go away from the CVs in the interval (especially for Trig functions that are periodic, etc). I also am having a bit of trouble considering the domains of previous functions in the evaluation of the aforementioned values.
For example, if we have the following function (and this may be a terrible example...):
$$f(x)=\frac{x^2+3}{x-1}$$
Then,
$$f\space^\prime(x)=\frac{x^2-2x-3}{(x-1)^2}$$
And
$$f\space^{\prime\prime}(x)=\frac{8}{(x-1)^3}$$
So here we are expected to find:


*

*$x$ and $y$ intercepts

*asymptotes

*CVs of $f\space^\prime(x)$ and $f\space^{\prime\prime}(x)$

*determine over which intervals $f(x)$ is increasing and decreasing

*determine over what intervals $f(x)$ is concave up or down

*at what $x$ values we have a local extrema and what that value is

*EDIT: Inflection Points


I am fine with the first few, and can power through the last to some degree of success when I am working like problems (such as 13, 14, and 15 in a section, where they would be of the same general question), but when the problems are just random ones picked from a section (Chapter 4 in Swokowski's Calculus, I believe), I completely blank out, leading me to the conclusion that I need to know more about the underlying logic. I always get hung up on drawing the interval graphs, and determining what numbers to test (what to test, and what the results represent, not how to actually test).
Also, I have a terrible time considering the domain throughout. For example, I know that $D=\mathbb{R}\setminus\{1\}$ for $f(x)$, but I'm not sure what to do with that knowledge throughout the problem.
If someone can guide me a bit though this, and maybe another problem ($f(x)=\cot(x)^2+2\cot x$ over $\left[\frac{\pi}{6},\frac{5\pi}{6}\right]$ hint hint), I'd be very grateful. I have already checked KhanAcademy.org, which has gotten me quite a ways in Calculus, but he doesn't seem to have any videos on the first and second derivative tests.
I'm especially afraid because we're beginning word problems on this subject tomorrow...
 A: You want to find the important characteristics of your function $f(x)$.
These include, but are not limited to:


*

*The domain of the function (if could be specified explicitly, or it may be the "natural domain", which you need to determine from the formula).

*The interecepts with the axes ($x$- and $y$-intercepts).

*The local extremes.

*The intervals where the function is increasing, decreasing, or constant.

*The intervals where the function is concave up, and where it is concave down.

*The global extremes, if any.

*The end behaviour, if any.


A function $f(x)$ can only have local extremes at points where (i) it is defined; and (ii) has a critical point. However, not every critical point needs to be a local extreme. A critical point is a point where the function is defined, and either the derivative does not exist or the derivative is equal to $0$.
If the derivative is continuous, then the only places where the derivative could change sign is at the critical points: this follows from the intermediate value theorem. If the derivative is positive at $a$ and negative at $b$, and is continuous on $[a,b]$, then it has to go through zero somewhere in between.
That means that if $p_1$ and $p_2$ are critical points of $f(x)$, and there is no critical points between $p_1$ and $p_2$, then the derivative has to be either always positive on $(p_1,p_2)$, or always negative on $(p_1,p_2)$. There are two ways to determine which it is: you can do a "sign analysis" of the derivative, which can be complicated. Or you can just plug in any number in $(p_1,p_2)$ into the derivative (any number, whichever one is simplest), and see if the derivative is positive there or negative there. That will tell you what sign the derivative is on the entire interval, because you know it has only one sign in that entire interval.
Once you know the critical points, you can pick any point between two of them to determine if the derivative is positive or negative on that interval. 
For example, if 
$$f(x) = \frac{x}{1+x^2},$$
then $$f'(x) = \frac{1-x^2}{(1+x^2)^2}.$$
The critical points are $x=1$ and $x=-1$. That means, since the derivative is continuous, that the only places where $f'(x)$ can change from positive to negative (the only places where $f(x)$ can change from increasing to decreasing), and the only places where $f(x)$ can change from negative to positive (the only places where $f(x)$ can change from decreasing to increasing) are the points where $f'(x)=0$, i.e., $x=-1$ and $x=1$. That means that the derivative has to be either always positive or always negative on $(-\infty,-1)$; always positive or always negative on $(-1,1)$; and always positive or always negative on $(1,\infty)$.
How do you tell which? You can do a sign analysis, or you can just plug in any number! Plug in any number in $(-\infty,-1)$ into $f'(x)$: if you get a negative answer, then $f'(x)$ has to be "always negative" on $(-\infty,-1)$. If you get a positive answer, then $f'(x)$ has to be "always positive" on $(-\infty,-1)$. Which number do you plug in? Any number; whatever number makes it easy to figure out. For instance, plug in $x=-2$; you get $f'(-2) = \frac{-3}{25}\lt 0$, so $f'(x)$ is always negative on $(-\infty,-1)$. 
How do you tell whether $f'(x)$ is always positive or always negative on $(-1,1)$? You can plug in any number that is in $(-1,1)$ and that will tell you: for instance, $x=0$ is easy, and $f'(0) = 1\gt 0$, so $f'(x)$ is always positive on $(-1,1)$.
How do you tell whether $f'(x)$ is always positive or always negative on $(1,\infty)$? You can plug in any number that is in $(1,\infty)$ and see if you get a positive number of a negative number; that will tell you which sign $f'(x)$ is on the entire interval because $f'(x)$ cannot change signs there (because there are no critical points; it can't go from positive to negative or from negative to positive without either a break, or going through the $x$-axis). 
Once you have that, you can use it to determine that $f'(x)$ is negative on $(-\infty,-1)$, positive on $(-1,1)$, and negative on $(1,\infty)$, which in turn tells you that $f(x) $is decreasing on $(-\infty,-1]$, increasing on $[-1,1]$, and decreasing on $[1,\infty)$, which gives you the local extremes (which are points where $f(x)$ changes from increasing to decreasing or from decreasing to increasing).
Points of inflection work the same way, because:
  - $f(x)$ is concave up exactly where $f'(x)$ is increasing;
  - $f(x)$ is concave down exactly where $f'(x)$ is decreasing;
  - $f(x)$ changes concavity exactly where $f'(x)$ has local extremes (which are where $f'(x)$ changes from increasing to decreasing or from decreasing to increasing).
That means that the exact same logic that applies to finding critical points for $f(x)$ and figuring out where $f'(x)$ is positive and negative in order to find the local extremes of $f(x)$ can be used to find the points of inflection of $f(x)$: just apply that logic to $f'(x)$ and $f''(x)$ instead of to $f(x)$ and $f'(x)$, because you are just looking for the local extremes of $f'(x)$ (instead of $f(x)$), and that will give you the points of inflection of $f(x)$. 
The First Derivative Test works because it tells you that $f(x)$ is changing from increasing to decreasing (if $f'(x)$ is switching from positive to negative at $p$), which  means the function $f(x)$ is "going up" to $f(p)$, and then "coming down" from $f(p)$, which means $f(p)$ is a local maximum; or that $f(x)$ is switching from decreasing to increasing (if $f'(x)$ is switching from positive to negative at $p$), which means $f(x)$ is "going down" to $f(p)$ and then "going up" from $f(p)$, so $f(p)$ is a local minimum. Or that $f'(x)$ does not change signs, which means $f(x)$ is either "going up" to $f(p)$ and then keeps going up (so $f(p)$ is not a local extreme), or "goes down" to $f(p)$ and then keeps going down (so $f(p)$ is not a local extreme).
The Second Derivative Test works because if $f''(p)\gt 0$ that means $f'(x)$ is increasing around $p$. Since $f'(p)=0$ and $f'(x)$ is increasing, it has to be negative to the left of $p$ and positive to the right; in terms of the First Derivative Test, this tells you that $f(x)$ has a local minimum at $p$. And if $f''(p)\lt 0$, that means $f'(x)$ is decreasing near $p$, and since $f'(p)=0$, to be decreasing it has to be positive to the left of $p$ and negative to the right of $p$, which means (in terms of the First Derivative Test) that $f(x)$ has a local maximum at $p$.
